This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] testsuite: XFAIL gdb.base/enumval.exp for GCC <= 4.6
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>
- Date: Mon, 15 Oct 2012 14:38:03 +0200
- Subject: [patch] testsuite: XFAIL gdb.base/enumval.exp for GCC <= 4.6
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
+ }
+ }
+}