[patch] testsuite: XFAIL gdb.base/enumval.exp for GCC <= 4.6

Jan Kratochvil jan.kratochvil@redhat.com
Mon Oct 15 12:38:00 GMT 2012


Hi,

Sergio has found this testcase fails when the (GCC) compiler is both old and
the compiler is based on 32-bit host (-m32 testsuite run on 64-bit host works).

It could be handled better, such as providing precompiled .S file or at least
limiting the XFAILs to 32-bit hosts; but when it is already fixed in stable
GCC-4.7+ I have made it simple.

Regards,
Jan


gdb/testsuite/
2012-10-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/enumval.exp (print e, print f, print K): XFAIL on GCC <= 4.6.

diff --git a/gdb/testsuite/gdb.base/enumval.exp b/gdb/testsuite/gdb.base/enumval.exp
index fa41096..cc1d11b 100644
--- a/gdb/testsuite/gdb.base/enumval.exp
+++ b/gdb/testsuite/gdb.base/enumval.exp
@@ -24,8 +24,50 @@ if { [prepare_for_testing enumval.exp "enumval" "" {debug}] } {
 }
 
 # Check the real contents.
-gdb_test "print e" "= J"
-gdb_test "print f" "= K"
+
+set test "print e"
+gdb_test_multiple $test $test {
+    -re " = J\r\n$gdb_prompt $" {
+	pass $test
+    }
+    -re " = 4294967295\r\n$gdb_prompt $" {
+	if {[test_compiler_info {gcc-[0-3]-*}]
+	    || [test_compiler_info {gcc-4-[0-6]-*}]} {
+	    xfail $test
+	} else {
+	    fail $test
+	}
+    }
+}
+
+set test "print f"
+gdb_test_multiple $test $test {
+    -re " = K\r\n$gdb_prompt $" {
+	pass $test
+    }
+    -re " = -1152921504606846976\r\n$gdb_prompt $" {
+	if {[test_compiler_info {gcc-[0-3]-*}]
+	    || [test_compiler_info {gcc-4-[0-6]-*}]} {
+	    xfail $test
+	} else {
+	    fail $test
+	}
+    }
+}
 
 gdb_test "print J" "= J"
-gdb_test "print K" "= K"
+
+set test "print K"
+gdb_test_multiple $test $test {
+    -re " = K\r\n$gdb_prompt $" {
+	pass $test
+    }
+    -re " = <optimized out>\r\n$gdb_prompt $" {
+	if {[test_compiler_info {gcc-[0-3]-*}]
+	    || [test_compiler_info {gcc-4-[0-6]-*}]} {
+	    xfail $test
+	} else {
+	    fail $test
+	}
+    }
+}



More information about the Gdb-patches mailing list