diff options
author | Jiong Wang <jiong.wang@arm.com> | 2015-07-01 08:51:49 +0000 |
---|---|---|
committer | Jiong Wang <jiwang@gcc.gnu.org> | 2015-07-01 08:51:49 +0000 |
commit | 8997ef1850cee602e321210e23c85af6b85bccc0 (patch) | |
tree | 15e878c59cfd624060a284bd135d86a89437280b /gcc/testsuite | |
parent | 34ecdb0f20498d3cdde1a5be9614c2820cc4688f (diff) | |
download | gcc-8997ef1850cee602e321210e23c85af6b85bccc0.zip gcc-8997ef1850cee602e321210e23c85af6b85bccc0.tar.gz gcc-8997ef1850cee602e321210e23c85af6b85bccc0.tar.bz2 |
[AArch64] Restrict pic-small.c by new test directive
2015-07-01 Jiong Wang <jiong.wang@arm.com>
gcc/
* doc/sourcebuild.texi (AArch64-specific attributes): New subsection.
Document "aarch64_small_fpic".
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_aarch64_small_fpic): New function.
* gcc.target/aarch64/pic-small.c: Restrict this test under
check_effective_target_aarch64_small_fpic.
From-SVN: r225232
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/pic-small.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 20 |
3 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8d53a61..8f76813 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-07-01 Jiong Wang <jiong.wang@arm.com> + + * lib/target-supports.exp (check_effective_target_aarch64_small_fpic): New function. + * gcc.target/aarch64/pic-small.c: Restrict this test under + check_effective_target_aarch64_small_fpic. + 2015-07-01 Eric Botcazou <ebotcazou@adacore.com> * gfortran.dg/gomp/pr66633.f90: New test. diff --git a/gcc/testsuite/gcc.target/aarch64/pic-small.c b/gcc/testsuite/gcc.target/aarch64/pic-small.c index 874f81b..282e4d0 100644 --- a/gcc/testsuite/gcc.target/aarch64/pic-small.c +++ b/gcc/testsuite/gcc.target/aarch64/pic-small.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target aarch64_small_fpic } */ /* { dg-options "-O2 -fpic -fno-inline --save-temps" } */ void abort (); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f0c209f..fc05e84 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -937,6 +937,26 @@ proc check_effective_target_fpic { } { return 0 } +# On AArch64, if -fpic is not supported, then we will fall back to -fPIC +# silently. So, we can't rely on above "check_effective_target_fpic" as it +# assumes compiler will give warning if -fpic not supported. Here we check +# whether binutils supports those new -fpic relocation modifiers, and assume +# -fpic is supported if there is binutils support. GCC configuration will +# enable -fpic for AArch64 in this case. +# +# "check_effective_target_aarch64_small_fpic" is dedicated for checking small +# memory model -fpic relocation types. + +proc check_effective_target_aarch64_small_fpic { } { + if { [istarget aarch64*-*-*] } { + return [check_no_compiler_messages aarch64_small_fpic object { + void foo (void) { asm ("ldr x0, [x2, #:gotpage_lo15:globalsym]"); } + }] + } else { + return 0 + } +} + # Return 1 if -shared is supported, as in no warnings or errors # emitted, 0 otherwise. |