* elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / volatile.exp
CommitLineData
c906108c
SS
1# Copyright (C) 1997, 1998, 1999 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 2 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, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17# Please email any bugs, comments, and/or additions to this file to:
18# bug-gdb@prep.ai.mit.edu
19
20# Written by Satish Pai <pai@apollo.hp.com> 1997-07-07
21# In the spirit of constvars.exp: added volatile, const-volatile stuff.
22
23# This file is part of the gdb testsuite
24# Tests for:
25# volatile vars
26# pointers to volatile vars
27# const volatile vars
28# pointers to const volatile vars
29# const pointers to volatile vars
30# volatile pointers to const vars
31# const volatile pointers to const vars
32# const volatile pointers to volatile vars
33# ... etc. (you get the idea)
34# Mostly with char and unsigned char.
35
36if $tracelevel then {
37 strace $tracelevel
38 }
39
40#
41# test running programs
42#
43set prms_id 0
44set bug_id 0
45
46# Use the same test program constvars.c.
47
48set testfile "constvars"
49set srcfile ${testfile}.c
50set binfile ${objdir}/${subdir}/${testfile}
51
52if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
53 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
54}
55
56remote_exec build "rm -f ${binfile}.ci"
57if [get_compiler_info ${binfile}] {
58 return -1
59}
60
61gdb_exit
62gdb_start
63gdb_reinitialize_dir $srcdir/$subdir
64gdb_load ${binfile}
65
66source ${binfile}.ci
67
68#
69# set it up at a breakpoint so we can play with the variable values
70#
71if ![runto_main] then {
72 perror "couldn't run to breakpoint"
73 continue
74}
75
76send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
77
78 send_gdb "cont\n"
79 gdb_expect {
80 -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
81 send_gdb "up\n"
82 gdb_expect {
83 -re ".*$gdb_prompt $" {}
84 timeout { fail "up from marker1" }
85 }
86 }
87 -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
88 fail "continue to marker1 (demangling)"
89 send_gdb "up\n"
90 gdb_expect {
91 -re ".*$gdb_prompt $" {}
92 timeout { fail "up from marker1" }
93 }
94 }
95 -re "$gdb_prompt $" { fail "continue to marker1" }
96 timeout { fail "(timeout) continue to marker1" }
97 }
98
99# As of Feb 1999, GCC does not issue info about volatility of vars, so
100# these tests are all expected to fail if GCC is the compiler. -sts
101
102if {$gcc_compiled} then { setup_xfail "*-*-*" }
103gdb_test "ptype vox" "type = volatile char"
104
105if {$gcc_compiled} then { setup_xfail "*-*-*" }
106gdb_test "ptype victuals" "type = volatile unsigned char"
107
108if {$gcc_compiled} then { setup_xfail "*-*-*" }
109gdb_test "ptype vixen" "type = volatile short"
110
111if {$gcc_compiled} then { setup_xfail "*-*-*" }
112gdb_test "ptype vitriol" "type = volatile unsigned short"
113
114if {$gcc_compiled} then { setup_xfail "*-*-*" }
115gdb_test "ptype vellum" "type = volatile long"
116
117if {$gcc_compiled} then { setup_xfail "*-*-*" }
118gdb_test "ptype valve" "type = volatile unsigned long"
119
120if {$gcc_compiled} then { setup_xfail "*-*-*" }
121gdb_test "ptype vacuity" "type = volatile float"
122
123if {$gcc_compiled} then { setup_xfail "*-*-*" }
124gdb_test "ptype vertigo" "type = volatile double"
125
126if {$gcc_compiled} then { setup_xfail "*-*-*" }
127gdb_test "ptype vampire" "type = volatile char *"
128
129if {$gcc_compiled} then { setup_xfail "*-*-*" }
130gdb_test "ptype viper" "type = volatile unsigned char *"
131
132if {$gcc_compiled} then { setup_xfail "*-*-*" }
133gdb_test "ptype vigour" "type = volatile short *"
134
135if {$gcc_compiled} then { setup_xfail "*-*-*" }
136gdb_test "ptype vapour" "type = volatile unsigned short *"
137
138if {$gcc_compiled} then { setup_xfail "*-*-*" }
139gdb_test "ptype ventricle" "type = volatile long *"
140
141if {$gcc_compiled} then { setup_xfail "*-*-*" }
142gdb_test "ptype vigintillion" "type = volatile unsigned long *"
143
144if {$gcc_compiled} then { setup_xfail "*-*-*" }
145gdb_test "ptype vocation" "type = volatile float *"
146
147if {$gcc_compiled} then { setup_xfail "*-*-*" }
148gdb_test "ptype veracity" "type = volatile double *"
149
150if {$gcc_compiled} then { setup_xfail "*-*-*" }
151gdb_test "ptype vapidity" "type = volatile char * volatile"
152
153if {$gcc_compiled} then { setup_xfail "*-*-*" }
154gdb_test "ptype velocity" "type = volatile unsigned char * volatile"
155
156if {$gcc_compiled} then { setup_xfail "*-*-*" }
157gdb_test "ptype veneer" "type = volatile short * volatile"
158
159if {$gcc_compiled} then { setup_xfail "*-*-*" }
160gdb_test "ptype video" "type = volatile unsigned short * volatile"
161
162if {$gcc_compiled} then { setup_xfail "*-*-*" }
163gdb_test "ptype vacuum" "type = volatile long * volatile"
164
165if {$gcc_compiled} then { setup_xfail "*-*-*" }
166gdb_test "ptype veniality" "type = volatile unsigned long * volatile"
167
168if {$gcc_compiled} then { setup_xfail "*-*-*" }
169gdb_test "ptype vitality" "type = volatile float * volatile"
170
171if {$gcc_compiled} then { setup_xfail "*-*-*" }
172gdb_test "ptype voracity" "type = volatile double * volatile"
173
174if {$gcc_compiled} then { setup_xfail "*-*-*" }
175gdb_test "ptype victor" "type = const volatile char"
176
177if {$gcc_compiled} then { setup_xfail "*-*-*" }
178gdb_test "ptype vicar" "type = const volatile unsigned char"
179
180if {$gcc_compiled} then { setup_xfail "*-*-*" }
181gdb_test "ptype victory" "type = const volatile char *"
182
183if {$gcc_compiled} then { setup_xfail "*-*-*" }
184gdb_test "ptype vicarage" "type = const volatile unsigned char *"
185
186if {$gcc_compiled} then { setup_xfail "*-*-*" }
187gdb_test "ptype vein" "type = volatile char * const"
188
189if {$gcc_compiled} then { setup_xfail "*-*-*" }
190gdb_test "ptype vogue" "type = volatile unsigned char * const"
191
192if {$gcc_compiled} then { setup_xfail "*-*-*" }
193gdb_test "ptype cavern" "type = const volatile char * const"
194
195if {$gcc_compiled} then { setup_xfail "*-*-*" }
196gdb_test "ptype coverlet" "type = const volatile unsigned char * const"
197
198if {$gcc_compiled} then { setup_xfail "*-*-*" }
199gdb_test "ptype caveat" "type = const char * volatile"
200
201if {$gcc_compiled} then { setup_xfail "*-*-*" }
202gdb_test "ptype covenant" "type = const unsigned char * volatile"
203
204if {$gcc_compiled} then { setup_xfail "*-*-*" }
205gdb_test "ptype vizier" "type = const volatile char * volatile"
206
207if {$gcc_compiled} then { setup_xfail "*-*-*" }
208gdb_test "ptype vanadium" "type = const volatile unsigned char * volatile"
209
210if {$gcc_compiled} then { setup_xfail "*-*-*" }
211gdb_test "ptype vane" "type = char * const volatile"
212
213if {$gcc_compiled} then { setup_xfail "*-*-*" }
214gdb_test "ptype veldt" "type = unsigned char * const volatile"
215
216if {$gcc_compiled} then { setup_xfail "*-*-*" }
217gdb_test "ptype cove" "type = const char * const volatile"
218
219if {$gcc_compiled} then { setup_xfail "*-*-*" }
220gdb_test "ptype cavity" "type = const unsigned char * const volatile"
221
222if {$gcc_compiled} then { setup_xfail "*-*-*" }
223gdb_test "ptype vagus" "type = volatile char * const volatile"
224
225if {$gcc_compiled} then { setup_xfail "*-*-*" }
226gdb_test "ptype vagrancy" "type = volatile unsigned char * const volatile"
227
228if {$gcc_compiled} then { setup_xfail "*-*-*" }
229gdb_test "ptype vagary" "type = const volatile char * const volatile"
230
231if {$gcc_compiled} then { setup_xfail "*-*-*" }
232gdb_test "ptype vendor" "type = const volatile unsigned char * const volatile"
233
234# test function parameters
235if {$gcc_compiled} then { setup_xfail "*-*-*" }
236send_gdb "ptype qux2\n"
237gdb_expect {
238 -re "type = int \\(volatile unsigned char, const volatile int, volatile short &, volatile long \\*, float \\* volatile, const volatile signed char \\* const volatile\\)" {
239 pass "ptype qux2"
240 }
241 -re ".*$gdb_prompt $" { fail "ptype qux2" }
242 timeout { fail "(timeout) ptype qux2" }
243 }
This page took 0.038027 seconds and 4 git commands to generate.