]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/volatile.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / volatile.exp
1 # Copyright 1997-2024 Free Software Foundation, Inc.
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
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.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
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
32 #
33 # test running programs
34 #
35
36 # Use the same test program constvars.c.
37
38 if { [prepare_for_testing "failed to prepare" volatile constvars.c] } {
39 return -1
40 }
41
42 #
43 # set it up at a breakpoint so we can play with the variable values
44 #
45 if {![runto_main]} {
46 return
47 }
48
49 get_debug_format
50
51 # Many tests xfail with gcc 2 -gstabs+.
52
53 proc local_compiler_xfail_check { } {
54 if {[test_compiler_info gcc-2-*]} {
55 if { ![test_debug_format "HP"] \
56 && ![test_debug_format "DWARF \[0-9\]"] } then {
57 setup_xfail "*-*-*"
58 }
59 }
60 }
61
62 # A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+.
63
64 proc local_compiler_xfail_check_2 { } {
65 if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } {
66 if { [test_debug_format "stabs" ] } {
67 setup_xfail "*-*-*"
68 }
69 }
70 }
71
72 gdb_test "break marker1" ".*" ""
73
74 gdb_test_multiple "cont" "continue to marker1" {
75 -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
76 pass "continue to marker1"
77 }
78 -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
79 fail "continue to marker1 (demangling)"
80 }
81 }
82 gdb_test "up" " in main .*" "up from marker1"
83
84 # As of Feb 1999, GCC does not issue info about volatility of vars, so
85 # these tests are all expected to fail if GCC is the compiler. -sts
86
87 local_compiler_xfail_check
88 gdb_test "ptype vox" "type = volatile char.*"
89
90 local_compiler_xfail_check
91 gdb_test "ptype victuals" "type = volatile unsigned char.*"
92
93 local_compiler_xfail_check
94 gdb_test "ptype vixen" "type = volatile short.*"
95
96 local_compiler_xfail_check
97 gdb_test "ptype vitriol" "type = volatile (unsigned short|short unsigned)( int)?.*"
98
99 local_compiler_xfail_check
100 gdb_test "ptype vellum" "type = volatile long.*"
101
102 local_compiler_xfail_check
103 gdb_test "ptype valve" "type = volatile (unsigned long|long unsigned)( int)?.*"
104
105 local_compiler_xfail_check
106 gdb_test "ptype vacuity" "type = volatile float.*"
107
108 local_compiler_xfail_check
109 gdb_test "ptype vertigo" "type = volatile double.*"
110
111 local_compiler_xfail_check
112 gdb_test "ptype vampire" "type = volatile char \\*.*"
113
114 local_compiler_xfail_check
115 gdb_test "ptype viper" "type = volatile unsigned char \\*.*"
116
117 local_compiler_xfail_check
118 gdb_test "ptype vigour" "type = volatile short( int)? \\*.*"
119
120 local_compiler_xfail_check
121 gdb_test "ptype vapour" "type = volatile (unsigned short|short unsigned)( int)? \\*.*"
122
123 local_compiler_xfail_check
124 gdb_test "ptype ventricle" "type = volatile long( int)? \\*.*"
125
126 local_compiler_xfail_check
127 gdb_test "ptype vigintillion" "type = volatile (unsigned long|long unsigned)( int)? \\*.*"
128
129 local_compiler_xfail_check
130 gdb_test "ptype vocation" "type = volatile float \\*.*"
131
132 local_compiler_xfail_check
133 gdb_test "ptype veracity" "type = volatile double \\*.*"
134
135 local_compiler_xfail_check
136 gdb_test "ptype vapidity" "type = volatile char \\* volatile.*"
137
138 local_compiler_xfail_check
139 gdb_test "ptype velocity" "type = volatile unsigned char \\* volatile.*"
140
141 local_compiler_xfail_check
142 gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*"
143
144 local_compiler_xfail_check
145 gdb_test "ptype video" "type = volatile (unsigned short|short unsigned) \\* volatile.*"
146
147 local_compiler_xfail_check
148 gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*"
149
150 local_compiler_xfail_check
151 gdb_test "ptype veniality" "type = volatile (unsigned long|long unsigned)( int)? \\* volatile.*"
152
153 local_compiler_xfail_check
154 gdb_test "ptype vitality" "type = volatile float \\* volatile.*"
155
156 local_compiler_xfail_check
157 gdb_test "ptype voracity" "type = volatile double \\* volatile.*"
158
159 local_compiler_xfail_check
160 gdb_test "ptype victor" "type = const volatile char.*"
161
162 local_compiler_xfail_check
163 gdb_test "ptype vicar" "type = const volatile unsigned char.*"
164
165 local_compiler_xfail_check
166 gdb_test "ptype victory" "type = const volatile char \\*.*"
167
168 local_compiler_xfail_check
169 gdb_test "ptype vicarage" "type = const volatile unsigned char \\*.*"
170
171 local_compiler_xfail_check
172 gdb_test "ptype vein" "type = volatile char \\* const.*"
173
174 local_compiler_xfail_check
175 gdb_test "ptype vogue" "type = volatile unsigned char \\* const.*"
176
177 local_compiler_xfail_check
178 gdb_test "ptype cavern" "type = const volatile char \\* const.*"
179
180 local_compiler_xfail_check
181 gdb_test "ptype coverlet" "type = const volatile unsigned char \\* const.*"
182
183 local_compiler_xfail_check
184 gdb_test "ptype caveat" "type = const char \\* volatile.*"
185
186 local_compiler_xfail_check
187 gdb_test "ptype covenant" "type = const unsigned char \\* volatile.*"
188
189 local_compiler_xfail_check
190 gdb_test "ptype vizier" "type = const volatile char \\* volatile.*"
191
192 local_compiler_xfail_check
193 gdb_test "ptype vanadium" "type = const volatile unsigned char \\* volatile.*"
194
195 local_compiler_xfail_check
196 gdb_test "ptype vane" "type = char \\* const volatile.*"
197
198 local_compiler_xfail_check
199 gdb_test "ptype veldt" "type = unsigned char \\* const volatile.*"
200
201 local_compiler_xfail_check
202 gdb_test "ptype cove" "type = const char \\* const volatile.*"
203
204 local_compiler_xfail_check
205 gdb_test "ptype cavity" "type = const unsigned char \\* const volatile.*"
206
207 local_compiler_xfail_check
208 gdb_test "ptype vagus" "type = volatile char \\* const volatile.*"
209
210 local_compiler_xfail_check
211 gdb_test "ptype vagrancy" "type = volatile unsigned char \\* const volatile.*"
212
213 local_compiler_xfail_check
214 gdb_test "ptype vagary" "type = const volatile char \\* const volatile.*"
215
216 local_compiler_xfail_check
217 gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.*"
218
219 # volatile arrays
220 local_compiler_xfail_check
221 gdb_test "ptype violent" "type = volatile char \\\[2\\\]"
222 local_compiler_xfail_check
223 gdb_test "ptype violet" "type = volatile unsigned char \\\[2\\\]"
224 local_compiler_xfail_check
225 gdb_test "ptype vips" "type = volatile short( int)? \\\[2\\\]"
226 local_compiler_xfail_check
227 gdb_test "ptype virgen" "type = volatile (unsigned short|short unsigned)( int)? \\\[2\\\]"
228 local_compiler_xfail_check
229 gdb_test "ptype vulgar" "type = volatile long( int)? \\\[2\\\]"
230 local_compiler_xfail_check
231 gdb_test "ptype vulture" "type = volatile (unsigned long|long unsigned)( int)? \\\[2\\\]"
232 local_compiler_xfail_check
233 gdb_test "ptype vilify" "type = volatile float \\\[2\\\]"
234 local_compiler_xfail_check
235 gdb_test "ptype villar" "type = volatile double \\\[2\\\]"
236
237 # const volatile arrays
238 local_compiler_xfail_check
239 gdb_test "ptype vindictive" "type = const volatile char \\\[2\\\]"
240 local_compiler_xfail_check
241 gdb_test "ptype vegetation" "type = const volatile unsigned char \\\[2\\\]"
242
243 # test function parameters
244 local_compiler_xfail_check
245 local_compiler_xfail_check_2
246
247 gdb_test "ptype qux2" \
248 "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)"