Revert [testsuite][ARM target attributes] Fix effective_target tests
authorChristophe Lyon <christophe.lyon@linaro.org>
Thu, 10 Dec 2015 13:11:27 +0000 (13:11 +0000)
committerChristophe Lyon <clyon@gcc.gnu.org>
Thu, 10 Dec 2015 13:11:27 +0000 (14:11 +0100)
From-SVN: r231507

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/attr-crypto.c
gcc/testsuite/gcc.target/arm/attr-neon-builtin-fail.c
gcc/testsuite/gcc.target/arm/attr-neon-fp16.c
gcc/testsuite/gcc.target/arm/attr-neon2.c
gcc/testsuite/gcc.target/arm/attr-neon3.c
gcc/testsuite/lib/target-supports.exp

index 131596c06997c5c6d7b5607c7eec54eeb7877bed..499ec0da6544aaa89ac3dfc1f20c875afdab34fa 100644 (file)
@@ -1,3 +1,31 @@
+2015-12-10  Christophe Lyon  <christophe.lyon@linaro.org>
+
+       Revert [testsuite][ARM target attributes] Fix effective_target tests
+       2015-12-08  Christophe Lyon  <christophe.lyon@linaro.org>
+
+       * lib/target-supports.exp
+       (check_effective_target_arm_vfp_ok_nocache): New.
+       (check_effective_target_arm_vfp_ok): Call the new
+       check_effective_target_arm_vfp_ok_nocache function.
+       (check_effective_target_arm_fp_ok_nocache): New.
+       (check_effective_target_arm_fp_ok): New.
+       (add_options_for_arm_fp): New.
+       (check_effective_target_arm_crypto_ok_nocache): Require
+       target_arm_v8_neon_ok instead of arm32.
+       (check_effective_target_arm_crypto_pragma_ok_nocache): New.
+       (check_effective_target_arm_crypto_pragma_ok): New.
+       (add_options_for_arm_vfp): New.
+       * gcc.target/arm/attr-crypto.c: Use arm_crypto_pragma_ok effective
+       target. Do not force -mfloat-abi=softfp, use arm_vfp effective
+       target instead.
+       * gcc.target/arm/attr-neon-builtin-fail.c: Do not force
+       -mfloat-abi=softfp, use arm_fp effective target instead.
+       * gcc.target/arm/attr-neon-fp16.c: Likewise. Remove arm_neon_ok
+       dependency.
+       * gcc.target/arm/attr-neon2.c: Do not force -mfloat-abi=softfp,
+       use arm_vfp effective target instead.
+       * gcc.target/arm/attr-neon3.c: Likewise.
+
 2015-12-10  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/specs/access1.ads: New test.
index b703fbcfdc1d788c9a346c45a92a6c0397b2eedb..1db598447cd724e5c18c645029d1a5e9cbb80fbe 100644 (file)
@@ -1,10 +1,6 @@
 /* { dg-do compile } */
-/* Make sure we can force fpu=vfp before switching using the
-   pragma.  */
-/* { dg-require-effective-target arm_vfp_ok } */
-/* { dg-require-effective-target arm_crypto_pragma_ok } */
-/* { dg-options "-O2 -march=armv8-a" } */
-/* { dg-add-options arm_vfp } */
+/* { dg-require-effective-target arm_crypto_ok } */
+/* { dg-options "-O2 -mfloat-abi=softfp" } */
 
 #pragma GCC target ("fpu=crypto-neon-fp-armv8")
 
index 05dc579f25d0169b918ee775d8df36fae4f9de47..6ac32fca166711bb0a7bc86c57e5c88b677b6dca 100644 (file)
@@ -1,9 +1,7 @@
 /* Check that calling a neon builtin from a function compiled with vfp fails.  */
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-require-effective-target arm_neon_ok } */
-/* { dg-options "-O2" } */
-/* { dg-add-options arm_fp } */
+/* { dg-options "-O2 -mfloat-abi=softfp" } */
 
 #include <arm_neon.h>
 
@@ -14,5 +12,6 @@ foo (uint8x16_t *p)
   *p = vmovq_n_u8 (3); /* { dg-message "called from here" } */
 }
 
-/* { dg-error "inlining failed in call to always_inline" "" { target *-*-* } 0 } */
+/* { dg-error "inlining failed in call to always_inline" "" { target *-*-* } 0 }
+ */
 
index 984992f2ab06969969f5e7699d7af7fed356705a..3cf8918d724afd40cc34e6b1bc203cfb7c8c7faf 100644 (file)
@@ -1,7 +1,6 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_fp_ok } */
-/* { dg-options "-mfp16-format=ieee" } */
-/* { dg-add-options arm_fp } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-mfp16-format=ieee -mfloat-abi=softfp" } */
 
 #include "arm_neon.h"
 
index 79133e5237afaaf598fbbf6aa05b3ae6f981e83a..819fad4ce621965a9595f8f32e4058ea0b70c861 100644 (file)
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_neon_ok } */
-/* { dg-require-effective-target arm_vfp_ok } */
-/* { dg-options "-O2" } */
-/* { dg-add-options arm_vfp } */
+/* { dg-options "-O2 -mfloat-abi=softfp -mfpu=vfp" } */
 
 #pragma GCC target ("fpu=neon")
 #include <arm_neon.h>
index 0d31fb525594770cf76aca5c5ee9846c8d5c572a..30a14790d08894c90cc4b95316de5a069b765684 100644 (file)
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_crypto_ok } */
-/* { dg-require-effective-target arm_vfp_ok } */
-/* { dg-options "-O2" } */
-/* { dg-add-options arm_vfp } */
+/* { dg-options "-O2 -mfloat-abi=softfp -mfpu=vfp" } */
 
 #include <arm_neon.h>
 
index 4f2a5bb1675e7fd5290f74c666463ac616dfdf1e..4e349e9832ee3087e2228dd2337f88beeecdcca6 100644 (file)
@@ -2664,34 +2664,17 @@ proc check_effective_target_arm_vect_no_misalign { } {
 
 
 # Return 1 if this is an ARM target supporting -mfpu=vfp
-# -mfloat-abi=softfp or equivalent options.  Some multilibs may be
-# incompatible with these options.  Also set et_arm_vfp_flags to the
-# best options to add.
+# -mfloat-abi=softfp.  Some multilibs may be incompatible with these
+# options.
 
-proc check_effective_target_arm_vfp_ok_nocache { } {
-    global et_arm_vfp_flags
-    set et_arm_vfp_flags ""
+proc check_effective_target_arm_vfp_ok { } {
     if { [check_effective_target_arm32] } {
-       foreach flags {"-mfpu=vfp" "-mfpu=vfp -mfloat-abi=softfp" "-mfpu=vfp -mfloat-abi=hard"} {
-           if { [check_no_compiler_messages_nocache arm_vfp_ok object {
-               #ifndef __ARM_FP
-               #error __ARM_FP not defined
-               #endif
-               #ifdef __ARM_NEON_FP
-               #error __ARM_NEON_FP defined
-               #endif
-           } "$flags" ] } {
-               set et_arm_vfp_flags $flags
-               return 1
-           }
-       }
+       return [check_no_compiler_messages arm_vfp_ok object {
+           int dummy;
+       } "-mfpu=vfp -mfloat-abi=softfp"]
+    } else {
+       return 0
     }
-    return 0
-}
-
-proc check_effective_target_arm_vfp_ok { } {
-    return [check_cached_effective_target arm_vfp_ok \
-               check_effective_target_arm_vfp_ok_nocache]
 }
 
 # Return 1 if this is an ARM target supporting -mfpu=vfp3
@@ -2738,47 +2721,6 @@ proc check_effective_target_arm_hard_vfp_ok { } {
     }
 }
 
-# Return 1 if this is an ARM target defining __ARM_FP. We may need
-# -mfloat-abi=softfp or equivalent options.  Some multilibs may be
-# incompatible with these options.  Also set et_arm_fp_flags to the
-# best options to add.
-
-proc check_effective_target_arm_fp_ok_nocache { } {
-    global et_arm_fp_flags
-    set et_arm_fp_flags ""
-    if { [check_effective_target_arm32] } {
-       foreach flags {"" "-mfloat-abi=softfp" "-mfloat-abi=hard"} {
-           if { [check_no_compiler_messages_nocache arm_fp_ok object {
-               #ifndef __ARM_FP
-               #error __ARM_FP not defined
-               #endif
-           } "$flags"] } {
-               set et_arm_fp_flags $flags
-               return 1
-           }
-       }
-    }
-
-    return 0
-}
-
-proc check_effective_target_arm_fp_ok { } {
-    return [check_cached_effective_target arm_fp_ok \
-               check_effective_target_arm_fp_ok_nocache]
-}
-
-# Add the options needed to define __ARM_FP.  We need either
-# -mfloat-abi=softfp or -mfloat-abi=hard, but if one is already
-# specified by the multilib, use it.
-
-proc add_options_for_arm_fp { flags } {
-    if { ! [check_effective_target_arm_fp_ok] } {
-       return "$flags"
-    }
-    global et_arm_fp_flags
-    return "$flags $et_arm_fp_flags"
-}
-
 # Return 1 if this is an ARM target that supports DSP multiply with
 # current multilib flags.
 
@@ -2811,7 +2753,7 @@ proc check_effective_target_arm_unaligned { } {
 proc check_effective_target_arm_crypto_ok_nocache { } {
     global et_arm_crypto_flags
     set et_arm_crypto_flags ""
-    if { [check_effective_target_arm_v8_neon_ok] } {
+    if { [check_effective_target_arm32] } {
        foreach flags {"" "-mfloat-abi=softfp" "-mfpu=crypto-neon-fp-armv8" "-mfpu=crypto-neon-fp-armv8 -mfloat-abi=softfp"} {
            if { [check_no_compiler_messages_nocache arm_crypto_ok object {
                #include "arm_neon.h"
@@ -2837,54 +2779,6 @@ proc check_effective_target_arm_crypto_ok { } {
                check_effective_target_arm_crypto_ok_nocache]
 }
 
-# Return 1 if this is an ARM target supporting pragma target
-# -mfpu=crypto-neon-fp-armv8 -mfloat-abi=softfp or equivalent options.
-# Some multilibs may be incompatible with these options.  Also set
-# et_arm_crypto_pragma_flags to the best options to add.
-
-proc check_effective_target_arm_crypto_pragma_ok_nocache { } {
-    global et_arm_crypto_pragma_flags
-    set et_arm_crypto_pragma_flags ""
-    if { [check_effective_target_arm_v8_neon_ok] } {
-       foreach flags {"" "-mfloat-abi=softfp" "-mfpu=crypto-neon-fp-armv8" "-mfpu=crypto-neon-fp-armv8 -mfloat-abi=softfp"} {
-           if { [check_no_compiler_messages_nocache arm_crypto_pragmaok object {
-               #pragma GCC target ("fpu=crypto-neon-fp-armv8")
-               #include "arm_neon.h"
-               uint8x16_t
-               foo (uint8x16_t a, uint8x16_t b)
-               {
-                 return vaeseq_u8 (a, b);
-               }
-           } "[add_options_for_arm_v8_neon ""] $flags"] } {
-               set et_arm_crypto_pragma_flags "[add_options_for_arm_v8_neon ""] $flags"
-               return 1
-           }
-       }
-    }
-
-    return 0
-}
-
-# Return 1 if this is an ARM target supporting pragma target
-# -mfpu=crypto-neon-fp-armv8.
-
-proc check_effective_target_arm_crypto_pragma_ok { } {
-    return [check_cached_effective_target arm_crypto_pragma_ok \
-               check_effective_target_arm_crypto_pragma_ok_nocache]
-}
-
-# Add the options needed for VFP.  We need either -mfloat-abi=softfp
-# or -mfloat-abi=hard, but if one is already specified by the
-# multilib, use it.
-
-proc add_options_for_arm_vfp { flags } {
-    if { ! [check_effective_target_arm_vfp_ok] } {
-       return "$flags"
-    }
-    global et_arm_vfp_flags
-    return "$flags $et_arm_vfp_flags"
-}
-
 # Add options for crypto extensions.
 proc add_options_for_arm_crypto { flags } {
     if { ! [check_effective_target_arm_crypto_ok] } {
@@ -3013,8 +2907,8 @@ proc check_effective_target_arm_crc_ok { } {
 
 # Return 1 if this is an ARM target supporting -mfpu=neon-fp16
 # -mfloat-abi=softfp or equivalent options.  Some multilibs may be
-# incompatible with these options.  Also set et_arm_neon_fp16_flags to
-# the best options to add.
+# incompatible with these options.  Also set et_arm_neon_flags to the
+# best options to add.
 
 proc check_effective_target_arm_neon_fp16_ok_nocache { } {
     global et_arm_neon_fp16_flags