2011-05-30 Yao Qi <yao@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / label.exp
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
16 if $tracelevel then {
17 strace $tracelevel
18 }
19
20
21 if [is_remote target] then {
22 return 0
23 }
24
25
26 #
27 # test running programs
28 #
29
30 set testfile "label"
31 set srcfile ${testfile}.c
32 set binfile ${objdir}/${subdir}/${testfile}
33
34 if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c debug] } {
35 untested label.exp
36 return -1
37 }
38
39
40 if {![runto_main]} {
41 fail "label tests suppressed"
42 return -1
43 }
44
45 gdb_test "break here" \
46 "Breakpoint.*at.*" \
47 "breakpoint here"
48
49 gdb_test "break main:there" \
50 "Breakpoint.*at.*" \
51 "breakpoint there"
52
53 gdb_test "cont" \
54 "Breakpoint 3,.*" \
55 "continue to 'there'"
56
57 gdb_test "cont" \
58 "Breakpoint 2,.*" \
59 "continue to 'here'"
60
61 rerun_to_main
62
63 gdb_test "cont" \
64 "Breakpoint 3,.*" \
65 "continue to 'there' after re-run"
This page took 0.030918 seconds and 4 git commands to generate.