* lib/target-supports.exp (add_options_for_bind_pic_locally): New.
* gcc.dg/tree-ssa/ipa-cp-1.c: Bind pic locally.
From-SVN: r152857
+2009-10-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * lib/target-supports.exp (add_options_for_bind_pic_locally): New.
+ * gcc.dg/tree-ssa/ipa-cp-1.c: Bind pic locally.
+
2009-10-15 Richard Guenther <rguenther@suse.de>
PR lto/41669
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
+/* { dg-add-options bind_pic_locally } */
+
int
very_long_function(int a)
{
return $flags
}
+# Add to FLAGS the flags needed to enable functions to bind locally
+# when using pic/PIC passes in the testsuite.
+
+proc add_options_for_bind_pic_locally { flags } {
+ if {[check_no_compiler_messages using_pic2 assembly {
+ #if __PIC__ != 2
+ #error FOO
+ #endif
+ }]} {
+ return "$flags -fPIE"
+ }
+ if {[check_no_compiler_messages using_pic1 assembly {
+ #if __PIC__ != 1
+ #error FOO
+ #endif
+ }]} {
+ return "$flags -fpie"
+ }
+
+ return $flags
+}
+
# Return 1 if the target provides a full C99 runtime.
proc check_effective_target_c99_runtime { } {