Add check_effective_target_pie

* gcc.target/i386/pie.c: New test.

	* lib/target-supports.exp (check_effective_target_pie): New.

From-SVN: r219553
This commit is contained in:
H.J. Lu 2015-01-13 20:05:41 +00:00 committed by H.J. Lu
parent 860dadcbea
commit ed4f78fae8
3 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2015-01-13 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/pie.c: New test.
* lib/target-supports.exp (check_effective_target_pie): New.
2015-01-13 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/64286

View File

@ -0,0 +1,12 @@
/* { dg-do compile { target pie } } */
/* { dg-options "-O2" } */
int foo (void);
int
main (void)
{
return foo ();
}
/* { dg-final { scan-assembler "foo@PLT" } } */

View File

@ -1080,6 +1080,16 @@ proc check_effective_target_nonpic { } {
}]
}
# Return 1 if the current multilib generates PIE by default.
proc check_effective_target_pie { } {
return [check_no_compiler_messages pie assembly {
#ifndef __PIE__
#error unsupported
#endif
}]
}
# Return 1 if the target does not use a status wrapper.
proc check_effective_target_unwrapped { } {