diff mbox

[testsuite] Skip gcc.c-torture/execute/960321-1.c on Solaris 2/x64 with Sun as

Message ID yddbpb4v0mc.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth June 21, 2010, 3:58 p.m. UTC
Jason Merrill <jason@redhat.com> writes:

> OK.

Testing on the 4.4 branch revealed a slight addition necessary there:
c-torture.exp needs to include target-supports.exp, so
check_effective_target_ilp32 is available.  Here's the patch I've
checked into the branch.

	Rainer
diff mbox

Patch

diff -r 15986a4f1785 gcc/testsuite/gcc.c-torture/execute/960321-1.x
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.c-torture/execute/960321-1.x	Fri Jun 18 18:40:15 2010 +0200
@@ -0,0 +1,15 @@ 
+# This test fails to link on 64-bit Solaris 2/x86 due to a Sun as bug.
+if { [istarget "i?86-*-solaris2*"]
+     && ! [check_effective_target_ilp32]
+     && ! [check_effective_target_gas] } { 
+    set torture_eval_before_compile {
+        global compiler_conditional_xfail_data
+        set compiler_conditional_xfail_data {
+            "64-bit Sun as bug" \
+                { "i?86-*-solaris2*" } \
+                { "-O[1-3s]" } \
+                { "" }
+       }
+    }
+}
+return 0
diff -r 15986a4f1785 gcc/testsuite/lib/c-torture.exp
--- a/gcc/testsuite/lib/c-torture.exp	Fri Jun 18 18:31:35 2010 +0200
+++ b/gcc/testsuite/lib/c-torture.exp	Fri Jun 18 18:40:15 2010 +0200
@@ -1,4 +1,4 @@ 
-# Copyright (C) 1992-1998, 1999, 2000, 2007, 2008
+# Copyright (C) 1992-1998, 1999, 2000, 2007, 2008, 2010
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,6 +17,7 @@ 
 
 # This file was written by Rob Savoye. (rob@cygnus.com)
 
+load_lib target-supports.exp
 load_lib file-format.exp
 load_lib target-libpath.exp
 
diff -r 15986a4f1785 gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp	Fri Jun 18 18:31:35 2010 +0200
+++ b/gcc/testsuite/lib/target-supports.exp	Fri Jun 18 18:40:15 2010 +0200
@@ -2955,6 +2955,28 @@ 
     }]
 }
 
+# Return 1 if GNU as is used.
+
+proc check_effective_target_gas { } {
+    global use_gas_saved
+    global tool
+
+    if {![info exists use_gas_saved]} {
+	# Check if the as used by gcc is GNU as.
+	set gcc_as [lindex [${tool}_target_compile "-print-prog-name=as" "" "none" ""] 0]
+	# Provide /dev/null as input, otherwise gas times out reading from
+	# stdin.
+	set status [remote_exec host "$gcc_as" "-v /dev/null"]
+	set as_output [lindex $status 1]
+	if { [ string first "GNU" $as_output ] >= 0 } {
+	    set use_gas_saved 1
+	} else {
+	    set use_gas_saved 0
+	}
+    }
+    return $use_gas_saved
+}
+
 # Return 1 if the language for the compiler under test is C.
 
 proc check_effective_target_c { } {