[PATCH] testsuite/lib/target-supports.exp: Fix check_effective_target_lto

Ilya Verbin iverbin@gmail.com
Fri Jan 9 00:40:00 GMT 2015


Hi!

Currently check_effective_target_lto properly works only in gcc/testsuite/ dir,
since it checks for ENABLE_LTO, which is defined in gcc/configure.ac.
But it doesn't work in other subdirectories, e.g. in libgomp/testsuite/.
This patch fixes it.
make check and check-target-libgomp passed with/without --disable-lto on
x86_64-linux.  OK for trunk?


gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_lto): Check for -flto
	option support instead of ENABLE_LTO define from configure.


diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 119d2c5..4140505 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5729,11 +5729,12 @@ proc check_effective_target_gld { } {
 # (LTO) support.
 
 proc check_effective_target_lto { } {
-    global ENABLE_LTO
     if { [istarget nvptx-*-*] } {
 	return 0;
     }
-    return [info exists ENABLE_LTO]
+    return [check_no_compiler_messages lto object {
+	void foo (void) { }
+    } "-flto"]
 }
 
 # Return 1 if -mx32 -maddress-mode=short can compile, 0 otherwise.


  -- Ilya



More information about the Gcc-patches mailing list