]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/structs2.exp
run copyright.sh for 2011.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / structs2.exp
CommitLineData
7b6bb8da
JB
1# Copyright 1998, 1999, 2007, 2008, 2009, 2010, 2011
2# Free Software Foundation, Inc.
c906108c
SS
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
c906108c 7# (at your option) any later version.
e22f8b7c 8#
c906108c
SS
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
e22f8b7c 13#
c906108c 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 16
c906108c
SS
17if $tracelevel then {
18 strace $tracelevel
19}
20
c906108c
SS
21set prototypes 1
22set testfile "structs2"
23set srcfile ${testfile}.c
24set binfile ${objdir}/${subdir}/${testfile}
25
e12a46c9
RC
26# Create and source the file that provides information about the compiler
27# used to compile the test case.
28if [get_compiler_info ${binfile}] {
29 return -1;
30}
31
c906108c
SS
32# build the first test case
33if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
34 # built the second test case since we can't use prototypes
35 warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
36 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
b60f0898
JB
37 untested structs2.exp
38 return -1
c906108c
SS
39 }
40 set prototypes 0
41}
42
43# Start with a fresh gdb.
44
45gdb_start
46gdb_reinitialize_dir $srcdir/$subdir
47gdb_load ${binfile}
48
27d3a1a2 49gdb_test_no_output "set width 0"
c906108c
SS
50
51if { ![runto_main] } then {
52 gdb_suppress_tests
53}
54
55# Ok, we're finally ready to actually do our tests.
56
c906108c
SS
57gdb_test "f" \
58 ".*bkpt = 0.*" \
59 "structs2 sanity check"
60
61gdb_test "break param_reg" \
62 "Breakpoint .* at .*" \
63 "structs2 breakpoint set"
64
36ae0ea9 65if [test_compiler_info gcc-3-*] {
e12a46c9
RC
66 setup_xfail hppa*-* gcc/15860
67}
c906108c
SS
68gdb_test "continue" \
69 ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \
70 "structs2 continue1"
71
36ae0ea9 72if [test_compiler_info gcc-3-*] {
e12a46c9
RC
73 setup_xfail hppa*-* gcc/15860
74}
c906108c
SS
75gdb_test "continue" \
76 ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
77 "structs2 continue2"
78
79# End of tests.
80
81gdb_stop_suppressing_tests
82
83return 0