[PATCH] Add dg-require-linker-plugin

Richard Guenther rguenther@suse.de
Thu Jul 22 12:52:00 GMT 2010


This adds dg-require-linker-plugin support to the testsuite.  Simple now,
as the lto-plugin is installed into gcc/.  I'll add the testcase for
PR43373 as an example.  Honza - you didn't yet apply the patch to
fix the wrong-code issue of gcc.dg/lto/20100715-1_[01].c, so I won't
commit that testcase now.

Committed.

Richard.

2010-07-22  Richard Guenther  <rguenther@suse.de>

	* lib/target-supports-dg.exp (dg-require-linker-plugin): New proc.
	* lib/target-supports.exp (check_linker_plugin_available): Likewise.

	* gcc.dg/lto/20100715-1_0.c: New testcase.
	* gcc.dg/lto/20100715-1_1.c: Likewise.

	PR lto/43373
	* gcc.dg/lto/20100722-1_0.c: New testcase.

Index: gcc/testsuite/lib/target-supports-dg.exp
===================================================================
*** gcc/testsuite/lib/target-supports-dg.exp.orig	2010-07-22 13:39:23.000000000 +0200
--- gcc/testsuite/lib/target-supports-dg.exp	2010-07-22 14:17:37.000000000 +0200
*************** proc dg-require-host-local { args } {
*** 207,212 ****
--- 207,220 ----
      }
  }
  
+ proc dg-require-linker-plugin { args } {
+     set linker_plugin_available [ check_linker_plugin_available ]
+     if { $linker_plugin_available == 0 } {
+ 	upvar dg-do-what dg-do-what
+ 	set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+     }
+ }
+ 
  # Add any target-specific flags needed for accessing the given list
  # of features.  This must come after all dg-options.
  
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
*** gcc/testsuite/lib/target-supports.exp.orig	2010-07-22 13:39:23.000000000 +0200
--- gcc/testsuite/lib/target-supports.exp	2010-07-22 14:17:37.000000000 +0200
*************** proc check_effective_target_static_libgf
*** 886,891 ****
--- 886,897 ----
      } "-static"]
  }
  
+ proc check_linker_plugin_available { } {
+   return [check_no_compiler_messages_nocache linker_plugin executable {
+      int main() { return 0; }
+   } "-flto -fuse-linker-plugin"]
+ }
+ 
  # Return 1 if the target supports executing 750CL paired-single instructions, 0
  # otherwise.  Cache the result.
  
Index: gcc/testsuite/gcc.dg/lto/20100715-1_0.c
===================================================================
*** /dev/null	1970-01-01 00:00:00.000000000 +0000
--- gcc/testsuite/gcc.dg/lto/20100715-1_0.c	2010-07-22 14:17:37.000000000 +0200
***************
*** 0 ****
--- 1,15 ----
+ /* { dg-lto-do run } */
+ /* { dg-require-linker-plugin "" } */
+ /* { dg-extra-ld-options "-fuse-linker-plugin" } */
+ 
+ __attribute__ ((visibility("hidden"))) int a;
+ void abort (void);
+ extern int b(void);
+ main()
+ {
+   b();
+   if (a!=3)
+     abort ();
+   return 0;
+ }
+ 
Index: gcc/testsuite/gcc.dg/lto/20100715-1_1.c
===================================================================
*** /dev/null	1970-01-01 00:00:00.000000000 +0000
--- gcc/testsuite/gcc.dg/lto/20100715-1_1.c	2010-07-22 14:17:37.000000000 +0200
***************
*** 0 ****
--- 1,7 ----
+ /* { dg-options "-fno-lto -fno-whopr" } */
+ 
+ __attribute__ ((visibility("hidden"))) int a;
+ int b(void)
+ {
+   a=3;
+ }
Index: gcc/testsuite/gcc.dg/lto/20100722-1_0.c
===================================================================
*** /dev/null	1970-01-01 00:00:00.000000000 +0000
--- gcc/testsuite/gcc.dg/lto/20100722-1_0.c	2010-07-22 14:36:20.000000000 +0200
***************
*** 0 ****
--- 1,6 ----
+ /* { dg-lto-do run } */
+ /* { dg-require-lto-plugin "" } */
+ /* { dg-extra-ld-options "-fuse-linker-plugin" } */
+ 
+ int main() { return 0; }
+ 



More information about the Gcc-patches mailing list