1# Copyright 2010-2013 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
17if [is_remote target] then {
18    return 0
19}
20
21
22#
23# test running programs
24#
25
26set testfile "label"
27set srcfile ${testfile}.c
28set binfile ${objdir}/${subdir}/${testfile}
29
30if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c debug] } {
31    untested label.exp
32    return -1
33}
34
35
36if {![runto_main]} {
37  fail "label tests suppressed"
38  return -1
39}
40
41gdb_test "break here" \
42  "Breakpoint.*at.*" \
43  "breakpoint here"
44
45gdb_test "break main:there" \
46  "Breakpoint.*at.*" \
47  "breakpoint there"
48
49gdb_test "cont" \
50  "Breakpoint 3,.*" \
51  "continue to 'there'"
52
53gdb_test "cont" \
54  "Breakpoint 2,.*" \
55  "continue to 'here'"
56
57rerun_to_main
58
59gdb_test "cont" \
60  "Breakpoint 3,.*" \
61  "continue to 'there' after re-run"
62