diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2023-11-03 18:17:36 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@arm.com> | 2023-11-13 14:15:56 +0000 |
commit | 40e25ea5b0b3584b9588563784cc8575ce2d7ddb (patch) | |
tree | 38553abef8a55af8e8310d087ce3f42750e43dfe | |
parent | c034b8f53243175f04935fd653ce15bd7700495c (diff) | |
download | gcc-40e25ea5b0b3584b9588563784cc8575ce2d7ddb.zip gcc-40e25ea5b0b3584b9588563784cc8575ce2d7ddb.tar.gz gcc-40e25ea5b0b3584b9588563784cc8575ce2d7ddb.tar.bz2 |
arm: testsuite: improve compatibility of pragma_arch_attribute*.c
These tests use pragmas adn attributes to change the architecture.
Sometimes they simply add a feature using "+crc", but other times they
try to completely reset the architecture using "arch=armv8-a+crc".
The latter fails on a hard-float ABI with -mfpu=auto because it also
clears the FP capability. Fix by adding +simd when the full
architecture is specified.
gcc/testsuite:
* gcc.target/arm/pragma_arch_attribute.c: Add +simd to pragmas that
set an explicit architecture.
* gcc.target/arm/pragma_arch_attribute_2.c: Likewise.
* gcc.target/arm/pragma_arch_attribute_3.c: Likewise.
-rw-r--r-- | gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/pragma_arch_attribute_2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/pragma_arch_attribute_3.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c index a06dbf0..a5e1eda 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c @@ -10,7 +10,7 @@ #endif #pragma GCC push_options -#pragma GCC target ("arch=armv8-a+crc") +#pragma GCC target ("arch=armv8-a+simd+crc") #ifndef __ARM_FEATURE_CRC32 # error "__ARM_FEATURE_CRC32 is not defined in push 1." #endif @@ -41,7 +41,7 @@ void test_crc_unknown_ok_attr_1 () # error "__ARM_FEATURE_CRC32 is defined after attribute set 1." #endif -__attribute__((target("arch=armv8-a+crc"))) +__attribute__((target("arch=armv8-a+simd+crc"))) void test_crc_unknown_ok_attr_2 () { __crc32b (0, 0); @@ -51,4 +51,4 @@ void test_crc_unknown_ok_attr_2 () # error "__ARM_FEATURE_CRC32 is defined after attribute set 2." #endif -#pragma GCC reset_options
\ No newline at end of file +#pragma GCC reset_options diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_2.c b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_2.c index 2e8e385..189af17 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_2.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_2.c @@ -8,7 +8,7 @@ extern uint32_t bar(); -__attribute__((target("arch=armv8-a+crc"))) uint32_t crc32cw(uint32_t crc, uint32_t val) +__attribute__((target("arch=armv8-a+simd+crc"))) uint32_t crc32cw(uint32_t crc, uint32_t val) { uint32_t res; asm("crc32cw %0, %1, %2" : "=r"(res) : "r"(crc), "r"(val)); diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_3.c b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_3.c index 3714812..eb7f990 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_3.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute_3.c @@ -9,7 +9,7 @@ extern uint32_t bar(); #pragma GCC push_options -#pragma GCC target("arch=armv8-a+crc") +#pragma GCC target("arch=armv8-a+simd+crc") uint32_t crc32cw(uint32_t crc, uint32_t val) { uint32_t res; |