* dwarf2-frame.c (dwarf2_frame_find_quirks): Use producer_is_realview.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / ptype.exp
index 43e646d0ead6ce82114940dd0e7859a1066b7af2..589be340163a5bc2403d294af97e0f5b3a753844 100644 (file)
@@ -555,15 +555,23 @@ get_debug_format
 #   generated by GCC, that's an xfail; as of 9 Feb 2002, GCC never emits
 #   prototyped function types in STABS.  Like PROTOTYPED, PLAIN is a
 #   literal string, not a regular expression.
+# - If we see OVERPROTOTYPED, it's an xfail for RealView; RealView
+#   does not distinguish prototyped and unprototyped functions, and
+#   GDB defaults to prototyped.
 # - Otherwise, it's a failure.
-proc ptype_maybe_prototyped { id prototyped plain } {
+proc ptype_maybe_prototyped { id prototyped plain { overprototyped "NO-MATCH" } } {
     global gdb_prompt
     global gcc_compiled
 
-    # Turn `prototyped' and `plain', which are literal strings, into
+    # Turn the arguments, which are literal strings, into
     # regular expressions by quoting any special characters they contain.
-    regsub -all "\[\]\[*()\]" $prototyped "\\\\&" prototyped
-    regsub -all "\[\]\[*()\]" $plain "\\\\&" plain
+    foreach var { prototyped plain overprototyped } {
+       eval "set val \$$var"
+       regsub -all "\[\]\[*()\]" $val "\\\\&" val
+       regsub -all "short int" $val "short( int)?" val
+       regsub -all "long int" $val "long( int)?" val
+       eval "set $var \$val"
+    }
 
     send_gdb "ptype $id\n"
     gdb_expect {
@@ -574,6 +582,12 @@ proc ptype_maybe_prototyped { id prototyped plain } {
             if {$gcc_compiled} { setup_xfail_format "stabs" }
             fail "ptype $id (compiler doesn't emit prototyped types)"
         }
+        -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
+            if { [test_compiler_info "armcc-*"] } {
+               setup_xfail "*-*-*"
+           }
+            fail "ptype $id (compiler doesn't emit unprototyped types)"
+        }
         -re "$gdb_prompt $" {
             fail "ptype $id"
         }
@@ -585,13 +599,15 @@ proc ptype_maybe_prototyped { id prototyped plain } {
 
 ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
                                    "int (*)()"
-ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()"
+ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \
+                                  "double (*)(void)"
 ptype_maybe_prototyped "new_fptr" "double (*)(void)" "double (*)()"
 ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
 ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
                                "int *(*)()"
 ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(void), int)" \
-                              "int (*)()"
+                              "int (*)()" \
+                              "int (*)(int (*)(void), int (*)(void), int)"
 ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
                                "int (*(*)())()"
 ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
This page took 0.025481 seconds and 4 git commands to generate.