1 # Copyright 1988-2019 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 # Create and source the file that provides information about the compiler
30 # used to compile the test case.
31 if [get_compiler_info] {
35 # Test ptype of unnamed enumeration members before any action causes
36 # the partial symbol table to be expanded to full symbols. This fails
37 # with stabs compilers which fail to use a nameless stab (such as
38 # pre-2.4.5 versions of gcc and most non-gcc compilers).
40 gdb_test_multiple "ptype red1" "ptype unnamed enumeration member" {
41 -re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $" {
42 # The workaround is in effect. As this is a compiler, not GDB,
43 # bug, we'll make it a PASS but perhaps it should be an XFAIL.
44 pass "ptype unnamed enumeration member (worked around)"
46 -re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $" {
47 pass "ptype unnamed enumeration member"
52 # test ptype command with structures
54 # Here and elsewhere, we accept
55 # "long", "long int", or "int" for long variables (whatis.exp already
56 # has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
57 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"
60 # Test the equivalence between '.' and '->' for struct member references.
62 if [gdb_test "ptype v_struct1.v_float_member" "type = float"]<0 then {
65 if [gdb_test "ptype v_struct1->v_float_member" "type = float"]<0 then {
68 if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then {
71 if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then {
76 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
77 # which isn't defined.
79 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"
82 # test ptype command with unions
84 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"
86 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
87 # which isn't defined.
88 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"
91 # test ptype command with enums
94 gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration"
96 gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration"
100 # test ptype command with enums as typedef
102 gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
104 # And check that whatis shows the name, not "enum {...}".
105 # This probably fails for all DWARF 1 cases, so assume so for now. -fnf
106 # The problem with xlc is that the stabs look like
107 # :t51=eFALSE:0,TRUE:1,;
110 # GDB's behavior is correct; the type which the variable is defined
111 # as (51) doesn't have a name. Only 55 has a name.
113 if {!$gcc_compiled} {
114 setup_xfail "rs6000-*-*" "i*86-*-sysv4*"
115 setup_xfail "hppa*-*-*" CLLbs14773
118 # For get_debug_format to do its job, we need to have a current source file.
119 gdb_test "list main" ".*"
121 gdb_test "whatis v_boolean" "type = (enum |)boolean" \
122 "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
124 # Same thing with struct and union.
125 gdb_test "ptype t_struct3" "type = struct (t_struct3 |)\{.*
126 *double v_double_member;.*
127 *int v_int_member;.*\}" "printing typedef'd struct"
129 gdb_test "ptype t_union3" "type = union (t_union3 |)\{.*
130 *double v_double_member;.*
131 *int v_int_member;.*\}" "printing typedef'd union"
133 gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype named typedef'd enumf'd enum"
136 # test ptype command with out-of-order enum values
138 gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration"
141 # test ptype command with a named enum's value
143 gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member"
145 gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2"
148 # test ptype command with basic C types
150 # I've commented most of this out because it duplicates tests in whatis.exp.
151 # I've just left in a token test or 2 which is designed to test that ptype
152 # acts like whatis for basic types. If it is thought to be necessary to
153 # test both whatis and ptype for all the types, the tests should be
154 # merged into whatis.exp, or else maintenance will be a royal pain -kingdon
155 #setup_xfail "mips-sgi-*"
156 #send "ptype v_char\n"
158 # -re "type = char.*$gdb_prompt $" { pass "ptype char" }
159 # -re ".*$gdb_prompt $" { fail "ptype char" }
160 # timeout { fail "(timeout) ptype char" }
164 #setup_xfail "mips-*-*"
165 #send "ptype v_signed_char\n"
167 # -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
168 # -re ".*$gdb_prompt $" { fail "ptype signed char" }
169 # timeout { fail "(timeout) ptype signed char" }
173 #send "ptype v_unsigned_char\n"
175 # -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
176 # -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
177 # timeout { fail "(timeout) ptype unsigned char" }
180 gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
182 #send "ptype v_signed_short\n"
184 # -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
185 # -re ".*$gdb_prompt $" { fail "ptype signed short" }
186 # timeout { fail "(timeout) ptype signed short" }
190 #send "ptype v_unsigned_short\n"
192 # -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
193 # -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
194 # timeout { fail "(timeout) ptype unsigned short" }
198 gdb_test "ptype v_int" "type = int.*" "ptype int"
200 #send "ptype v_signed_int\n"
202 # -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
203 # -re ".*$gdb_prompt $" { fail "ptype signed int" }
204 # timeout { fail "(timeout) ptype signed int" }
208 #send "ptype v_unsigned_int\n"
210 # -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
211 # -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
212 # timeout { fail "(timeout) ptype unsigned int" }
216 #send "ptype v_long\n"
218 # -re "type = long.*$gdb_prompt $" { pass "ptype long" }
219 # -re ".*$gdb_prompt $" { fail "ptype long" }
220 # timeout { fail "(timeout) ptype long" }
224 #send "ptype v_signed_long\n"
226 # -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
227 # -re ".*$gdb_prompt $" { fail "ptype signed long" }
228 # timeout { fail "(timeout) ptype signed long" }
232 #send "ptype v_unsigned_long\n"
234 # -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
235 # -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
236 # timeout { fail "(timeout) ptype unsigned long" }
240 #send "ptype v_float\n"
242 # -re "type = float.*$gdb_prompt $" { pass "ptype float" }
243 # -re ".*$gdb_prompt $" { fail "ptype float" }
244 # timeout { fail "(timeout) ptype float" }
248 #send "ptype v_double\n"
250 # -re "type = double.*$gdb_prompt $" { pass "ptype double" }
251 # -re ".*$gdb_prompt $" { fail "ptype double" }
252 # timeout { fail "(timeout) ptype double" }
257 # test ptype command with arrays
259 #setup_xfail "mips-sgi-*"
260 #send "ptype v_char_array\n"
262 # -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
263 # -re ".*$gdb_prompt $" { fail "ptype char array" }
264 # timeout { fail "(timeout) ptype char array" }
268 #setup_xfail "mips-*-*"
269 #send "ptype v_signed_char_array\n"
271 # -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
272 # -re ".*$gdb_prompt $" { fail "ptype signed char array" }
273 # timeout { fail "(timeout) ptype signed char array" }
277 #send "ptype v_unsigned_char_array\n"
279 # -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
280 # -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
281 # timeout { fail "(timeout) ptype unsigned char array" }
286 #send "ptype v_int_array\n"
288 # -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
289 # -re ".*$gdb_prompt $" { fail "ptype int array" }
290 # timeout { fail "(timeout) ptype int array" }
294 #send "ptype v_signed_int_array\n"
296 # -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
297 # -re ".*$gdb_prompt $" { fail "ptype signed int array" }
298 # timeout { fail "(timeout) ptype signed int array" }
302 #send "ptype v_unsigned_int_array\n"
304 # -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
305 # -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
306 # timeout { fail "(timeout) ptype unsigned int array" }
310 #send "ptype v_long_array\n"
312 # -re "type = (long|int|long int) .2..*$gdb_prompt $" {
313 # pass "ptype long array" }
314 # -re ".*$gdb_prompt $" { fail "ptype long array" }
315 # timeout { fail "(timeout) ptype long array" }
319 #send "ptype v_signed_long_array\n"
321 # -re "type = (long|int|long int) .2..*$gdb_prompt $" {
322 # pass "ptype signed long array" }
323 # -re ".*$gdb_prompt $" { fail "ptype signed long array" }
324 # timeout { fail "(timeout) ptype signed long array" }
328 #send "ptype v_unsigned_long_array\n"
330 # -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
331 # -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
332 # timeout { fail "(timeout) ptype unsigned long array" }
336 #send "ptype v_float_array\n"
338 # -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
339 # -re ".*$gdb_prompt $" { fail "ptype float array" }
340 # timeout { fail "(timeout) ptype float array" }
344 #send "ptype v_double_array\n"
346 # -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
347 # -re ".*$gdb_prompt $" { fail "ptype double array" }
348 # timeout { fail "(timeout) ptype double array" }
352 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
353 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
355 gdb_test "ptype pv_char_array" "type = (|unsigned )char \\(\\*\\)\\\[0?\\\]"
359 ## test ptype command with pointers
361 #setup_xfail "mips-sgi-*"
362 #send "ptype v_char_pointer\n"
364 # -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
365 # -re ".*$gdb_prompt $" { fail "ptype char pointer" }
366 # timeout { fail "(timeout) ptype char pointer" }
370 #setup_xfail "mips-*-*"
371 #send "ptype v_signed_char_pointer\n"
373 # -re "type = (|signed )char \*.*$gdb_prompt $"
374 # { pass "ptype signed char pointer" }
375 # -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
376 # timeout { fail "(timeout) ptype signed char pointer" }
380 #send "ptype v_unsigned_char_pointer\n"
382 # -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
383 # -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
384 # timeout { fail "(timeout) ptype unsigned char pointer" }
388 #send "ptype v_short_pointer\n"
390 # -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
391 # -re ".*$gdb_prompt $" { fail "ptype short pointer" }
392 # timeout { fail "(timeout) ptype short pointer" }
396 #send "ptype v_signed_short_pointer\n"
398 # -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
399 # -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
400 # timeout { fail "(timeout) ptype signed short pointer" }
404 #send "ptype v_unsigned_short_pointer\n"
406 # -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
407 # -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
408 # timeout { fail "(timeout) ptype unsigned short pointer" }
412 #send "ptype v_int_pointer\n"
414 # -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
415 # -re ".*$gdb_prompt $" { fail "ptype int pointer" }
416 # timeout { fail "(timeout) ptype int pointer" }
420 #send "ptype v_signed_int_pointer\n"
422 # -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
423 # -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
424 # timeout { fail "(timeout) ptype signed int pointer" }
428 #send "ptype v_unsigned_int_pointer\n"
430 # -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
431 # -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
432 # timeout { fail "(timeout) ptype unsigned int pointer" }
436 #send "ptype v_long_pointer\n"
438 # -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
439 # -re ".*$gdb_prompt $" { fail "ptype long pointer" }
440 # timeout { fail "(timeout) ptype long pointer" }
444 #send "ptype v_signed_long_pointer\n"
446 # -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
447 # -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
448 # timeout { fail "(timeout) ptype signed long pointer" }
452 #send "ptype v_unsigned_long_pointer\n"
454 # -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
455 # -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
456 # timeout { fail "(timeout) ptype unsigned long pointer" }
460 #send "ptype v_float_pointer\n"
462 # -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
463 # -re ".*$gdb_prompt $" { fail "ptype float pointer" }
464 # timeout { fail "(timeout) ptype float pointer" }
468 #send "ptype v_double_pointer\n"
470 # -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
471 # -re ".*$gdb_prompt $" { fail "ptype double pointer" }
472 # timeout { fail "(timeout) ptype double pointer" }
476 # test ptype command with nested structure and union
478 gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\]+\
479 .*int outer_int;.*\[\r\n\]+\
480 .*(struct|) inner_struct inner_struct_instance;.*\[\r\n\]+\
481 .*(union|) inner_union inner_union_instance;.*\[\r\n\]+\
482 .*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
484 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"
486 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"
488 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"
490 gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int"
492 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"
494 gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int"
496 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"
498 # Print the type description of variable the_highest, and verify that
499 # the type description for the fields whose type is anonymous are
500 # correctly printed (at nesting level 1 and 2).
502 gdb_test "ptype the_highest" \
503 "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\]}.*" \
506 # Print the type descrption for one of the fields of variable the_highest.
507 # The purpose is to verify that the type of a field that was printed above
508 # as "struct {...}" is now printed in a more descriptive way (because the
509 # nesting level is now one level less).
511 gdb_test "ptype the_highest.anonymous_level_1" \
512 "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
517 # Print the type of the identifier ID, and check the response:
518 # - Expect to see PROTOTYPED as the type. PROTOTYPED is not a regular
519 # expression; it's a literal string.
520 # - If we instead see the unprototyped type PLAIN, and we're using STABS
521 # generated by GCC, that's an xfail; as of 9 Feb 2002, GCC never emits
522 # prototyped function types in STABS. Like PROTOTYPED, PLAIN is a
523 # literal string, not a regular expression.
524 # - If we see OVERPROTOTYPED, it's an xfail for RealView; RealView
525 # does not distinguish prototyped and unprototyped functions, and
526 # GDB defaults to prototyped.
527 # - Otherwise, it's a failure.
528 proc ptype_maybe_prototyped { id prototyped plain { overprototyped "NO-MATCH" } } {
532 # Turn the arguments, which are literal strings, into
533 # regular expressions by quoting any special characters they contain.
534 foreach var { prototyped plain overprototyped } {
535 eval "set val \$$var"
536 regsub -all "\[\]\[*()\]" $val "\\\\&" val
537 regsub -all "short int" $val "short( int)?" val
538 regsub -all "long int" $val "long( int)?" val
539 eval "set $var \$val"
542 gdb_test_multiple "ptype $id" "ptype $id" {
543 -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
546 -re "type = $plain\[\r\n\]+$gdb_prompt $" {
547 if {$gcc_compiled} { setup_xfail_format "stabs" }
548 fail "ptype $id (compiler doesn't emit prototyped types)"
550 -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
551 if { [test_compiler_info "armcc-*"] } {
554 fail "ptype $id (compiler doesn't emit unprototyped types)"
559 ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
561 ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \
563 ptype_maybe_prototyped "new_fptr" "double (*)(void)" "double (*)()"
564 ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
565 ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
567 ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(void), int)" \
569 "int (*)(int (*)(void), int (*)(void), int)"
570 ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
572 ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
573 "int (*(*(*)())())()"
575 # Test printing type of typedefs in different scopes, with same name
576 # but different type.
578 gdb_test "list intfoo" ".*"
579 gdb_test "ptype foo" "type = int" "ptype foo typedef after first list of intfoo"
580 gdb_test "list charfoo" ".*"
581 gdb_test "ptype foo" "type = char" "ptype foo typedef after first list of charfoo"
582 gdb_test "list intfoo" ".*"
583 gdb_test "ptype foo" "type = int" "ptype foo typedef after second list of intfoo"
584 gdb_test "list charfoo" ".*"
585 gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charfoo"
587 # Test printing type of string constants and array constants, but
588 # requires a running process. These call malloc, and can take a long
589 # time to execute over a slow serial link, so increase the timeout.
591 if [runto_main] then {
593 if [target_info exists gdb,cannot_call_functions] {
594 unsupported "this target can not call functions"
598 # We need to up this because this can be really slow on some boards.
599 # (malloc() is called as part of the test).
600 set prev_timeout $timeout
603 gdb_test "ptype \"abc\"" "type = char \\\[4\\\]"
604 gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]"
605 gdb_test "ptype {0,1,2}" "type = int \\\[3\\\]"
606 gdb_test "ptype {(long)0,(long)1,(long)2}" "type = long \\\[3\\\]"
607 gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]"
608 gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]"
609 gdb_test "ptype {4,5,6}\[2\]" "type = int"
610 gdb_test "ptype *&{4,5,6}\[1\]" "Attempt to take address of value not located in memory."
612 set timeout $prev_timeout
614 # Test ptype of user register
615 gdb_test "ptype \$pc" "void \\(\\*\\)\\(\\)" "ptype \$pc"