]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - 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
CommitLineData
1d506c26 1# Copyright 1997-2024 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 38if { [prepare_for_testing "failed to prepare" volatile constvars.c] } {
aa81e255
JK
39 return -1
40}
c906108c 41
c906108c
SS
42#
43# set it up at a breakpoint so we can play with the variable values
44#
65a33d75 45if {![runto_main]} {
cdd42066 46 return
c906108c
SS
47}
48
b55a4771
MS
49get_debug_format
50
8e937346 51# Many tests xfail with gcc 2 -gstabs+.
8e937346 52
b55a4771 53proc local_compiler_xfail_check { } {
65a33d75 54 if {[test_compiler_info gcc-2-*]} {
b55a4771 55 if { ![test_debug_format "HP"] \
d184a3c1 56 && ![test_debug_format "DWARF \[0-9\]"] } then {
b55a4771
MS
57 setup_xfail "*-*-*"
58 }
59 }
60}
61
8e937346
MC
62# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+.
63
64proc 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
de7ff789 72gdb_test "break marker1" ".*" ""
02746bbc
MS
73
74gdb_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)"
c906108c 80 }
02746bbc
MS
81}
82gdb_test "up" " in main .*" "up from marker1"
c906108c
SS
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
b55a4771 87local_compiler_xfail_check
085dd6e6 88gdb_test "ptype vox" "type = volatile char.*"
c906108c 89
b55a4771 90local_compiler_xfail_check
085dd6e6 91gdb_test "ptype victuals" "type = volatile unsigned char.*"
c906108c 92
b55a4771 93local_compiler_xfail_check
085dd6e6 94gdb_test "ptype vixen" "type = volatile short.*"
c906108c 95
b55a4771
MS
96local_compiler_xfail_check
97gdb_test "ptype vitriol" "type = volatile (unsigned short|short unsigned)( int)?.*"
c906108c 98
b55a4771 99local_compiler_xfail_check
085dd6e6 100gdb_test "ptype vellum" "type = volatile long.*"
c906108c 101
b55a4771
MS
102local_compiler_xfail_check
103gdb_test "ptype valve" "type = volatile (unsigned long|long unsigned)( int)?.*"
c906108c 104
b55a4771 105local_compiler_xfail_check
085dd6e6 106gdb_test "ptype vacuity" "type = volatile float.*"
c906108c 107
b55a4771 108local_compiler_xfail_check
085dd6e6 109gdb_test "ptype vertigo" "type = volatile double.*"
c906108c 110
b55a4771 111local_compiler_xfail_check
085dd6e6 112gdb_test "ptype vampire" "type = volatile char \\*.*"
c906108c 113
b55a4771 114local_compiler_xfail_check
085dd6e6 115gdb_test "ptype viper" "type = volatile unsigned char \\*.*"
c906108c 116
b55a4771
MS
117local_compiler_xfail_check
118gdb_test "ptype vigour" "type = volatile short( int)? \\*.*"
c906108c 119
b55a4771
MS
120local_compiler_xfail_check
121gdb_test "ptype vapour" "type = volatile (unsigned short|short unsigned)( int)? \\*.*"
c906108c 122
b55a4771
MS
123local_compiler_xfail_check
124gdb_test "ptype ventricle" "type = volatile long( int)? \\*.*"
c906108c 125
b55a4771
MS
126local_compiler_xfail_check
127gdb_test "ptype vigintillion" "type = volatile (unsigned long|long unsigned)( int)? \\*.*"
c906108c 128
b55a4771 129local_compiler_xfail_check
085dd6e6 130gdb_test "ptype vocation" "type = volatile float \\*.*"
c906108c 131
b55a4771 132local_compiler_xfail_check
085dd6e6 133gdb_test "ptype veracity" "type = volatile double \\*.*"
c906108c 134
b55a4771 135local_compiler_xfail_check
085dd6e6 136gdb_test "ptype vapidity" "type = volatile char \\* volatile.*"
c906108c 137
b55a4771 138local_compiler_xfail_check
085dd6e6 139gdb_test "ptype velocity" "type = volatile unsigned char \\* volatile.*"
c906108c 140
b55a4771
MS
141local_compiler_xfail_check
142gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*"
c906108c 143
b55a4771 144local_compiler_xfail_check
bd69fc68 145gdb_test "ptype video" "type = volatile (unsigned short|short unsigned) \\* volatile.*"
c906108c 146
b55a4771
MS
147local_compiler_xfail_check
148gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*"
c906108c 149
b55a4771
MS
150local_compiler_xfail_check
151gdb_test "ptype veniality" "type = volatile (unsigned long|long unsigned)( int)? \\* volatile.*"
c906108c 152
b55a4771 153local_compiler_xfail_check
085dd6e6 154gdb_test "ptype vitality" "type = volatile float \\* volatile.*"
c906108c 155
b55a4771 156local_compiler_xfail_check
085dd6e6 157gdb_test "ptype voracity" "type = volatile double \\* volatile.*"
c906108c 158
b55a4771 159local_compiler_xfail_check
085dd6e6 160gdb_test "ptype victor" "type = const volatile char.*"
c906108c 161
b55a4771 162local_compiler_xfail_check
085dd6e6 163gdb_test "ptype vicar" "type = const volatile unsigned char.*"
c906108c 164
b55a4771 165local_compiler_xfail_check
085dd6e6 166gdb_test "ptype victory" "type = const volatile char \\*.*"
c906108c 167
b55a4771 168local_compiler_xfail_check
085dd6e6 169gdb_test "ptype vicarage" "type = const volatile unsigned char \\*.*"
c906108c 170
b55a4771 171local_compiler_xfail_check
085dd6e6 172gdb_test "ptype vein" "type = volatile char \\* const.*"
c906108c 173
b55a4771 174local_compiler_xfail_check
085dd6e6 175gdb_test "ptype vogue" "type = volatile unsigned char \\* const.*"
c906108c 176
b55a4771 177local_compiler_xfail_check
085dd6e6 178gdb_test "ptype cavern" "type = const volatile char \\* const.*"
c906108c 179
b55a4771 180local_compiler_xfail_check
085dd6e6 181gdb_test "ptype coverlet" "type = const volatile unsigned char \\* const.*"
c906108c 182
b55a4771 183local_compiler_xfail_check
085dd6e6 184gdb_test "ptype caveat" "type = const char \\* volatile.*"
c906108c 185
b55a4771 186local_compiler_xfail_check
085dd6e6 187gdb_test "ptype covenant" "type = const unsigned char \\* volatile.*"
c906108c 188
b55a4771 189local_compiler_xfail_check
085dd6e6 190gdb_test "ptype vizier" "type = const volatile char \\* volatile.*"
c906108c 191
b55a4771 192local_compiler_xfail_check
085dd6e6 193gdb_test "ptype vanadium" "type = const volatile unsigned char \\* volatile.*"
c906108c 194
b55a4771 195local_compiler_xfail_check
085dd6e6 196gdb_test "ptype vane" "type = char \\* const volatile.*"
c906108c 197
b55a4771 198local_compiler_xfail_check
085dd6e6 199gdb_test "ptype veldt" "type = unsigned char \\* const volatile.*"
c906108c 200
b55a4771 201local_compiler_xfail_check
085dd6e6 202gdb_test "ptype cove" "type = const char \\* const volatile.*"
c906108c 203
b55a4771 204local_compiler_xfail_check
085dd6e6 205gdb_test "ptype cavity" "type = const unsigned char \\* const volatile.*"
c906108c 206
b55a4771 207local_compiler_xfail_check
085dd6e6 208gdb_test "ptype vagus" "type = volatile char \\* const volatile.*"
c906108c 209
b55a4771 210local_compiler_xfail_check
085dd6e6 211gdb_test "ptype vagrancy" "type = volatile unsigned char \\* const volatile.*"
c906108c 212
b55a4771 213local_compiler_xfail_check
085dd6e6 214gdb_test "ptype vagary" "type = const volatile char \\* const volatile.*"
c906108c 215
b55a4771 216local_compiler_xfail_check
085dd6e6 217gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.*"
c906108c 218
cf363f18
MW
219# volatile arrays
220local_compiler_xfail_check
221gdb_test "ptype violent" "type = volatile char \\\[2\\\]"
222local_compiler_xfail_check
223gdb_test "ptype violet" "type = volatile unsigned char \\\[2\\\]"
224local_compiler_xfail_check
225gdb_test "ptype vips" "type = volatile short( int)? \\\[2\\\]"
226local_compiler_xfail_check
227gdb_test "ptype virgen" "type = volatile (unsigned short|short unsigned)( int)? \\\[2\\\]"
228local_compiler_xfail_check
229gdb_test "ptype vulgar" "type = volatile long( int)? \\\[2\\\]"
230local_compiler_xfail_check
231gdb_test "ptype vulture" "type = volatile (unsigned long|long unsigned)( int)? \\\[2\\\]"
232local_compiler_xfail_check
233gdb_test "ptype vilify" "type = volatile float \\\[2\\\]"
234local_compiler_xfail_check
235gdb_test "ptype villar" "type = volatile double \\\[2\\\]"
236
237# const volatile arrays
238local_compiler_xfail_check
239gdb_test "ptype vindictive" "type = const volatile char \\\[2\\\]"
240local_compiler_xfail_check
241gdb_test "ptype vegetation" "type = const volatile unsigned char \\\[2\\\]"
242
c906108c 243# test function parameters
b55a4771 244local_compiler_xfail_check
8e937346 245local_compiler_xfail_check_2
02746bbc
MS
246
247gdb_test "ptype qux2" \
11af934b 248 "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)"