return -1;
}
+set xfail_class_types 0
+if {[test_compiler_info {gcc-[0-3]-*}]
+ || [test_compiler_info {gcc-4-[0-4]-*}]} {
+ # The type in class is missing in older GCCs.
+ set xfail_class_types 1
+}
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug c++}] != "" } {
untested namespace.exp
return -1
gdb_test "print C::cOtherFileVar" "\\$\[0-9\].* = 319"
gdb_test "print ::C::cOtherFileVar" "\\$\[0-9\].* = 319"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "whatis C::OtherFileClass::cOtherFileClassType" "type = short"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "whatis ::C::OtherFileClass::cOtherFileClassType" "type = short"
gdb_test "print C::OtherFileClass::cOtherFileClassVar" " = 318"
}
-re "\\$\[0-9\].* = 318\r\n$gdb_prompt $" {
# Do not permit to XFAIL on recent GCCs.
- if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
+ if $xfail_class_types {
setup_xfail *-*-*
fail $test
# Unresolved means human intervention is required to determine
# Test class typedefs printing.
set expect "type = class C::OtherFileClass \{\r\n.*\r\n *typedef short cOtherFileClassType;\r\n *typedef long cOtherFileClassType2;\r\n\}"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "ptype OtherFileClass" $expect "ptype OtherFileClass typedefs"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "ptype ::C::OtherFileClass" $expect "ptype ::C::OtherFileClass typedefs"
# Some anonymous namespace tests.