1 # Copyright 1988-2024 Free Software Foundation, Inc.
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 3 of the License, or
6 # (at your option) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # This file was written by Rob Savoye. (rob@cygnus.com)
19 # test running programs
22 standard_testfile .c ptype1.c
24 if {[prepare_for_testing "failed to prepare" ${testfile} \
25 [list $srcfile $srcfile2] {debug nowarnings}]} {
29 # Some tests require GCC.
30 set gcc_compiled [is_c_compiler_gcc]
32 # Test ptype of unnamed enumeration members before any action causes
33 # the partial symbol table to be expanded to full symbols. This fails
34 # with stabs compilers which fail to use a nameless stab (such as
35 # pre-2.4.5 versions of gcc and most non-gcc compilers).
37 gdb_test_multiple "ptype red1" "ptype unnamed enumeration member" {
38 -re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $" {
39 # The workaround is in effect. As this is a compiler, not GDB,
40 # bug, we'll make it a PASS but perhaps it should be an XFAIL.
41 pass "ptype unnamed enumeration member (worked around)"
43 -re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $" {
44 pass "ptype unnamed enumeration member"
49 # test ptype command with structures
51 # Here and elsewhere, we accept
52 # "long", "long int", or "int" for long variables (whatis.exp already
53 # has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
54 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"
57 # Test the equivalence between '.' and '->' for struct member references.
59 if {[gdb_test "ptype v_struct1.v_float_member" "type = float"] < 0} {
62 if {[gdb_test "ptype v_struct1->v_float_member" "type = float"] < 0} {
65 if {[gdb_test "ptype v_t_struct_p.v_float_member" "type = float"] < 0} {
68 if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} {
73 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
74 # which isn't defined.
76 gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure"
79 # test ptype command with unions
81 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"
83 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
84 # which isn't defined.
85 gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union"
88 # test ptype command with enums
91 gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration"
93 gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration"
97 # test ptype command with enums as typedef
99 gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
101 # And check that whatis shows the name, not "enum {...}".
102 # This probably fails for all DWARF 1 cases, so assume so for now. -fnf
103 # The problem with xlc is that the stabs look like
104 # :t51=eFALSE:0,TRUE:1,;
107 # GDB's behavior is correct; the type which the variable is defined
108 # as (51) doesn't have a name. Only 55 has a name.
110 if {!$gcc_compiled} {
111 setup_xfail "rs6000-*-*" "i*86-*-sysv4*"
112 setup_xfail "hppa*-*-*" CLLbs14773
115 # For get_debug_format to do its job, we need to have a current source file.
116 gdb_test "list -q main" ".*"
118 gdb_test "whatis v_boolean" "type = (enum |)boolean" \
119 "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
121 # Same thing with struct and union.
122 gdb_test "ptype t_struct3" "type = struct (t_struct3 |)\{.*
123 *double v_double_member;.*
124 *int v_int_member;.*\}" "printing typedef'd struct"
126 gdb_test "ptype t_union3" "type = union (t_union3 |)\{.*
127 *double v_double_member;.*
128 *int v_int_member;.*\}" "printing typedef'd union"
130 gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype named typedef'd enumf'd enum"
133 # test ptype command with out-of-order enum values
135 gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration"
138 # test ptype command with a named enum's value
140 gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member"
142 gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2"
145 # test ptype command with basic C types
147 # I've commented most of this out because it duplicates tests in whatis.exp.
148 # I've just left in a token test or 2 which is designed to test that ptype
149 # acts like whatis for basic types. If it is thought to be necessary to
150 # test both whatis and ptype for all the types, the tests should be
151 # merged into whatis.exp, or else maintenance will be a royal pain -kingdon
152 #setup_xfail "mips-sgi-*"
153 #send "ptype v_char\n"
155 # -re "type = char.*$gdb_prompt $" { pass "ptype char" }
156 # -re ".*$gdb_prompt $" { fail "ptype char" }
157 # timeout { fail "(timeout) ptype char" }
161 #setup_xfail "mips-*-*"
162 #send "ptype v_signed_char\n"
164 # -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
165 # -re ".*$gdb_prompt $" { fail "ptype signed char" }
166 # timeout { fail "(timeout) ptype signed char" }
170 #send "ptype v_unsigned_char\n"
172 # -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
173 # -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
174 # timeout { fail "(timeout) ptype unsigned char" }
177 gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
179 #send "ptype v_signed_short\n"
181 # -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
182 # -re ".*$gdb_prompt $" { fail "ptype signed short" }
183 # timeout { fail "(timeout) ptype signed short" }
187 #send "ptype v_unsigned_short\n"
189 # -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
190 # -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
191 # timeout { fail "(timeout) ptype unsigned short" }
195 gdb_test "ptype v_int" "type = int.*" "ptype int"
197 #send "ptype v_signed_int\n"
199 # -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
200 # -re ".*$gdb_prompt $" { fail "ptype signed int" }
201 # timeout { fail "(timeout) ptype signed int" }
205 #send "ptype v_unsigned_int\n"
207 # -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
208 # -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
209 # timeout { fail "(timeout) ptype unsigned int" }
213 #send "ptype v_long\n"
215 # -re "type = long.*$gdb_prompt $" { pass "ptype long" }
216 # -re ".*$gdb_prompt $" { fail "ptype long" }
217 # timeout { fail "(timeout) ptype long" }
221 #send "ptype v_signed_long\n"
223 # -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
224 # -re ".*$gdb_prompt $" { fail "ptype signed long" }
225 # timeout { fail "(timeout) ptype signed long" }
229 #send "ptype v_unsigned_long\n"
231 # -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
232 # -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
233 # timeout { fail "(timeout) ptype unsigned long" }
237 #send "ptype v_float\n"
239 # -re "type = float.*$gdb_prompt $" { pass "ptype float" }
240 # -re ".*$gdb_prompt $" { fail "ptype float" }
241 # timeout { fail "(timeout) ptype float" }
245 #send "ptype v_double\n"
247 # -re "type = double.*$gdb_prompt $" { pass "ptype double" }
248 # -re ".*$gdb_prompt $" { fail "ptype double" }
249 # timeout { fail "(timeout) ptype double" }
254 # test ptype command with arrays
256 #setup_xfail "mips-sgi-*"
257 #send "ptype v_char_array\n"
259 # -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
260 # -re ".*$gdb_prompt $" { fail "ptype char array" }
261 # timeout { fail "(timeout) ptype char array" }
265 #setup_xfail "mips-*-*"
266 #send "ptype v_signed_char_array\n"
268 # -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
269 # -re ".*$gdb_prompt $" { fail "ptype signed char array" }
270 # timeout { fail "(timeout) ptype signed char array" }
274 #send "ptype v_unsigned_char_array\n"
276 # -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
277 # -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
278 # timeout { fail "(timeout) ptype unsigned char array" }
283 #send "ptype v_int_array\n"
285 # -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
286 # -re ".*$gdb_prompt $" { fail "ptype int array" }
287 # timeout { fail "(timeout) ptype int array" }
291 #send "ptype v_signed_int_array\n"
293 # -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
294 # -re ".*$gdb_prompt $" { fail "ptype signed int array" }
295 # timeout { fail "(timeout) ptype signed int array" }
299 #send "ptype v_unsigned_int_array\n"
301 # -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
302 # -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
303 # timeout { fail "(timeout) ptype unsigned int array" }
307 #send "ptype v_long_array\n"
309 # -re "type = (long|int|long int) .2..*$gdb_prompt $" {
310 # pass "ptype long array" }
311 # -re ".*$gdb_prompt $" { fail "ptype long array" }
312 # timeout { fail "(timeout) ptype long array" }
316 #send "ptype v_signed_long_array\n"
318 # -re "type = (long|int|long int) .2..*$gdb_prompt $" {
319 # pass "ptype signed long array" }
320 # -re ".*$gdb_prompt $" { fail "ptype signed long array" }
321 # timeout { fail "(timeout) ptype signed long array" }
325 #send "ptype v_unsigned_long_array\n"
327 # -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
328 # -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
329 # timeout { fail "(timeout) ptype unsigned long array" }
333 #send "ptype v_float_array\n"
335 # -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
336 # -re ".*$gdb_prompt $" { fail "ptype float array" }
337 # timeout { fail "(timeout) ptype float array" }
341 #send "ptype v_double_array\n"
343 # -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
344 # -re ".*$gdb_prompt $" { fail "ptype double array" }
345 # timeout { fail "(timeout) ptype double array" }
349 if {!$gcc_compiled} { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
350 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
352 gdb_test "ptype pv_char_array" "type = (|unsigned )char \\(\\*\\)\\\[0?\\\]"
356 ## test ptype command with pointers
358 #setup_xfail "mips-sgi-*"
359 #send "ptype v_char_pointer\n"
361 # -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
362 # -re ".*$gdb_prompt $" { fail "ptype char pointer" }
363 # timeout { fail "(timeout) ptype char pointer" }
367 #setup_xfail "mips-*-*"
368 #send "ptype v_signed_char_pointer\n"
370 # -re "type = (|signed )char \*.*$gdb_prompt $"
371 # { pass "ptype signed char pointer" }
372 # -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
373 # timeout { fail "(timeout) ptype signed char pointer" }
377 #send "ptype v_unsigned_char_pointer\n"
379 # -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
380 # -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
381 # timeout { fail "(timeout) ptype unsigned char pointer" }
385 #send "ptype v_short_pointer\n"
387 # -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
388 # -re ".*$gdb_prompt $" { fail "ptype short pointer" }
389 # timeout { fail "(timeout) ptype short pointer" }
393 #send "ptype v_signed_short_pointer\n"
395 # -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
396 # -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
397 # timeout { fail "(timeout) ptype signed short pointer" }
401 #send "ptype v_unsigned_short_pointer\n"
403 # -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
404 # -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
405 # timeout { fail "(timeout) ptype unsigned short pointer" }
409 #send "ptype v_int_pointer\n"
411 # -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
412 # -re ".*$gdb_prompt $" { fail "ptype int pointer" }
413 # timeout { fail "(timeout) ptype int pointer" }
417 #send "ptype v_signed_int_pointer\n"
419 # -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
420 # -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
421 # timeout { fail "(timeout) ptype signed int pointer" }
425 #send "ptype v_unsigned_int_pointer\n"
427 # -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
428 # -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
429 # timeout { fail "(timeout) ptype unsigned int pointer" }
433 #send "ptype v_long_pointer\n"
435 # -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
436 # -re ".*$gdb_prompt $" { fail "ptype long pointer" }
437 # timeout { fail "(timeout) ptype long pointer" }
441 #send "ptype v_signed_long_pointer\n"
443 # -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
444 # -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
445 # timeout { fail "(timeout) ptype signed long pointer" }
449 #send "ptype v_unsigned_long_pointer\n"
451 # -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
452 # -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
453 # timeout { fail "(timeout) ptype unsigned long pointer" }
457 #send "ptype v_float_pointer\n"
459 # -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
460 # -re ".*$gdb_prompt $" { fail "ptype float pointer" }
461 # timeout { fail "(timeout) ptype float pointer" }
465 #send "ptype v_double_pointer\n"
467 # -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
468 # -re ".*$gdb_prompt $" { fail "ptype double pointer" }
469 # timeout { fail "(timeout) ptype double pointer" }
473 # test ptype command with nested structure and union
475 gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\]+\
476 .*int outer_int;.*\[\r\n\]+\
477 .*(struct|) inner_struct inner_struct_instance;.*\[\r\n\]+\
478 .*(union|) inner_union inner_union_instance;.*\[\r\n\]+\
479 .*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
481 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"
483 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"
485 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"
487 gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int"
489 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 #2"
491 gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int"
493 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"
495 # Print the type description of variable the_highest, and verify that
496 # the type description for the fields whose type is anonymous are
497 # correctly printed (at nesting level 1 and 2).
499 gdb_test "ptype the_highest" \
500 "type = struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} anonymous_level_1;.*\[\r\n\]}.*"
502 # Print the type descrption for one of the fields of variable the_highest.
503 # The purpose is to verify that the type of a field that was printed above
504 # as "struct {...}" is now printed in a more descriptive way (because the
505 # nesting level is now one level less).
507 gdb_test "ptype the_highest.anonymous_level_1" \
508 "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
509 "ptype the_highest.anonymous_level_1"
513 # Print the type of the identifier ID, and check the response:
514 # - Expect to see PROTOTYPED as the type. PROTOTYPED is not a regular
515 # expression; it's a literal string.
516 # - If we instead see the unprototyped type PLAIN, and we're using STABS
517 # generated by GCC, that's an xfail; as of 9 Feb 2002, GCC never emits
518 # prototyped function types in STABS. Like PROTOTYPED, PLAIN is a
519 # literal string, not a regular expression.
520 # - If we see OVERPROTOTYPED, it's an xfail for RealView; RealView
521 # does not distinguish prototyped and unprototyped functions, and
522 # GDB defaults to prototyped.
523 # - Otherwise, it's a failure.
524 proc ptype_maybe_prototyped { id prototyped plain { overprototyped "NO-MATCH" } } {
528 # Turn the arguments, which are literal strings, into
529 # regular expressions by quoting any special characters they contain.
530 foreach var { prototyped plain overprototyped } {
531 eval "set val \$$var"
532 regsub -all "\[\]\[*()\]" $val "\\\\&" val
533 regsub -all "short int" $val "short( int)?" val
534 regsub -all "long int" $val "long( int)?" val
535 eval "set $var \$val"
538 gdb_test_multiple "ptype $id" "ptype $id" {
539 -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
542 -re "type = $plain\[\r\n\]+$gdb_prompt $" {
543 if {$gcc_compiled} { setup_xfail_format "stabs" }
544 fail "ptype $id (compiler doesn't emit prototyped types)"
546 -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
547 if { [test_compiler_info "armcc-*"] } {
550 fail "ptype $id (compiler doesn't emit unprototyped types)"
555 ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
557 ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \
559 ptype_maybe_prototyped "new_fptr" "double (*)(void)" "double (*)()"
560 ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
561 ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
563 ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(void), int)" \
565 "int (*)(int (*)(void), int (*)(void), int)"
566 ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
568 ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
569 "int (*(*(*)())())()"
571 # Test printing type of typedefs in different scopes, with same name
572 # but different type.
574 gdb_test "list intfoo" ".*"
575 gdb_test "ptype foo" "type = int" "ptype foo typedef after first list of intfoo"
576 gdb_test "list charfoo" ".*"
577 gdb_test "ptype foo" "type = char" "ptype foo typedef after first list of charfoo"
578 gdb_test "list intfoo" ".*" "second list intfoo"
579 gdb_test "ptype foo" "type = int" "ptype foo typedef after second list of intfoo"
580 gdb_test "list charfoo" ".*" "second list charfoo"
581 gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charfoo"
583 # Test printing type of string constants and array constants, but
584 # requires a running process. These call malloc, and can take a long
585 # time to execute over a slow serial link, so increase the timeout.
589 if [target_info exists gdb,cannot_call_functions] {
590 unsupported "this target can not call functions"
594 # We need to up this because this can be really slow on some boards.
595 # (malloc() is called as part of the test).
596 set prev_timeout $timeout
599 gdb_test "ptype \"abc\"" "type = char \\\[4\\\]"
600 gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]"
601 gdb_test "ptype {0,1,2}" "type = int \\\[3\\\]"
602 gdb_test "ptype {(long)0,(long)1,(long)2}" "type = long \\\[3\\\]"
603 gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]"
604 gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]"
605 gdb_test "ptype {4,5,6}\[2\]" "type = int"
606 gdb_test "ptype *&{4,5,6}\[1\]" "Attempt to take address of value not located in memory."
608 set timeout $prev_timeout
610 # Test ptype of user register
611 gdb_test "ptype \$pc" "void \\(\\*\\)\\(\\)"