revert previous patch
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / structs2.exp
CommitLineData
4c38e0a4 1# Copyright 1998, 1999, 2007, 2008, 2009, 2010 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
c906108c
SS
20set prototypes 1
21set testfile "structs2"
22set srcfile ${testfile}.c
23set binfile ${objdir}/${subdir}/${testfile}
24
e12a46c9
RC
25# Create and source the file that provides information about the compiler
26# used to compile the test case.
27if [get_compiler_info ${binfile}] {
28 return -1;
29}
30
c906108c
SS
31# build the first test case
32if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
33 # built the second test case since we can't use prototypes
34 warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
35 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
b60f0898
JB
36 untested structs2.exp
37 return -1
c906108c
SS
38 }
39 set prototypes 0
40}
41
42# Start with a fresh gdb.
43
44gdb_start
45gdb_reinitialize_dir $srcdir/$subdir
46gdb_load ${binfile}
47
27d3a1a2 48gdb_test_no_output "set width 0"
c906108c
SS
49
50if { ![runto_main] } then {
51 gdb_suppress_tests
52}
53
54# Ok, we're finally ready to actually do our tests.
55
c906108c
SS
56gdb_test "f" \
57 ".*bkpt = 0.*" \
58 "structs2 sanity check"
59
60gdb_test "break param_reg" \
61 "Breakpoint .* at .*" \
62 "structs2 breakpoint set"
63
36ae0ea9 64if [test_compiler_info gcc-3-*] {
e12a46c9
RC
65 setup_xfail hppa*-* gcc/15860
66}
c906108c
SS
67gdb_test "continue" \
68 ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \
69 "structs2 continue1"
70
36ae0ea9 71if [test_compiler_info gcc-3-*] {
e12a46c9
RC
72 setup_xfail hppa*-* gcc/15860
73}
c906108c
SS
74gdb_test "continue" \
75 ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
76 "structs2 continue2"
77
78# End of tests.
79
80gdb_stop_suppressing_tests
81
82return 0
This page took 1.02897 seconds and 4 git commands to generate.