This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Enable plugin tests only when the build and the host systems are the same
- From: Le-Chun Wu <lcwu at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, janis187 at us dot ibm dot com
- Cc: Diego Novillo <dnovillo at google dot com>, Rafael Espindola <espindola at google dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Wed, 6 May 2009 16:05:11 -0700
- Subject: [patch] Enable plugin tests only when the build and the host systems are the same
In the plugin test cases, the plugins are compiled with the host
compiler (HOSTCC). However, HOSTCC set in site.exp appears to actually
be the build->host compiler, so using the host compiler will guarantee
to work only when the build and the host system are the same. In this
patch, we check and enable the plugin tests only when the build and
host systems are the same. The patch was bootstrapped and tested on
x86_64-linux-gnu. OK for mainline?
Thanks,
Le-chun
2009-05-06 Le-Chun Wu <lcwu@google.com>
* gcc/testsuite/gcc.dg/plugin/plugin.exp: Enable plugin tests only
when the build and the host systems are the same.
* gcc/testsuite/g++.dg/plugin/plugin.exp: Likewise.
Index: gcc/testsuite/gcc.dg/plugin/plugin.exp
===================================================================
--- gcc/testsuite/gcc.dg/plugin/plugin.exp (revision 147209)
+++ gcc/testsuite/gcc.dg/plugin/plugin.exp (working copy)
@@ -21,10 +21,17 @@ load_lib gcc-dg.exp
global TESTING_IN_BUILD_TREE
global ENABLE_PLUGIN
+global host_triplet, build_triplet
-# The plugin testcases currently only work when the build tree is available.
-# Also check whether the host supports plugins.
-if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } {
+# The plugin testcases currently only work when
+# 1. the build tree is available,
+# 2. the host supports plugins,
+# 3. the build system and the host system are the same (because we use
+# HOSTCC to build plugins in the tests while gcc was built with the build
+# CC).
+if { ![info exists TESTING_IN_BUILD_TREE]
+ || ![info exists ENABLE_PLUGIN]
+ || "$host_triplet" != "$build_triplet" } {
return
}
Index: gcc/testsuite/g++.dg/plugin/plugin.exp
===================================================================
--- gcc/testsuite/g++.dg/plugin/plugin.exp (revision 147209)
+++ gcc/testsuite/g++.dg/plugin/plugin.exp (working copy)
@@ -21,10 +21,17 @@ load_lib g++-dg.exp
global TESTING_IN_BUILD_TREE
global ENABLE_PLUGIN
+global host_triplet, build_triplet
-# The plugin testcases currently only work when the build tree is available.
-# Also check whether the host supports plugins.
-if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } {
+# The plugin testcases currently only work when
+# 1. the build tree is available,
+# 2. the host supports plugins,
+# 3. the build system and the host system are the same (because we use
+# HOSTCC to build plugins in the tests while gcc was built with the build
+# CC).
+if { ![info exists TESTING_IN_BUILD_TREE]
+ || ![info exists ENABLE_PLUGIN]
+ || "$host_triplet" != "$build_triplet" } {
return
}