Commit | Line | Data |
---|---|---|
9b254dd1 | 1 | # Copyright 1998, 1999, 2007, 2008 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 |
16 | if $tracelevel then { |
17 | strace $tracelevel | |
18 | } | |
19 | ||
20 | set prms_id 0 | |
21 | set bug_id 0 | |
22 | ||
23 | set prototypes 1 | |
24 | set testfile "structs2" | |
25 | set srcfile ${testfile}.c | |
26 | set 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. | |
30 | if [get_compiler_info ${binfile}] { | |
31 | return -1; | |
32 | } | |
33 | ||
c906108c SS |
34 | # build the first test case |
35 | if { [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 | ||
47 | gdb_start | |
48 | gdb_reinitialize_dir $srcdir/$subdir | |
49 | gdb_load ${binfile} | |
50 | ||
a0b3c4fd | 51 | gdb_test "set width 0" "" |
c906108c SS |
52 | |
53 | if { ![runto_main] } then { | |
54 | gdb_suppress_tests | |
55 | } | |
56 | ||
57 | # Ok, we're finally ready to actually do our tests. | |
58 | ||
59 | set prms_id 13536 | |
60 | set bug_id 0 | |
61 | ||
62 | gdb_test "f" \ | |
63 | ".*bkpt = 0.*" \ | |
64 | "structs2 sanity check" | |
65 | ||
66 | gdb_test "break param_reg" \ | |
67 | "Breakpoint .* at .*" \ | |
68 | "structs2 breakpoint set" | |
69 | ||
36ae0ea9 | 70 | if [test_compiler_info gcc-3-*] { |
e12a46c9 RC |
71 | setup_xfail hppa*-* gcc/15860 |
72 | } | |
c906108c SS |
73 | gdb_test "continue" \ |
74 | ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \ | |
75 | "structs2 continue1" | |
76 | ||
36ae0ea9 | 77 | if [test_compiler_info gcc-3-*] { |
e12a46c9 RC |
78 | setup_xfail hppa*-* gcc/15860 |
79 | } | |
c906108c SS |
80 | gdb_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 | ||
86 | gdb_stop_suppressing_tests | |
87 | ||
88 | return 0 |