Add support to skip import libraries for performance reasons and instead
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.chill / chillvars.exp
CommitLineData
ba010b30
AC
1# OBSOLETE # Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
2# OBSOLETE
3# OBSOLETE # This program is free software; you can redistribute it and/or modify
4# OBSOLETE # it under the terms of the GNU General Public License as published by
5# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
6# OBSOLETE # (at your option) any later version.
7# OBSOLETE #
8# OBSOLETE # This program is distributed in the hope that it will be useful,
9# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
10# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# OBSOLETE # GNU General Public License for more details.
12# OBSOLETE #
13# OBSOLETE # You should have received a copy of the GNU General Public License
14# OBSOLETE # along with this program; if not, write to the Free Software
15# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16# OBSOLETE
17# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
18# OBSOLETE # bug-gdb@prep.ai.mit.edu
19# OBSOLETE
20# OBSOLETE # This file was written by Fred Fish. (fnf@cygnus.com)
21# OBSOLETE
22# OBSOLETE if $tracelevel then {
23# OBSOLETE strace $tracelevel
24# OBSOLETE }
25# OBSOLETE
26# OBSOLETE if [skip_chill_tests] then { continue }
27# OBSOLETE
28# OBSOLETE set testfile "chillvars"
29# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
30# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
31# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
32# OBSOLETE perror "Couldn't compile ${srcfile}"
33# OBSOLETE return -1
34# OBSOLETE }
35# OBSOLETE
36# OBSOLETE proc do_tests {} {
37# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
38# OBSOLETE
39# OBSOLETE set prms_id 0
40# OBSOLETE set bug_id 0
41# OBSOLETE
42# OBSOLETE # Start with a fresh gdb.
43# OBSOLETE
44# OBSOLETE gdb_exit
45# OBSOLETE gdb_start
46# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
47# OBSOLETE gdb_load $binfile
48# OBSOLETE
49# OBSOLETE gdb_test "set language chill" ""
50# OBSOLETE
51# OBSOLETE # This is needed (at least on SunOS4) to make sure the
52# OBSOLETE # the symbol table is read.
53# OBSOLETE gdb_test "break chillvars.ch:3" ""
54# OBSOLETE gdb_test "delete 1" ""
55# OBSOLETE
56# OBSOLETE gdb_test "set width 0" ""
57# OBSOLETE gdb_test "set print sevenbit-strings" ""
58# OBSOLETE gdb_test "set print address off" ""
59# OBSOLETE
60# OBSOLETE test_BOOL
61# OBSOLETE test_CHAR
62# OBSOLETE test_BYTE
63# OBSOLETE test_UBYTE
64# OBSOLETE test_INT
65# OBSOLETE test_UINT
66# OBSOLETE test_LONG
67# OBSOLETE test_ULONG
68# OBSOLETE test_REAL
69# OBSOLETE test_LONG_REAL
70# OBSOLETE test_POWERSET
71# OBSOLETE test_arrays
72# OBSOLETE test_strings
73# OBSOLETE test_structs
74# OBSOLETE
75# OBSOLETE test_ptr
76# OBSOLETE }
77# OBSOLETE
78# OBSOLETE proc test_BOOL {} {
79# OBSOLETE
80# OBSOLETE gdb_test "ptype bool_true" "type = (BOOL|bool)"
81# OBSOLETE gdb_test "ptype bool_false" "type = (BOOL|bool)"
82# OBSOLETE gdb_test "whatis bool_true" "type = (BOOL|bool)"
83# OBSOLETE gdb_test "whatis bool_false" "type = (BOOL|bool)"
84# OBSOLETE gdb_test "print bool_false" " = FALSE"
85# OBSOLETE gdb_test "print bool_true" " = TRUE"
86# OBSOLETE
87# OBSOLETE }
88# OBSOLETE
89# OBSOLETE proc test_CHAR {} {
90# OBSOLETE gdb_test "ptype control_char" "type = (CHAR|char)"
91# OBSOLETE gdb_test "whatis control_char" "type = (CHAR|char)"
92# OBSOLETE gdb_test "print control_char" { = '\^[(]7[)]'}
93# OBSOLETE gdb_test "ptype printable_char" "type = (CHAR|char)"
94# OBSOLETE gdb_test "whatis printable_char" "type = (CHAR|char)"
95# OBSOLETE gdb_test "print printable_char" " = 'a'"
96# OBSOLETE
97# OBSOLETE gdb_test "print lower(char)" { = '\^[(]0[)]'}
98# OBSOLETE gdb_test "print upper(char)" { = '\^[(]255[)]'}
99# OBSOLETE }
100# OBSOLETE
101# OBSOLETE proc test_BYTE {} {
102# OBSOLETE gdb_test "ptype byte_low" "type = (BYTE|byte)"
103# OBSOLETE gdb_test "whatis byte_low" "type = (BYTE|byte)"
104# OBSOLETE gdb_test "print byte_low" " = -128"
105# OBSOLETE gdb_test "ptype byte_high" "type = (BYTE|byte)"
106# OBSOLETE gdb_test "whatis byte_high" "type = (BYTE|byte)"
107# OBSOLETE gdb_test "print byte_high" " = 127"
108# OBSOLETE
109# OBSOLETE gdb_test "print lower(byte)" " = -128"
110# OBSOLETE gdb_test "print upper(byte)" " = 127"
111# OBSOLETE gdb_test "print lower(byte_high)" " = -128"
112# OBSOLETE gdb_test "print upper(byte_high)" " = 127"
113# OBSOLETE }
114# OBSOLETE
115# OBSOLETE proc test_UBYTE {} {
116# OBSOLETE gdb_test "ptype ubyte_low" "type = (UBYTE|ubyte)"
117# OBSOLETE gdb_test "whatis ubyte_low" "type = (UBYTE|ubyte)"
118# OBSOLETE gdb_test "print ubyte_low" " = 0"
119# OBSOLETE gdb_test "ptype ubyte_high" "type = (UBYTE|ubyte)"
120# OBSOLETE gdb_test "whatis ubyte_high" "type = (UBYTE|ubyte)"
121# OBSOLETE gdb_test "print ubyte_high" " = 255"
122# OBSOLETE }
123# OBSOLETE
124# OBSOLETE proc test_INT {} {
125# OBSOLETE gdb_test "ptype int_low" "type = (INT|int)"
126# OBSOLETE gdb_test "whatis int_low" "type = (INT|int)"
127# OBSOLETE gdb_test "print int_low" " = -32768"
128# OBSOLETE gdb_test "ptype int_high" "type = (INT|int)"
129# OBSOLETE gdb_test "whatis int_high" "type = (INT|int)"
130# OBSOLETE gdb_test "print int_high" " = 32767"
131# OBSOLETE }
132# OBSOLETE
133# OBSOLETE proc test_UINT {} {
134# OBSOLETE gdb_test "ptype uint_low" "type = (UINT|uint)"
135# OBSOLETE gdb_test "whatis uint_low" "type = (UINT|uint)"
136# OBSOLETE gdb_test "print uint_low" " = 0"
137# OBSOLETE gdb_test "ptype uint_high" "type = (UINT|uint)"
138# OBSOLETE gdb_test "whatis uint_high" "type = (UINT|uint)"
139# OBSOLETE gdb_test "print uint_high" " = 65535"
140# OBSOLETE }
141# OBSOLETE
142# OBSOLETE proc test_LONG {} {
143# OBSOLETE gdb_test "ptype long_low" "type = (LONG|long)"
144# OBSOLETE gdb_test "whatis long_low" "type = (LONG|long)"
145# OBSOLETE gdb_test "print long_low" " = -2147483648"
146# OBSOLETE gdb_test "ptype long_high" "type = (LONG|long)"
147# OBSOLETE gdb_test "whatis long_high" "type = (LONG|long)"
148# OBSOLETE gdb_test "print long_high" " = 2147483647"
149# OBSOLETE }
150# OBSOLETE
151# OBSOLETE proc test_ULONG {} {
152# OBSOLETE gdb_test "ptype ulong_low" "type = (ULONG|ulong)"
153# OBSOLETE gdb_test "whatis ulong_low" "type = (ULONG|ulong)"
154# OBSOLETE gdb_test "print ulong_low" " = 0"
155# OBSOLETE gdb_test "ptype ulong_high" "type = (ULONG|ulong)"
156# OBSOLETE gdb_test "whatis ulong_high" "type = (ULONG|ulong)"
157# OBSOLETE gdb_test "print ulong_high" " = 4294967295"
158# OBSOLETE }
159# OBSOLETE
160# OBSOLETE proc test_REAL {} {
161# OBSOLETE gdb_test "ptype real1" "type = (FLOAT|float)"
162# OBSOLETE gdb_test "whatis real1" "type = (FLOAT|float)"
163# OBSOLETE gdb_test "print real1" " = 3.14159274"
164# OBSOLETE }
165# OBSOLETE
166# OBSOLETE proc test_LONG_REAL {} {
167# OBSOLETE gdb_test "ptype long_real1" "type = (DOUBLE|double)"
168# OBSOLETE gdb_test "whatis long_real1" "type = (DOUBLE|double)"
169# OBSOLETE gdb_test "print long_real1" " = 3\\.1400000000000001e\\+300"
170# OBSOLETE }
171# OBSOLETE
172# OBSOLETE proc test_POWERSET {} {
173# OBSOLETE }
174# OBSOLETE
175# OBSOLETE proc test_arrays {} {
176# OBSOLETE gdb_test "ptype booltable1" "type = ARRAY \\(+0:3\\)+ (BOOL|bool)"
177# OBSOLETE gdb_test_exact "print booltable1" \
178# OBSOLETE { = [(0): TRUE, (1:2): FALSE, (3): TRUE]}
179# OBSOLETE
180# OBSOLETE gdb_test "ptype booltable2" "type = ARRAY \\(+4:7\\)+ (BOOL|bool)"
181# OBSOLETE gdb_test_exact "print booltable2" { = [(4): TRUE, (5:6): FALSE, (7): TRUE]}
182# OBSOLETE
183# OBSOLETE gdb_test "ptype chartable1" "type = ARRAY \\(+0:2\\)+ (CHAR|char)"
184# OBSOLETE gdb_test_exact "print chartable1" {= [(0): '^(0)', (1): '^(1)', (2): '^(2)']}
185# OBSOLETE
186# OBSOLETE gdb_test "ptype chartable2" "type = ARRAY \\(+3:5\\)+ (CHAR|char)"
187# OBSOLETE gdb_test_exact "print chartable2" \
188# OBSOLETE {= [(3): '^(0)', (4): '^(1)', (5): '^(2)']}
189# OBSOLETE
190# OBSOLETE gdb_test "ptype bytetable1" "type = ARRAY \\(+0:4\\)+ (BYTE|byte)"
191# OBSOLETE gdb_test_exact "print bytetable1" \
192# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
193# OBSOLETE
194# OBSOLETE gdb_test "ptype bytetable2" "type = ARRAY \\(+5:9\\)+ (BYTE|byte)"
195# OBSOLETE gdb_test_exact "print bytetable2" \
196# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
197# OBSOLETE
198# OBSOLETE gdb_test "ptype bytetable3" \
199# OBSOLETE "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
200# OBSOLETE gdb_test_exact "print bytetable3" \
201# OBSOLETE {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
202# OBSOLETE gdb_test "ptype bytetable4" \
203# OBSOLETE "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
204# OBSOLETE gdb_test_exact "print bytetable4" \
205# OBSOLETE {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
206# OBSOLETE
207# OBSOLETE gdb_test "ptype ubytetable1" "type = ARRAY \\(+0:4\\)+ (UBYTE|ubyte)"
208# OBSOLETE gdb_test_exact "print ubytetable1" \
209# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
210# OBSOLETE
211# OBSOLETE gdb_test "ptype ubytetable2" "type = ARRAY \\(+5:9\\)+ (UBYTE|ubyte)"
212# OBSOLETE gdb_test_exact "print ubytetable2" \
213# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
214# OBSOLETE
215# OBSOLETE gdb_test "ptype inttable1" "type = ARRAY \\(+0:4\\)+ (INT|int)"
216# OBSOLETE gdb_test_exact "print inttable1" \
217# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
218# OBSOLETE
219# OBSOLETE gdb_test "ptype inttable2" "type = ARRAY \\(+5:9\\)+ (INT|int)"
220# OBSOLETE gdb_test_exact "print inttable2" \
221# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
222# OBSOLETE
223# OBSOLETE gdb_test "ptype uinttable1" "type = ARRAY \\(+0:4\\)+ (UINT|uint)"
224# OBSOLETE gdb_test_exact "print uinttable1" \
225# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
226# OBSOLETE
227# OBSOLETE gdb_test "ptype uinttable2" "type = ARRAY \\(+5:9\\)+ (UINT|uint)"
228# OBSOLETE gdb_test_exact "print uinttable2" \
229# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
230# OBSOLETE
231# OBSOLETE gdb_test "ptype longtable1" "type = ARRAY \\(+0:4\\)+ (LONG|long)"
232# OBSOLETE gdb_test_exact "print longtable1" \
233# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
234# OBSOLETE
235# OBSOLETE gdb_test "ptype longtable2" "type = ARRAY \\(+5:9\\)+ (LONG|long)"
236# OBSOLETE gdb_test_exact "print longtable2" \
237# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
238# OBSOLETE
239# OBSOLETE gdb_test "ptype ulongtable1" "type = ARRAY \\(+0:4\\)+ (ULONG|ulong)"
240# OBSOLETE gdb_test_exact "print ulongtable1" \
241# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
242# OBSOLETE
243# OBSOLETE gdb_test "ptype ulongtable2" "type = ARRAY \\(+5:9\\)+ (ULONG|ulong)"
244# OBSOLETE gdb_test_exact "print ulongtable2" \
245# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
246# OBSOLETE
247# OBSOLETE gdb_test "ptype realtable1" "type = ARRAY \\(+0:4\\)+ (FLOAT|float)"
248# OBSOLETE gdb_test_exact "print realtable1" \
249# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
250# OBSOLETE
251# OBSOLETE gdb_test "ptype realtable2" "type = ARRAY \\(+5:9\\)+ (FLOAT|float)"
252# OBSOLETE gdb_test_exact "print realtable2" \
253# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
254# OBSOLETE
255# OBSOLETE gdb_test "ptype longrealtable1" "type = ARRAY \\(+0:4\\)+ (DOUBLE|double)"
256# OBSOLETE gdb_test_exact "print longrealtable1" \
257# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
258# OBSOLETE
259# OBSOLETE gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)"
260# OBSOLETE gdb_test_exact "print longrealtable2" \
261# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
262# OBSOLETE
263# OBSOLETE gdb_test "print length(longrealtable2)" {= 5}
264# OBSOLETE gdb_test "print lower(longrealtable2)" {= 5}
265# OBSOLETE gdb_test "print upper(longrealtable2)" {= 9}
266# OBSOLETE }
267# OBSOLETE
268# OBSOLETE proc test_strings {} {
269# OBSOLETE
270# OBSOLETE gdb_test "ptype string1" "type = CHARS \[(\]4\[)\]+"
271# OBSOLETE gdb_test "print string1" " = \"abcd\""
272# OBSOLETE
273# OBSOLETE gdb_test "ptype string2" "type = CHARS \[(\]+5\[)\]+"
274# OBSOLETE gdb_test "print string2" { = \"ef\^\(0\)gh\"}
275# OBSOLETE
276# OBSOLETE gdb_test "ptype string3" "type = CHARS \[(\]+6\[)\]+"
277# OBSOLETE gdb_test "print string3" " = \"efghij\""
278# OBSOLETE
279# OBSOLETE gdb_test "ptype string4" "type = CHARS \[(\]+7\[)\]+"
280# OBSOLETE gdb_test "print string4" { = \"zzzzzz\^\(0\)\"}
281# OBSOLETE
282# OBSOLETE # These tests require a running process, so run to one of the procs
283# OBSOLETE # and then do the tests.
284# OBSOLETE
285# OBSOLETE if [runto scalar_arithmetic] then {
286# OBSOLETE gdb_test "ptype string1//string2" "type = CHARS \\(9\\)"
287# OBSOLETE gdb_test "print string1//string2" { = \"abcdef\^\(0\)gh\"}
288# OBSOLETE gdb_test_exact {ptype "a chill string"} {type = CHARS (14)}
289# OBSOLETE gdb_test "print 'a chill string'" " = \"a chill string\""
290# OBSOLETE gdb_test "print \"ef\"//c'00'//\"gh\"" { = \"ef\^\(0\)gh\"}
291# OBSOLETE gdb_test "print string1 // \"efgh\"" " = \"abcdefgh\""
292# OBSOLETE gdb_test "print (6) 'z'" " = \"zzzzzz\""
293# OBSOLETE gdb_test "ptype (6) 'z'" "type = CHARS \[(\]+6\[)\]+"
294# OBSOLETE gdb_test "print (1+2*3) 'x'" " = \"xxxxxxx\""
295# OBSOLETE gdb_test "ptype (1+2*3) 'x'" "type = CHARS \[(\]+7\[)\]+"
296# OBSOLETE }
297# OBSOLETE
298# OBSOLETE }
299# OBSOLETE
300# OBSOLETE proc test_structs {} {
301# OBSOLETE gdb_test "ptype struct1" \
302# OBSOLETE "type = STRUCT \\(+.*abool (BOOL|bool),.*aint (INT|int),.*astring CHARS \\(+8\\)+.*\\)+"
303# OBSOLETE gdb_test "print struct1" \
304# OBSOLETE ".* = \\\[\.abool: TRUE, \.aint: 123, \.astring: \"a string\"\\\]"
305# OBSOLETE gdb_test "ptype struct2" \
306# OBSOLETE "type = STRUCT \\(+.*abool (BOOL|bool),.*nstruct simple_struct,.*aint (INT|int).*\\)+"
307# OBSOLETE gdb_test "print struct2" \
308# OBSOLETE ".* = \\\[.abool: TRUE, \.nstruct: \\\[\.abool: FALSE, \.aint: 456, \.astring: \"deadbeef\"\\\], \.aint: 789\\\]"
309# OBSOLETE }
310# OBSOLETE
311# OBSOLETE proc test_ptr {} {
312# OBSOLETE # This is to test Cygnus PR 6932
313# OBSOLETE gdb_test "print xptr->int" ".* = 32767"
314# OBSOLETE }
315# OBSOLETE
316# OBSOLETE do_tests
This page took 0.07712 seconds and 4 git commands to generate.