1# Copyright 2010, 2011 Free Software Foundation, Inc.
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16if $tracelevel then {
17    strace $tracelevel
18}
19
20
21if [is_remote target] then {
22    return 0
23}
24
25
26#
27# test running programs
28#
29
30set testfile "label"
31set srcfile ${testfile}.c
32set binfile ${objdir}/${subdir}/${testfile}
33
34if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c debug] } {
35    untested label.exp
36    return -1
37}
38
39
40if {![runto_main]} {
41  fail "label tests suppressed"
42  return -1
43}
44
45gdb_test "break here" \
46  "Breakpoint.*at.*" \
47  "breakpoint here"
48
49gdb_test "break main:there" \
50  "Breakpoint.*at.*" \
51  "breakpoint there"
52
53gdb_test "cont" \
54  "Breakpoint 3,.*" \
55  "continue to 'there'"
56
57gdb_test "cont" \
58  "Breakpoint 2,.*" \
59  "continue to 'here'"
60
61rerun_to_main
62
63gdb_test "cont" \
64  "Breakpoint 3,.*" \
65  "continue to 'there' after re-run"
66