Commit | Line | Data |
---|---|---|
e2882c85 | 1 | # Copyright 1997-2018 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 | # Written by Satish Pai <pai@apollo.hp.com> 1997-07-07 |
17 | # In the spirit of constvars.exp: added volatile, const-volatile stuff. | |
18 | ||
19 | # This file is part of the gdb testsuite | |
20 | # Tests for: | |
21 | # volatile vars | |
22 | # pointers to volatile vars | |
23 | # const volatile vars | |
24 | # pointers to const volatile vars | |
25 | # const pointers to volatile vars | |
26 | # volatile pointers to const vars | |
27 | # const volatile pointers to const vars | |
28 | # const volatile pointers to volatile vars | |
29 | # ... etc. (you get the idea) | |
30 | # Mostly with char and unsigned char. | |
31 | ||
c906108c SS |
32 | # |
33 | # test running programs | |
34 | # | |
c906108c SS |
35 | |
36 | # Use the same test program constvars.c. | |
37 | ||
5b362f04 | 38 | if { [prepare_for_testing "failed to prepare" volatile constvars.c] } { |
aa81e255 JK |
39 | return -1 |
40 | } | |
c906108c | 41 | |
2cd045cd JL |
42 | # Create and source the file that provides information about the compiler |
43 | # used to compile the test case. | |
4c93b1db | 44 | if [get_compiler_info] { |
ae59b1da | 45 | return -1 |
2cd045cd JL |
46 | } |
47 | ||
c906108c SS |
48 | # |
49 | # set it up at a breakpoint so we can play with the variable values | |
50 | # | |
51 | if ![runto_main] then { | |
52 | perror "couldn't run to breakpoint" | |
53 | continue | |
54 | } | |
55 | ||
b55a4771 MS |
56 | get_debug_format |
57 | ||
8e937346 | 58 | # Many tests xfail with gcc 2 -gstabs+. |
8e937346 | 59 | |
b55a4771 | 60 | proc local_compiler_xfail_check { } { |
9a77938e | 61 | if { [test_compiler_info gcc-2-*] } then { |
b55a4771 MS |
62 | if { ![test_debug_format "HP"] \ |
63 | && ![test_debug_format "DWARF 2"] } then { | |
64 | setup_xfail "*-*-*" | |
65 | } | |
66 | } | |
67 | } | |
68 | ||
8e937346 MC |
69 | # A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+. |
70 | ||
71 | proc local_compiler_xfail_check_2 { } { | |
72 | if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } { | |
73 | if { [test_debug_format "stabs" ] } { | |
74 | setup_xfail "*-*-*" | |
75 | } | |
76 | } | |
77 | } | |
78 | ||
de7ff789 | 79 | gdb_test "break marker1" ".*" "" |
02746bbc MS |
80 | |
81 | gdb_test_multiple "cont" "continue to marker1" { | |
82 | -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { | |
83 | pass "continue to marker1" | |
84 | } | |
85 | -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" { | |
86 | fail "continue to marker1 (demangling)" | |
c906108c | 87 | } |
02746bbc MS |
88 | } |
89 | gdb_test "up" " in main .*" "up from marker1" | |
c906108c SS |
90 | |
91 | # As of Feb 1999, GCC does not issue info about volatility of vars, so | |
92 | # these tests are all expected to fail if GCC is the compiler. -sts | |
93 | ||
b55a4771 | 94 | local_compiler_xfail_check |
085dd6e6 | 95 | gdb_test "ptype vox" "type = volatile char.*" |
c906108c | 96 | |
b55a4771 | 97 | local_compiler_xfail_check |
085dd6e6 | 98 | gdb_test "ptype victuals" "type = volatile unsigned char.*" |
c906108c | 99 | |
b55a4771 | 100 | local_compiler_xfail_check |
085dd6e6 | 101 | gdb_test "ptype vixen" "type = volatile short.*" |
c906108c | 102 | |
b55a4771 MS |
103 | local_compiler_xfail_check |
104 | gdb_test "ptype vitriol" "type = volatile (unsigned short|short unsigned)( int)?.*" | |
c906108c | 105 | |
b55a4771 | 106 | local_compiler_xfail_check |
085dd6e6 | 107 | gdb_test "ptype vellum" "type = volatile long.*" |
c906108c | 108 | |
b55a4771 MS |
109 | local_compiler_xfail_check |
110 | gdb_test "ptype valve" "type = volatile (unsigned long|long unsigned)( int)?.*" | |
c906108c | 111 | |
b55a4771 | 112 | local_compiler_xfail_check |
085dd6e6 | 113 | gdb_test "ptype vacuity" "type = volatile float.*" |
c906108c | 114 | |
b55a4771 | 115 | local_compiler_xfail_check |
085dd6e6 | 116 | gdb_test "ptype vertigo" "type = volatile double.*" |
c906108c | 117 | |
b55a4771 | 118 | local_compiler_xfail_check |
085dd6e6 | 119 | gdb_test "ptype vampire" "type = volatile char \\*.*" |
c906108c | 120 | |
b55a4771 | 121 | local_compiler_xfail_check |
085dd6e6 | 122 | gdb_test "ptype viper" "type = volatile unsigned char \\*.*" |
c906108c | 123 | |
b55a4771 MS |
124 | local_compiler_xfail_check |
125 | gdb_test "ptype vigour" "type = volatile short( int)? \\*.*" | |
c906108c | 126 | |
b55a4771 MS |
127 | local_compiler_xfail_check |
128 | gdb_test "ptype vapour" "type = volatile (unsigned short|short unsigned)( int)? \\*.*" | |
c906108c | 129 | |
b55a4771 MS |
130 | local_compiler_xfail_check |
131 | gdb_test "ptype ventricle" "type = volatile long( int)? \\*.*" | |
c906108c | 132 | |
b55a4771 MS |
133 | local_compiler_xfail_check |
134 | gdb_test "ptype vigintillion" "type = volatile (unsigned long|long unsigned)( int)? \\*.*" | |
c906108c | 135 | |
b55a4771 | 136 | local_compiler_xfail_check |
085dd6e6 | 137 | gdb_test "ptype vocation" "type = volatile float \\*.*" |
c906108c | 138 | |
b55a4771 | 139 | local_compiler_xfail_check |
085dd6e6 | 140 | gdb_test "ptype veracity" "type = volatile double \\*.*" |
c906108c | 141 | |
b55a4771 | 142 | local_compiler_xfail_check |
085dd6e6 | 143 | gdb_test "ptype vapidity" "type = volatile char \\* volatile.*" |
c906108c | 144 | |
b55a4771 | 145 | local_compiler_xfail_check |
085dd6e6 | 146 | gdb_test "ptype velocity" "type = volatile unsigned char \\* volatile.*" |
c906108c | 147 | |
b55a4771 MS |
148 | local_compiler_xfail_check |
149 | gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*" | |
c906108c | 150 | |
b55a4771 | 151 | local_compiler_xfail_check |
bd69fc68 | 152 | gdb_test "ptype video" "type = volatile (unsigned short|short unsigned) \\* volatile.*" |
c906108c | 153 | |
b55a4771 MS |
154 | local_compiler_xfail_check |
155 | gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*" | |
c906108c | 156 | |
b55a4771 MS |
157 | local_compiler_xfail_check |
158 | gdb_test "ptype veniality" "type = volatile (unsigned long|long unsigned)( int)? \\* volatile.*" | |
c906108c | 159 | |
b55a4771 | 160 | local_compiler_xfail_check |
085dd6e6 | 161 | gdb_test "ptype vitality" "type = volatile float \\* volatile.*" |
c906108c | 162 | |
b55a4771 | 163 | local_compiler_xfail_check |
085dd6e6 | 164 | gdb_test "ptype voracity" "type = volatile double \\* volatile.*" |
c906108c | 165 | |
b55a4771 | 166 | local_compiler_xfail_check |
085dd6e6 | 167 | gdb_test "ptype victor" "type = const volatile char.*" |
c906108c | 168 | |
b55a4771 | 169 | local_compiler_xfail_check |
085dd6e6 | 170 | gdb_test "ptype vicar" "type = const volatile unsigned char.*" |
c906108c | 171 | |
b55a4771 | 172 | local_compiler_xfail_check |
085dd6e6 | 173 | gdb_test "ptype victory" "type = const volatile char \\*.*" |
c906108c | 174 | |
b55a4771 | 175 | local_compiler_xfail_check |
085dd6e6 | 176 | gdb_test "ptype vicarage" "type = const volatile unsigned char \\*.*" |
c906108c | 177 | |
b55a4771 | 178 | local_compiler_xfail_check |
085dd6e6 | 179 | gdb_test "ptype vein" "type = volatile char \\* const.*" |
c906108c | 180 | |
b55a4771 | 181 | local_compiler_xfail_check |
085dd6e6 | 182 | gdb_test "ptype vogue" "type = volatile unsigned char \\* const.*" |
c906108c | 183 | |
b55a4771 | 184 | local_compiler_xfail_check |
085dd6e6 | 185 | gdb_test "ptype cavern" "type = const volatile char \\* const.*" |
c906108c | 186 | |
b55a4771 | 187 | local_compiler_xfail_check |
085dd6e6 | 188 | gdb_test "ptype coverlet" "type = const volatile unsigned char \\* const.*" |
c906108c | 189 | |
b55a4771 | 190 | local_compiler_xfail_check |
085dd6e6 | 191 | gdb_test "ptype caveat" "type = const char \\* volatile.*" |
c906108c | 192 | |
b55a4771 | 193 | local_compiler_xfail_check |
085dd6e6 | 194 | gdb_test "ptype covenant" "type = const unsigned char \\* volatile.*" |
c906108c | 195 | |
b55a4771 | 196 | local_compiler_xfail_check |
085dd6e6 | 197 | gdb_test "ptype vizier" "type = const volatile char \\* volatile.*" |
c906108c | 198 | |
b55a4771 | 199 | local_compiler_xfail_check |
085dd6e6 | 200 | gdb_test "ptype vanadium" "type = const volatile unsigned char \\* volatile.*" |
c906108c | 201 | |
b55a4771 | 202 | local_compiler_xfail_check |
085dd6e6 | 203 | gdb_test "ptype vane" "type = char \\* const volatile.*" |
c906108c | 204 | |
b55a4771 | 205 | local_compiler_xfail_check |
085dd6e6 | 206 | gdb_test "ptype veldt" "type = unsigned char \\* const volatile.*" |
c906108c | 207 | |
b55a4771 | 208 | local_compiler_xfail_check |
085dd6e6 | 209 | gdb_test "ptype cove" "type = const char \\* const volatile.*" |
c906108c | 210 | |
b55a4771 | 211 | local_compiler_xfail_check |
085dd6e6 | 212 | gdb_test "ptype cavity" "type = const unsigned char \\* const volatile.*" |
c906108c | 213 | |
b55a4771 | 214 | local_compiler_xfail_check |
085dd6e6 | 215 | gdb_test "ptype vagus" "type = volatile char \\* const volatile.*" |
c906108c | 216 | |
b55a4771 | 217 | local_compiler_xfail_check |
085dd6e6 | 218 | gdb_test "ptype vagrancy" "type = volatile unsigned char \\* const volatile.*" |
c906108c | 219 | |
b55a4771 | 220 | local_compiler_xfail_check |
085dd6e6 | 221 | gdb_test "ptype vagary" "type = const volatile char \\* const volatile.*" |
c906108c | 222 | |
b55a4771 | 223 | local_compiler_xfail_check |
085dd6e6 | 224 | gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.*" |
c906108c | 225 | |
cf363f18 MW |
226 | # volatile arrays |
227 | local_compiler_xfail_check | |
228 | gdb_test "ptype violent" "type = volatile char \\\[2\\\]" | |
229 | local_compiler_xfail_check | |
230 | gdb_test "ptype violet" "type = volatile unsigned char \\\[2\\\]" | |
231 | local_compiler_xfail_check | |
232 | gdb_test "ptype vips" "type = volatile short( int)? \\\[2\\\]" | |
233 | local_compiler_xfail_check | |
234 | gdb_test "ptype virgen" "type = volatile (unsigned short|short unsigned)( int)? \\\[2\\\]" | |
235 | local_compiler_xfail_check | |
236 | gdb_test "ptype vulgar" "type = volatile long( int)? \\\[2\\\]" | |
237 | local_compiler_xfail_check | |
238 | gdb_test "ptype vulture" "type = volatile (unsigned long|long unsigned)( int)? \\\[2\\\]" | |
239 | local_compiler_xfail_check | |
240 | gdb_test "ptype vilify" "type = volatile float \\\[2\\\]" | |
241 | local_compiler_xfail_check | |
242 | gdb_test "ptype villar" "type = volatile double \\\[2\\\]" | |
243 | ||
244 | # const volatile arrays | |
245 | local_compiler_xfail_check | |
246 | gdb_test "ptype vindictive" "type = const volatile char \\\[2\\\]" | |
247 | local_compiler_xfail_check | |
248 | gdb_test "ptype vegetation" "type = const volatile unsigned char \\\[2\\\]" | |
249 | ||
c906108c | 250 | # test function parameters |
b55a4771 | 251 | local_compiler_xfail_check |
8e937346 | 252 | local_compiler_xfail_check_2 |
02746bbc MS |
253 | |
254 | gdb_test "ptype qux2" \ | |
255 | "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)" \ | |
256 | "ptype qux2" |