]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/ptype.exp
This commit was generated by cvs2svn to track changes on a CVS vendor
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / ptype.exp
1 # Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 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 # This file was written by Rob Savoye. (rob@cygnus.com)
21
22 if $tracelevel then {
23 strace $tracelevel
24 }
25
26 #
27 # test running programs
28 #
29 set prms_id 0
30 set bug_id 0
31
32 set testfile "ptype"
33 set srcfile ${testfile}.c
34 set binfile ${objdir}/${subdir}/${testfile}
35 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
36 perror "Couldn't compile ${srcfile}"
37 return -1
38 }
39
40 # Create and source the file that provides information about the compiler
41 # used to compile the test case.
42 if [get_compiler_info ${binfile}] {
43 return -1;
44 }
45
46 gdb_exit
47 gdb_start
48 gdb_reinitialize_dir $srcdir/$subdir
49 gdb_load ${binfile}
50
51 # Test ptype of unnamed enumeration members before any action causes
52 # the partial symbol table to be expanded to full symbols. This fails
53 # with stabs compilers which fail to use a nameless stab (such as
54 # pre-2.4.5 versions of gcc and most non-gcc compilers).
55
56 send_gdb "ptype red1\n"
57 gdb_expect {
58 -re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $"\
59 {
60 # The workaround is in effect. As this is a compiler, not GDB,
61 # bug, we'll make it a PASS but perhaps it should be an XFAIL.
62 pass "ptype unnamed enumeration member (worked around)"
63 }
64 -re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $"\
65 { pass "ptype unnamed enumeration member" }
66 -re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" }
67 timeout { fail "(timeout) ptype unnamed enumeration member" }
68 }
69
70 #
71 # test ptype command with structures
72 #
73 # Here and elsewhere, we accept
74 # "long", "long int", or "int" for long variables (whatis.exp already
75 # has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
76 gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype structure"
77
78
79 # Test the equivalence between '.' and '->' for struct member references.
80
81 if [gdb_test "ptype v_struct1.v_float_member" "type = float"]<0 then {
82 return -1
83 }
84 if [gdb_test "ptype v_struct1->v_float_member" "type = float"]<0 then {
85 return -1
86 }
87 if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then {
88 return -1
89 }
90 if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then {
91 return -1
92 }
93
94
95 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
96 # which isn't defined.
97
98 gdb_test "ptype struct link" "type = struct link \{.*\[\r\n\] struct link \[*\]next;.*\[\r\n\] struct link \[*(\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.*\[\r\n\] struct t_struct stuff.1..2..3.;.*\[\r\n\]\}.*" "ptype linked list structure"
99
100 #
101 # test ptype command with unions
102 #
103 gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype union"
104
105 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
106 # which isn't defined.
107 gdb_test "ptype union tu_link" "type = union tu_link .*\[\r\n\] struct link \[*\]next;.*\[\r\n\] struct link \[(\*\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.*\[\r\n\] struct t_struct stuff.1..2..3.;.*\[\r\n\]\}.*" "ptype linked list union"
108
109 #
110 # test ptype command with enums
111 #
112
113 gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration"
114
115 gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration"
116
117
118 #
119 # test ptype command with enums as typedef
120 #
121 gdb_test "ptype boolean" "type = enum \{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
122
123 # And check that whatis shows the name, not "enum {...}".
124 # This probably fails for all DWARF 1 cases, so assume so for now. -fnf
125 # The problem with xlc is that the stabs look like
126 # :t51=eFALSE:0,TRUE:1,;
127 # boolean:t55=51
128 # v_boolean:G51
129 # GDB's behavior is correct; the type which the variable is defined
130 # as (51) doesn't have a name. Only 55 has a name.
131
132 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
133 setup_xfail_format "DWARF 1"
134 gdb_test "whatis v_boolean" "type = boolean" \
135 "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
136
137 # Same thing with struct and union.
138 gdb_test "ptype t_struct3" "type = struct \{.*
139 *double v_double_member;.*
140 *int v_int_member;.*\}" "printing typedef'd struct"
141
142 gdb_test "ptype t_union3" "type = union \{.*
143 *double v_double_member;.*
144 *int v_int_member;.*\}" "printing typedef'd union"
145
146 gdb_test "ptype enum bvals" "type = enum bvals \{false, true\}.*" "ptype named typedef'd enumf'd enum"
147
148 #
149 # test ptype command with out-of-order enum values
150 #
151 gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration"
152
153 #
154 # test ptype command with a named enum's value
155 #
156 gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member"
157
158 gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member"
159
160 #
161 # test ptype command with basic C types
162 #
163 # I've commented most of this out because it duplicates tests in whatis.exp.
164 # I've just left in a token test or 2 which is designed to test that ptype
165 # acts like whatis for basic types. If it is thought to be necessary to
166 # test both whatis and ptype for all the types, the tests should be
167 # merged into whatis.exp, or else maintenance will be a royal pain -kingdon
168 #setup_xfail "i960-*-*" 1821
169 #setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
170 #send "ptype v_char\n"
171 #gdb_expect {
172 # -re "type = char.*$gdb_prompt $" { pass "ptype char" }
173 # -re ".*$gdb_prompt $" { fail "ptype char" }
174 # timeout { fail "(timeout) ptype char" }
175 #}
176 #
177 #
178 #setup_xfail "mips-*-*" "a29k-*-*"
179 #send "ptype v_signed_char\n"
180 #gdb_expect {
181 # -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
182 # -re ".*$gdb_prompt $" { fail "ptype signed char" }
183 # timeout { fail "(timeout) ptype signed char" }
184 #}
185 #
186 #
187 #send "ptype v_unsigned_char\n"
188 #gdb_expect {
189 # -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
190 # -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
191 # timeout { fail "(timeout) ptype unsigned char" }
192 #}
193
194 gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
195
196 #send "ptype v_signed_short\n"
197 #gdb_expect {
198 # -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
199 # -re ".*$gdb_prompt $" { fail "ptype signed short" }
200 # timeout { fail "(timeout) ptype signed short" }
201 #}
202 #
203 #
204 #send "ptype v_unsigned_short\n"
205 #gdb_expect {
206 # -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
207 # -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
208 # timeout { fail "(timeout) ptype unsigned short" }
209 #}
210
211
212 gdb_test "ptype v_int" "type = int.*" "ptype int"
213
214 #send "ptype v_signed_int\n"
215 #gdb_expect {
216 # -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
217 # -re ".*$gdb_prompt $" { fail "ptype signed int" }
218 # timeout { fail "(timeout) ptype signed int" }
219 #}
220 #
221 #
222 #send "ptype v_unsigned_int\n"
223 #gdb_expect {
224 # -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
225 # -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
226 # timeout { fail "(timeout) ptype unsigned int" }
227 #}
228 #
229 #
230 #send "ptype v_long\n"
231 #gdb_expect {
232 # -re "type = long.*$gdb_prompt $" { pass "ptype long" }
233 # -re ".*$gdb_prompt $" { fail "ptype long" }
234 # timeout { fail "(timeout) ptype long" }
235 #}
236 #
237 #
238 #send "ptype v_signed_long\n"
239 #gdb_expect {
240 # -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
241 # -re ".*$gdb_prompt $" { fail "ptype signed long" }
242 # timeout { fail "(timeout) ptype signed long" }
243 #}
244 #
245 #
246 #send "ptype v_unsigned_long\n"
247 #gdb_expect {
248 # -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
249 # -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
250 # timeout { fail "(timeout) ptype unsigned long" }
251 #}
252 #
253 #
254 #send "ptype v_float\n"
255 #gdb_expect {
256 # -re "type = float.*$gdb_prompt $" { pass "ptype float" }
257 # -re ".*$gdb_prompt $" { fail "ptype float" }
258 # timeout { fail "(timeout) ptype float" }
259 #}
260 #
261 #
262 #send "ptype v_double\n"
263 #gdb_expect {
264 # -re "type = double.*$gdb_prompt $" { pass "ptype double" }
265 # -re ".*$gdb_prompt $" { fail "ptype double" }
266 # timeout { fail "(timeout) ptype double" }
267 #}
268
269
270 #
271 # test ptype command with arrays
272 #
273 #setup_xfail "i960-*-*" 1821
274 #setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
275 #send "ptype v_char_array\n"
276 #gdb_expect {
277 # -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
278 # -re ".*$gdb_prompt $" { fail "ptype char array" }
279 # timeout { fail "(timeout) ptype char array" }
280 #}
281 #
282 #
283 #setup_xfail "mips-*-*" "a29k-*-*"
284 #send "ptype v_signed_char_array\n"
285 #gdb_expect {
286 # -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
287 # -re ".*$gdb_prompt $" { fail "ptype signed char array" }
288 # timeout { fail "(timeout) ptype signed char array" }
289 #}
290 #
291 #
292 #send "ptype v_unsigned_char_array\n"
293 #gdb_expect {
294 # -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
295 # -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
296 # timeout { fail "(timeout) ptype unsigned char array" }
297 #}
298 #
299 #
300 #
301 #send "ptype v_int_array\n"
302 #gdb_expect {
303 # -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
304 # -re ".*$gdb_prompt $" { fail "ptype int array" }
305 # timeout { fail "(timeout) ptype int array" }
306 #}
307 #
308 #
309 #send "ptype v_signed_int_array\n"
310 #gdb_expect {
311 # -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
312 # -re ".*$gdb_prompt $" { fail "ptype signed int array" }
313 # timeout { fail "(timeout) ptype signed int array" }
314 #}
315 #
316 #
317 #send "ptype v_unsigned_int_array\n"
318 #gdb_expect {
319 # -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
320 # -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
321 # timeout { fail "(timeout) ptype unsigned int array" }
322 #}
323 #
324 #
325 #send "ptype v_long_array\n"
326 #gdb_expect {
327 # -re "type = (long|int|long int) .2..*$gdb_prompt $" {
328 # pass "ptype long array" }
329 # -re ".*$gdb_prompt $" { fail "ptype long array" }
330 # timeout { fail "(timeout) ptype long array" }
331 #}
332 #
333 #
334 #send "ptype v_signed_long_array\n"
335 #gdb_expect {
336 # -re "type = (long|int|long int) .2..*$gdb_prompt $" {
337 # pass "ptype signed long array" }
338 # -re ".*$gdb_prompt $" { fail "ptype signed long array" }
339 # timeout { fail "(timeout) ptype signed long array" }
340 #}
341 #
342 #
343 #send "ptype v_unsigned_long_array\n"
344 #gdb_expect {
345 # -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
346 # -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
347 # timeout { fail "(timeout) ptype unsigned long array" }
348 #}
349 #
350 #
351 #send "ptype v_float_array\n"
352 #gdb_expect {
353 # -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
354 # -re ".*$gdb_prompt $" { fail "ptype float array" }
355 # timeout { fail "(timeout) ptype float array" }
356 #}
357 #
358 #
359 #send "ptype v_double_array\n"
360 #gdb_expect {
361 # -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
362 # -re ".*$gdb_prompt $" { fail "ptype double array" }
363 # timeout { fail "(timeout) ptype double array" }
364 #}
365 #
366
367 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
368 setup_xfail_format "DWARF 1"
369 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
370
371 #
372 ##
373 ## test ptype command with pointers
374 ##
375 #setup_xfail "i960-*-*" 1821
376 #setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
377 #send "ptype v_char_pointer\n"
378 #gdb_expect {
379 # -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
380 # -re ".*$gdb_prompt $" { fail "ptype char pointer" }
381 # timeout { fail "(timeout) ptype char pointer" }
382 #}
383 #
384 #
385 #setup_xfail "mips-*-*" "a29k-*-*"
386 #send "ptype v_signed_char_pointer\n"
387 #gdb_expect {
388 # -re "type = (|signed )char \*.*$gdb_prompt $"
389 # { pass "ptype signed char pointer" }
390 # -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
391 # timeout { fail "(timeout) ptype signed char pointer" }
392 #}
393 #
394 #
395 #send "ptype v_unsigned_char_pointer\n"
396 #gdb_expect {
397 # -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
398 # -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
399 # timeout { fail "(timeout) ptype unsigned char pointer" }
400 #}
401 #
402 #
403 #send "ptype v_short_pointer\n"
404 #gdb_expect {
405 # -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
406 # -re ".*$gdb_prompt $" { fail "ptype short pointer" }
407 # timeout { fail "(timeout) ptype short pointer" }
408 #}
409 #
410 #
411 #send "ptype v_signed_short_pointer\n"
412 #gdb_expect {
413 # -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
414 # -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
415 # timeout { fail "(timeout) ptype signed short pointer" }
416 #}
417 #
418 #
419 #send "ptype v_unsigned_short_pointer\n"
420 #gdb_expect {
421 # -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
422 # -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
423 # timeout { fail "(timeout) ptype unsigned short pointer" }
424 #}
425 #
426 #
427 #send "ptype v_int_pointer\n"
428 #gdb_expect {
429 # -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
430 # -re ".*$gdb_prompt $" { fail "ptype int pointer" }
431 # timeout { fail "(timeout) ptype int pointer" }
432 #}
433 #
434 #
435 #send "ptype v_signed_int_pointer\n"
436 #gdb_expect {
437 # -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
438 # -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
439 # timeout { fail "(timeout) ptype signed int pointer" }
440 #}
441 #
442 #
443 #send "ptype v_unsigned_int_pointer\n"
444 #gdb_expect {
445 # -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
446 # -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
447 # timeout { fail "(timeout) ptype unsigned int pointer" }
448 #}
449 #
450 #
451 #send "ptype v_long_pointer\n"
452 #gdb_expect {
453 # -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
454 # -re ".*$gdb_prompt $" { fail "ptype long pointer" }
455 # timeout { fail "(timeout) ptype long pointer" }
456 #}
457 #
458 #
459 #send "ptype v_signed_long_pointer\n"
460 #gdb_expect {
461 # -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
462 # -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
463 # timeout { fail "(timeout) ptype signed long pointer" }
464 #}
465 #
466 #
467 #send "ptype v_unsigned_long_pointer\n"
468 #gdb_expect {
469 # -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
470 # -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
471 # timeout { fail "(timeout) ptype unsigned long pointer" }
472 #}
473 #
474 #
475 #send "ptype v_float_pointer\n"
476 #gdb_expect {
477 # -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
478 # -re ".*$gdb_prompt $" { fail "ptype float pointer" }
479 # timeout { fail "(timeout) ptype float pointer" }
480 #}
481 #
482 #
483 #send "ptype v_double_pointer\n"
484 #gdb_expect {
485 # -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
486 # -re ".*$gdb_prompt $" { fail "ptype double pointer" }
487 # timeout { fail "(timeout) ptype double pointer" }
488 #}
489
490 #
491 # test ptype command with nested structure and union
492 #
493 gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] struct inner_struct inner_struct_instance;.*\[\r\n\] union inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
494
495 gdb_test "ptype struct inner_struct" "type = struct inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype inner structure"
496
497 gdb_test "ptype union inner_union" "type = union inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype inner union"
498
499 gdb_test "ptype nested_su" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] struct inner_struct inner_struct_instance;.*\[\r\n\] union inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure"
500
501 gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int"
502
503 gdb_test "ptype nested_su.inner_struct_instance" "type = struct inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype nested structure"
504
505 gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int"
506
507 gdb_test "ptype nested_su.inner_union_instance" "type = union inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype nested union"
508
509 # Test printing type of string constants and array constants, but
510 # requires a running process. These call malloc, and can take a long
511 # time to execute over a slow serial link, so increase the timeout.
512
513 # UDI can't do this (PR 2416). XFAIL is not suitable, because attempting
514 # the operation causes a slow painful death rather than a nice simple failure.
515
516 if [runto_main] then {
517
518 get_debug_format
519 if [target_info exists gdb,cannot_call_functions] {
520 setup_xfail "*-*-*" 2416
521 fail "This target can not call functions"
522 continue
523 }
524
525 gdb_test "ptype \"abc\"" "type = char \\\[4\\\]"
526 gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]"
527 gdb_test "ptype {0,1,2}" "type = int \\\[3\\\]"
528 gdb_test "ptype {(long)0,(long)1,(long)2}" "type = long \\\[3\\\]"
529 gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]"
530 gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]"
531 gdb_test "ptype {4,5,6}\[2\]" "type = int"
532 gdb_test "ptype *&{4,5,6}\[1\]" "type = int"
533 }