import gdb-1999-06-28 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / ptype.exp
index 1ef677150e824e1197fb5b1aae95f2eb3344adf5..98d45869e87507125f579e6b8b70a6568dc3e0b5 100644 (file)
@@ -94,7 +94,7 @@ if [gdb_test "ptype v_t_struct_p->v_float_member"     "type = float"]<0 then {
 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
 # which isn't defined.
 
-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" 
+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" 
 
 #
 # test ptype command with unions
@@ -103,7 +103,7 @@ gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\]    (unsigned |
 
 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
 # which isn't defined.
-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" 
+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" 
 
 #
 # test ptype command with enums
@@ -117,7 +117,7 @@ gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "pt
 #
 # test ptype command with enums as typedef
 #
-gdb_test "ptype boolean" "type = enum \{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration" 
+gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration" 
 
 # And check that whatis shows the name, not "enum {...}".
 # This probably fails for all DWARF 1 cases, so assume so for now. -fnf
@@ -128,21 +128,23 @@ gdb_test "ptype boolean" "type = enum \{FALSE, TRUE\}.*" "ptype unnamed typedef'
 # GDB's behavior is correct; the type which the variable is defined
 # as (51) doesn't have a name.  Only 55 has a name.
 
-if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
+if {!$gcc_compiled && !$hp_aCC_compiler} {
+    setup_xfail "rs6000-*-*" "i*86-*-sysv4*" "hppa*-*-*" # CLLbs14773
+}
 setup_xfail_format "DWARF 1"
-gdb_test "whatis v_boolean" "type = boolean" \
+gdb_test "whatis v_boolean" "type = (enum |)boolean" \
   "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
 
 # Same thing with struct and union.
-gdb_test "ptype t_struct3" "type = struct \{.*
+gdb_test "ptype t_struct3" "type = struct (t_struct3 |)\{.*
  *double v_double_member;.*
  *int v_int_member;.*\}" "printing typedef'd struct"
 
-gdb_test "ptype t_union3" "type = union \{.*
+gdb_test "ptype t_union3" "type = union (t_union3 |)\{.*
  *double v_double_member;.*
  *int v_int_member;.*\}" "printing typedef'd union"
 
-gdb_test "ptype enum bvals" "type = enum bvals \{false, true\}.*" "ptype named typedef'd enumf'd enum" 
+gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype named typedef'd enumf'd enum"
 
 #
 # test ptype command with out-of-order enum values
@@ -365,6 +367,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
 
 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
 setup_xfail_format "DWARF 1"
+if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
 
 #
@@ -489,21 +492,34 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
 #
 # test ptype command with nested structure and union
 #
-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" 
+if {$hp_aCC_compiler} {
+    set outer "outer_struct::"
+    set struct ""
+    set union ""
+} else {
+    set outer ""
+    set struct "struct"
+    set union "union"
+}
+gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\]+\
+.*int outer_int;.*\[\r\n\]+\
+.*(struct|) ${outer}inner_struct inner_struct_instance;.*\[\r\n\]+\
+.*(union|) ${outer}inner_union inner_union_instance;.*\[\r\n\]+\
+.*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure" 
 
-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" 
+gdb_test "ptype ${struct} ${outer}inner_struct" "type = struct ${outer}inner_struct \{.*\[\r\n\]    int inner_int;.*\[\r\n\]    (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype inner structure" 
 
-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" 
+gdb_test "ptype ${union} ${outer}inner_union" "type = union ${outer}inner_union \{.*\[\r\n\]    int inner_union_int;.*\[\r\n\]    (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype inner union" 
 
-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" 
+gdb_test "ptype nested_su" "type = struct outer_struct \{.*\[\r\n\]    int outer_int;.*\[\r\n\]    (struct |)${outer}inner_struct inner_struct_instance;.*\[\r\n\]    (union |)${outer}inner_union inner_union_instance;.*\[\r\n\]    (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure" 
 
 gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int" 
 
-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" 
+gdb_test "ptype nested_su.inner_struct_instance" "type = struct ${outer}inner_struct \{.*\[\r\n\]    int inner_int;.*\[\r\n\]    (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype nested structure #2" 
 
 gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int" 
 
-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" 
+gdb_test "ptype nested_su.inner_union_instance" "type = union ${outer}inner_union \{.*\[\r\n\]    int inner_union_int;.*\[\r\n\]    (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype nested union" 
 
 # Test printing type of string constants and array constants, but
 # requires a running process.  These call malloc, and can take a long
This page took 0.027255 seconds and 4 git commands to generate.