* c-typeprint.c (find_typedef_for_canonicalize,
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / volatile.exp
CommitLineData
0b302171
JB
1# Copyright 1997-1999, 2003-2004, 2007-2012 Free Software Foundation,
2# Inc.
c906108c
SS
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
c906108c 7# (at your option) any later version.
e22f8b7c 8#
c906108c
SS
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
e22f8b7c 13#
c906108c 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 16
c906108c
SS
17# Written by Satish Pai <pai@apollo.hp.com> 1997-07-07
18# In the spirit of constvars.exp: added volatile, const-volatile stuff.
19
20# This file is part of the gdb testsuite
21# Tests for:
22# volatile vars
23# pointers to volatile vars
24# const volatile vars
25# pointers to const volatile vars
26# const pointers to volatile vars
27# volatile pointers to const vars
28# const volatile pointers to const vars
29# const volatile pointers to volatile vars
30# ... etc. (you get the idea)
31# Mostly with char and unsigned char.
32
c906108c
SS
33#
34# test running programs
35#
c906108c
SS
36
37# Use the same test program constvars.c.
38
aa81e255
JK
39if { [prepare_for_testing volatile.exp volatile constvars.c] } {
40 return -1
41}
c906108c 42
2cd045cd
JL
43# Create and source the file that provides information about the compiler
44# used to compile the test case.
4c93b1db 45if [get_compiler_info] {
2cd045cd
JL
46 return -1;
47}
48
c906108c
SS
49#
50# set it up at a breakpoint so we can play with the variable values
51#
52if ![runto_main] then {
53 perror "couldn't run to breakpoint"
54 continue
55}
56
b55a4771
MS
57get_debug_format
58
8e937346
MC
59# Many tests xfail with gcc 2 -gstabs+.
60# TODO: check out the hp side of this.
61
b55a4771 62proc local_compiler_xfail_check { } {
9a77938e 63 if { [test_compiler_info gcc-2-*] } then {
b55a4771
MS
64 if { ![test_debug_format "HP"] \
65 && ![test_debug_format "DWARF 2"] } then {
66 setup_xfail "*-*-*"
67 }
68 }
053248ff
MC
69
70 global hp_cc_compiler
71 if { $hp_cc_compiler } {
72 setup_xfail "hppa*-*-hpux*"
73 }
b55a4771
MS
74}
75
8e937346
MC
76# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+.
77
78proc local_compiler_xfail_check_2 { } {
79 if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } {
80 if { [test_debug_format "stabs" ] } {
81 setup_xfail "*-*-*"
82 }
83 }
84}
85
de7ff789 86gdb_test "break marker1" ".*" ""
02746bbc
MS
87
88gdb_test_multiple "cont" "continue to marker1" {
89 -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
90 pass "continue to marker1"
91 }
92 -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
93 fail "continue to marker1 (demangling)"
c906108c 94 }
02746bbc
MS
95}
96gdb_test "up" " in main .*" "up from marker1"
c906108c
SS
97
98# As of Feb 1999, GCC does not issue info about volatility of vars, so
99# these tests are all expected to fail if GCC is the compiler. -sts
100
b55a4771 101local_compiler_xfail_check
085dd6e6 102gdb_test "ptype vox" "type = volatile char.*"
c906108c 103
b55a4771 104local_compiler_xfail_check
085dd6e6 105gdb_test "ptype victuals" "type = volatile unsigned char.*"
c906108c 106
b55a4771 107local_compiler_xfail_check
085dd6e6 108gdb_test "ptype vixen" "type = volatile short.*"
c906108c 109
b55a4771
MS
110local_compiler_xfail_check
111gdb_test "ptype vitriol" "type = volatile (unsigned short|short unsigned)( int)?.*"
c906108c 112
b55a4771 113local_compiler_xfail_check
085dd6e6 114gdb_test "ptype vellum" "type = volatile long.*"
c906108c 115
b55a4771
MS
116local_compiler_xfail_check
117gdb_test "ptype valve" "type = volatile (unsigned long|long unsigned)( int)?.*"
c906108c 118
b55a4771 119local_compiler_xfail_check
085dd6e6 120gdb_test "ptype vacuity" "type = volatile float.*"
c906108c 121
b55a4771 122local_compiler_xfail_check
085dd6e6 123gdb_test "ptype vertigo" "type = volatile double.*"
c906108c 124
b55a4771 125local_compiler_xfail_check
085dd6e6 126gdb_test "ptype vampire" "type = volatile char \\*.*"
c906108c 127
b55a4771 128local_compiler_xfail_check
085dd6e6 129gdb_test "ptype viper" "type = volatile unsigned char \\*.*"
c906108c 130
b55a4771
MS
131local_compiler_xfail_check
132gdb_test "ptype vigour" "type = volatile short( int)? \\*.*"
c906108c 133
b55a4771
MS
134local_compiler_xfail_check
135gdb_test "ptype vapour" "type = volatile (unsigned short|short unsigned)( int)? \\*.*"
c906108c 136
b55a4771
MS
137local_compiler_xfail_check
138gdb_test "ptype ventricle" "type = volatile long( int)? \\*.*"
c906108c 139
b55a4771
MS
140local_compiler_xfail_check
141gdb_test "ptype vigintillion" "type = volatile (unsigned long|long unsigned)( int)? \\*.*"
c906108c 142
b55a4771 143local_compiler_xfail_check
085dd6e6 144gdb_test "ptype vocation" "type = volatile float \\*.*"
c906108c 145
b55a4771 146local_compiler_xfail_check
085dd6e6 147gdb_test "ptype veracity" "type = volatile double \\*.*"
c906108c 148
b55a4771 149local_compiler_xfail_check
085dd6e6 150gdb_test "ptype vapidity" "type = volatile char \\* volatile.*"
c906108c 151
b55a4771 152local_compiler_xfail_check
085dd6e6 153gdb_test "ptype velocity" "type = volatile unsigned char \\* volatile.*"
c906108c 154
b55a4771
MS
155local_compiler_xfail_check
156gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*"
c906108c 157
b55a4771 158local_compiler_xfail_check
bd69fc68 159gdb_test "ptype video" "type = volatile (unsigned short|short unsigned) \\* volatile.*"
c906108c 160
b55a4771
MS
161local_compiler_xfail_check
162gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*"
c906108c 163
b55a4771
MS
164local_compiler_xfail_check
165gdb_test "ptype veniality" "type = volatile (unsigned long|long unsigned)( int)? \\* volatile.*"
c906108c 166
b55a4771 167local_compiler_xfail_check
085dd6e6 168gdb_test "ptype vitality" "type = volatile float \\* volatile.*"
c906108c 169
b55a4771 170local_compiler_xfail_check
085dd6e6 171gdb_test "ptype voracity" "type = volatile double \\* volatile.*"
c906108c 172
b55a4771 173local_compiler_xfail_check
085dd6e6 174gdb_test "ptype victor" "type = const volatile char.*"
c906108c 175
b55a4771 176local_compiler_xfail_check
085dd6e6 177gdb_test "ptype vicar" "type = const volatile unsigned char.*"
c906108c 178
b55a4771 179local_compiler_xfail_check
085dd6e6 180gdb_test "ptype victory" "type = const volatile char \\*.*"
c906108c 181
b55a4771 182local_compiler_xfail_check
085dd6e6 183gdb_test "ptype vicarage" "type = const volatile unsigned char \\*.*"
c906108c 184
b55a4771 185local_compiler_xfail_check
085dd6e6 186gdb_test "ptype vein" "type = volatile char \\* const.*"
c906108c 187
b55a4771 188local_compiler_xfail_check
085dd6e6 189gdb_test "ptype vogue" "type = volatile unsigned char \\* const.*"
c906108c 190
b55a4771 191local_compiler_xfail_check
085dd6e6 192gdb_test "ptype cavern" "type = const volatile char \\* const.*"
c906108c 193
b55a4771 194local_compiler_xfail_check
085dd6e6 195gdb_test "ptype coverlet" "type = const volatile unsigned char \\* const.*"
c906108c 196
b55a4771 197local_compiler_xfail_check
085dd6e6 198gdb_test "ptype caveat" "type = const char \\* volatile.*"
c906108c 199
b55a4771 200local_compiler_xfail_check
085dd6e6 201gdb_test "ptype covenant" "type = const unsigned char \\* volatile.*"
c906108c 202
b55a4771 203local_compiler_xfail_check
085dd6e6 204gdb_test "ptype vizier" "type = const volatile char \\* volatile.*"
c906108c 205
b55a4771 206local_compiler_xfail_check
085dd6e6 207gdb_test "ptype vanadium" "type = const volatile unsigned char \\* volatile.*"
c906108c 208
b55a4771 209local_compiler_xfail_check
085dd6e6 210gdb_test "ptype vane" "type = char \\* const volatile.*"
c906108c 211
b55a4771 212local_compiler_xfail_check
085dd6e6 213gdb_test "ptype veldt" "type = unsigned char \\* const volatile.*"
c906108c 214
b55a4771 215local_compiler_xfail_check
085dd6e6 216gdb_test "ptype cove" "type = const char \\* const volatile.*"
c906108c 217
b55a4771 218local_compiler_xfail_check
085dd6e6 219gdb_test "ptype cavity" "type = const unsigned char \\* const volatile.*"
c906108c 220
b55a4771 221local_compiler_xfail_check
085dd6e6 222gdb_test "ptype vagus" "type = volatile char \\* const volatile.*"
c906108c 223
b55a4771 224local_compiler_xfail_check
085dd6e6 225gdb_test "ptype vagrancy" "type = volatile unsigned char \\* const volatile.*"
c906108c 226
b55a4771 227local_compiler_xfail_check
085dd6e6 228gdb_test "ptype vagary" "type = const volatile char \\* const volatile.*"
c906108c 229
b55a4771 230local_compiler_xfail_check
085dd6e6 231gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.*"
c906108c
SS
232
233# test function parameters
b55a4771 234local_compiler_xfail_check
8e937346 235local_compiler_xfail_check_2
02746bbc
MS
236
237gdb_test "ptype qux2" \
238 "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)" \
239 "ptype qux2"
This page took 1.371402 seconds and 4 git commands to generate.