[ARM, testsuite] Add -mfloat-abi=hard to arm_neon_ok
authorChristophe Lyon <christophe.lyon@linaro.org>
Mon, 26 Jun 2017 09:25:55 +0000 (09:25 +0000)
committerChristophe Lyon <clyon@gcc.gnu.org>
Mon, 26 Jun 2017 09:25:55 +0000 (11:25 +0200)
2017-06-02  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_arm_neon_ok_nocache): Add flags with
-mfloat-abi=hard. Include arm_neon.h.
(check_effective_target_arm_neon_ok_no_float_abi_nocache): New.
(check_effective_target_arm_neon_ok_no_float_abi): New.
* gcc.target/arm/lto/pr65837_0.c: Require
arm_neon_ok_no_float_abi. Add -mfpu=neon to dg-lto-options.
* gcc.target/arm/lto/pr65837-attr_0.c: Require
arm_neon_ok_no_float_abi. Remove dg-suppress-ld-options.

gcc/
* doc/sourcebuild.texi (ARM-specific attributes): Document new
arm_neon_ok_no_float_abi effective target.

From-SVN: r249639

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c
gcc/testsuite/gcc.target/arm/lto/pr65837_0.c
gcc/testsuite/lib/target-supports.exp

index eb945484a55dcbaf471d6ab149dd081921e96a62..546342d907b906e1d839bcee43bf649b831e923a 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-26  Christophe Lyon  <christophe.lyon@linaro.org>
+
+       * doc/sourcebuild.texi (ARM-specific attributes): Document new
+       arm_neon_ok_no_float_abi effective target.
+
 2017-06-26  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80928
index 7f5c2cf58c40e7b2369d30c098950f0883fa157a..4136a68a615d0e2d96111d977fc9490b7012071c 100644 (file)
@@ -1582,6 +1582,12 @@ Test system supports executing NEON v2 instructions.
 ARM Target supports @code{-mfpu=neon -mfloat-abi=softfp} or compatible
 options.  Some multilibs may be incompatible with these options.
 
+@item arm_neon_ok_no_float_abi
+@anchor{arm_neon_ok_no_float_abi}
+ARM Target supports NEON with @code{-mfpu=neon}, but without any
+-mfloat-abi= option.  Some multilibs may be incompatible with this
+option.
+
 @item arm_neonv2_ok
 @anchor{arm_neonv2_ok}
 ARM Target supports @code{-mfpu=neon-vfpv4 -mfloat-abi=softfp} or compatible
index ad5ccb7dc64a5461c91658c98021a0bc54aade6e..87894bf76543ac7c6718b5932dda8a10ef8dd1dc 100644 (file)
@@ -1,3 +1,15 @@
+2017-06-26  Christophe Lyon  <christophe.lyon@linaro.org>
+
+       * lib/target-supports.exp
+       (check_effective_target_arm_neon_ok_nocache): Add flags with
+       -mfloat-abi=hard. Include arm_neon.h.
+       (check_effective_target_arm_neon_ok_no_float_abi_nocache): New.
+       (check_effective_target_arm_neon_ok_no_float_abi): New.
+       * gcc.target/arm/lto/pr65837_0.c: Require
+       arm_neon_ok_no_float_abi. Add -mfpu=neon to dg-lto-options.
+       * gcc.target/arm/lto/pr65837-attr_0.c: Require
+       arm_neon_ok_no_float_abi. Remove dg-suppress-ld-options.
+
 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/62315
index ebc5f447a08be401d3ae254d295a57ba8a7d3be2..f00480b5c02a8ade75c9ed013a57d22982969a73 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-lto-do run } */
 /* { dg-require-effective-target arm_neon_hw } */
-/* { dg-lto-options {{-flto}} } */
+/* { dg-require-effective-target arm_neon_ok_no_float_abi } */
+/* { dg-lto-options {{-flto -mfpu=neon}} } */
 
 #include "arm_neon.h"
 
index 6b2def9985d63a449f86a3be940c41375b93a7f8..5d7cea7b2e4e36a34ed0dde07677b147e1ec1903 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-lto-do run } */
 /* { dg-require-effective-target arm_neon_hw } */
+/* { dg-require-effective-target arm_neon_ok_no_float_abi } */
 /* { dg-lto-options {{-flto -mfpu=neon}} } */
-/* { dg-suppress-ld-options {-mfpu=neon} } */
 
 #include "arm_neon.h"
 
index 502986e71fba8e4f07f338bd67e31bde56fdf809..f6e24401879429c2ef1a5dc9f50ff980eafcc1f3 100644 (file)
@@ -3461,8 +3461,9 @@ proc check_effective_target_arm_neon_ok_nocache { } {
     global et_arm_neon_flags
     set et_arm_neon_flags ""
     if { [check_effective_target_arm32] } {
-       foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a"} {
+       foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a" "-mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard -march=armv7-a"} {
            if { [check_no_compiler_messages_nocache arm_neon_ok object {
+               #include <arm_neon.h>
                int dummy;
                #ifndef __ARM_NEON__
                #error not NEON
@@ -3487,6 +3488,38 @@ proc check_effective_target_arm_neon_ok { } {
                check_effective_target_arm_neon_ok_nocache]
 }
 
+# Return 1 if this is an ARM target supporting -mfpu=neon without any
+# -mfloat-abi= option.  Useful in tests where add_options is not
+# supported (such as lto tests).
+
+proc check_effective_target_arm_neon_ok_no_float_abi_nocache { } {
+    if { [check_effective_target_arm32] } {
+       foreach flags {"-mfpu=neon"} {
+           if { [check_no_compiler_messages_nocache arm_neon_ok_no_float_abi object {
+               #include <arm_neon.h>
+               int dummy;
+               #ifndef __ARM_NEON__
+               #error not NEON
+               #endif
+               /* Avoid the case where a test adds -mfpu=neon, but the toolchain is
+                  configured for -mcpu=arm926ej-s, for example.  */
+               #if __ARM_ARCH < 7 || __ARM_ARCH_PROFILE == 'M'
+               #error Architecture does not support NEON.
+               #endif
+           } "$flags"] } {
+               return 1
+           }
+       }
+    }
+
+    return 0
+}
+
+proc check_effective_target_arm_neon_ok_no_float_abi { } {
+    return [check_cached_effective_target arm_neon_ok_no_float_abi \
+               check_effective_target_arm_neon_ok_no_float_abi_nocache]
+}
+
 proc check_effective_target_arm_crc_ok_nocache { } {
     global et_arm_crc_flags
     set et_arm_crc_flags "-march=armv8-a+crc"