From dececdaa772723e625f7b1617ad8162982012ba9 Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Mon, 22 Jan 2018 10:50:20 +0000 Subject: [PATCH] [arm] Make gcc.target/arm/copysign_softfloat_1.c more robust This test has needlessly restrictive requirements. It tries to force a soft-float target and tries to run. This makes it unsupportable for any non-soft-float variant. In fact, the test can be a run-time test for any target, and only the scan-assembler tests are specific to -mfloat-abi=soft. So this patch makes the test always runnable and makes the scan-assembler checks predicable on the the new arm_sotftfloat effective target check. * doc/sourcebuild.texi (arm_softfloat): Document. * lib/target-supports.exp (check_effective_target_arm_softfloat): New procedure. * gcc.target/arm/copysign_softfloat_1.c: Allow running everywhere. Adjust scan-assembler checks for soft-float. From-SVN: r256940 --- gcc/ChangeLog | 4 ++++ gcc/doc/sourcebuild.texi | 4 ++++ gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.target/arm/copysign_softfloat_1.c | 10 +++++----- gcc/testsuite/lib/target-supports.exp | 13 +++++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0308f35d10f..f3fe4f69710 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-01-22 Kyrylo Tkachov + + * doc/sourcebuild.texi (arm_softfloat): Document. + 2018-01-21 John David Anglin PR gcc/77734 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index f0233c9cca4..69fbf6ac768 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1650,6 +1650,10 @@ ARM target adheres to the VFP and Advanced SIMD Register Arguments variant of the ABI for the ARM Architecture (as selected with @code{-mfloat-abi=hard}). +@item arm_softfloat +ARM target uses the soft-float ABI with no floating-point instructions +used whatsoever (as selected with @code{-mfloat-abi=soft}). + @item arm_hard_vfp_ok ARM target supports @code{-mfpu=vfp -mfloat-abi=hard}. Some multilibs may be incompatible with these options. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 89375610f63..a63fa4a35fc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-01-22 Kyrylo Tkachov + + * lib/target-supports.exp (check_effective_target_arm_softfloat): + New procedure. + * gcc.target/arm/copysign_softfloat_1.c: Allow running everywhere. + Adjust scan-assembler checks for soft-float. + 2018-01-21 Bill Schmidt PR target/83946 diff --git a/gcc/testsuite/gcc.target/arm/copysign_softfloat_1.c b/gcc/testsuite/gcc.target/arm/copysign_softfloat_1.c index d79d014e27c..fdbeeadc01e 100644 --- a/gcc/testsuite/gcc.target/arm/copysign_softfloat_1.c +++ b/gcc/testsuite/gcc.target/arm/copysign_softfloat_1.c @@ -1,8 +1,8 @@ /* { dg-do run } */ /* { dg-require-effective-target arm_thumb2_ok } */ -/* { dg-require-effective-target arm_soft_ok } */ -/* { dg-skip-if "skip override" { *-*-* } { "-mfloat-abi=softfp" "-mfloat-abi=hard" } { "" } } */ -/* { dg-options "-O2 -mfloat-abi=soft --save-temps" } */ +/* { dg-add-options arm_arch_v6t2 } */ +/* { dg-additional-options "-O2 --save-temps" } */ + extern void abort (void); #define N 16 @@ -42,8 +42,8 @@ main (int argc, char **argv) { int index = 0; -/* { dg-final { scan-assembler-times "bfi" 2 } } */ -/* { dg-final { scan-assembler-times "lsr" 1 } } */ +/* { dg-final { scan-assembler-times "bfi" 2 { target arm_softfloat } } } */ +/* { dg-final { scan-assembler-times "lsr" 1 { target arm_softfloat } } } */ for (index; index < N; index++) { if (__builtin_copysignf (a_f[index], b_f[index]) != c_f[index]) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index b4b6f32bf26..720914b0c4c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -4885,6 +4885,19 @@ proc check_effective_target_arm_hf_eabi { } { }] } +# Return 1 if this is an ARM target that uses the soft float ABI +# with no floating-point instructions at all (e.g. -mfloat-abi=soft). + +proc check_effective_target_arm_softfloat { } { + return [check_no_compiler_messages arm_softfloat object { + #if !defined(__SOFTFP__) + #error not soft-float EABI + #else + int dummy; + #endif + }] +} + # Return 1 if this is an ARM target supporting -mcpu=iwmmxt. # Some multilibs may be incompatible with this option. -- 2.30.2