gdb/testsuite/
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / structs2.exp
CommitLineData
0fb0cc75 1# Copyright 1998, 1999, 2007, 2008, 2009 Free Software Foundation, Inc.
c906108c
SS
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
c906108c 6# (at your option) any later version.
e22f8b7c 7#
c906108c
SS
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.
e22f8b7c 12#
c906108c 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 15
c906108c
SS
16if $tracelevel then {
17 strace $tracelevel
18}
19
20set prms_id 0
21set bug_id 0
22
23set prototypes 1
24set testfile "structs2"
25set srcfile ${testfile}.c
26set binfile ${objdir}/${subdir}/${testfile}
27
e12a46c9
RC
28# Create and source the file that provides information about the compiler
29# used to compile the test case.
30if [get_compiler_info ${binfile}] {
31 return -1;
32}
33
c906108c
SS
34# build the first test case
35if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
36 # built the second test case since we can't use prototypes
37 warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
b60f0898
JB
39 untested structs2.exp
40 return -1
c906108c
SS
41 }
42 set prototypes 0
43}
44
45# Start with a fresh gdb.
46
47gdb_start
48gdb_reinitialize_dir $srcdir/$subdir
49gdb_load ${binfile}
50
a0b3c4fd 51gdb_test "set width 0" ""
c906108c
SS
52
53if { ![runto_main] } then {
54 gdb_suppress_tests
55}
56
57# Ok, we're finally ready to actually do our tests.
58
59set prms_id 13536
60set bug_id 0
61
62gdb_test "f" \
63 ".*bkpt = 0.*" \
64 "structs2 sanity check"
65
66gdb_test "break param_reg" \
67 "Breakpoint .* at .*" \
68 "structs2 breakpoint set"
69
36ae0ea9 70if [test_compiler_info gcc-3-*] {
e12a46c9
RC
71 setup_xfail hppa*-* gcc/15860
72}
c906108c
SS
73gdb_test "continue" \
74 ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \
75 "structs2 continue1"
76
36ae0ea9 77if [test_compiler_info gcc-3-*] {
e12a46c9
RC
78 setup_xfail hppa*-* gcc/15860
79}
c906108c
SS
80gdb_test "continue" \
81 ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
82 "structs2 continue2"
83
84# End of tests.
85
86gdb_stop_suppressing_tests
87
88return 0
This page took 0.917323 seconds and 4 git commands to generate.