# 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 {
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"
}
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)" \