Commit fc5e3cd4 by Kaveh R. Ghazi Committed by Kaveh Ghazi

target-supports.exp (add_options_for_bind_pic_locally): New.

	* 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
parent f6ee328a
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> 2009-10-15 Richard Guenther <rguenther@suse.de>
PR lto/41669 PR lto/41669
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */ /* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
/* { dg-add-options bind_pic_locally } */
int int
very_long_function(int a) very_long_function(int a)
{ {
......
...@@ -2984,6 +2984,28 @@ proc add_options_for_ieee { flags } { ...@@ -2984,6 +2984,28 @@ proc add_options_for_ieee { flags } {
return $flags 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. # Return 1 if the target provides a full C99 runtime.
proc check_effective_target_c99_runtime { } { proc check_effective_target_c99_runtime { } {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment