Patchwork [x32] PATCH: Add initialize x32 support to GCC testsuite

login
register
mail settings
Submitter H.J. Lu
Date March 6, 2011, 5:59 p.m.
Message ID <20110306175922.GA18872@intel.com>
Download mbox | patch
Permalink /patch/85584/
State New
Headers show

Comments

H.J. Lu - March 6, 2011, 5:59 p.m.
Hi,

I checked in this patch to add initialize x32 support to GCC testsuite.


H.J.
----
commit 8df1dc7ee66e767006353d5358be926261080c1a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Mar 6 09:53:16 2011 -0800

    Add initialize x32 support to GCC testsuite.

Patch

diff --git a/gcc/testsuite/ChangeLog.x32 b/gcc/testsuite/ChangeLog.x32
index 22345df..e5c6bfd 100644
--- a/gcc/testsuite/ChangeLog.x32
+++ b/gcc/testsuite/ChangeLog.x32
@@ -1,3 +1,9 @@ 
+2011-03-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* go.test/go-test.exp (go-set-goarch): Check x32.
+
+	* lib/target-supports.exp (check_effective_target_x32): New.
+
 2011-03-02  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR rtl-optimization/47958
diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
index 8945b05..9202eca 100644
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -119,7 +119,8 @@  proc go-set-goarch { } {
 	}
 	"i?86-*-*" -
 	"x86_64-*-*" {
-	    if [check_effective_target_ilp32] {
+	    if { [check_effective_target_ilp32]
+		 && ![check_effective_target_x32] } {
 		set goarch "386"
 	    } else {
 		set goarch "amd64"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 36cab54..2e75e5b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1492,6 +1492,17 @@  proc check_effective_target_ilp32 { } {
     }]
 }
 
+# Return 1 if we're generating x32 code using default options, 0
+# otherwise.
+
+proc check_effective_target_x32 { } {
+    return [check_no_compiler_messages x32 object {
+	int dummy[sizeof (int) == 4
+		  && sizeof (void *) == 4
+		  && sizeof (long) == 4 ? 1 : -1] = { __x86_64__ };
+    }]
+}
+
 # Return 1 if we're generating 32-bit or larger integers using default
 # options, 0 otherwise.
 
diff --git a/libgomp/ChangeLog.x32 b/libgomp/ChangeLog.x32
index f0d2b59..eedac54 100644
--- a/libgomp/ChangeLog.x32
+++ b/libgomp/ChangeLog.x32
@@ -1,3 +1,7 @@ 
+2011-03-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* lib/libgomp.exp (libgomp_init): Don't add -march=i486 for x32.
+
 2011-02-17  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* config/linux/x86/futex.h: Check __x86_64__ instead of
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 0b0b608..8b6b9f3 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -141,7 +141,8 @@  proc libgomp_init { args } {
 
     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
-	 && [check_effective_target_ilp32] } {
+	 && [check_effective_target_ilp32]
+	 && ![check_effective_target_x32] } {
 	lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
     }