aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2024-11-06 07:12:14 +0100
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2024-11-08 13:02:16 +0100
commitdc5d559494656c17c4faa99f398047b7d0c33adc (patch)
treebaf9bbd0ed77f52cd7a7f2e8ccdb6499683e9b6b
parent636b8aeacd182351313381636ecbf8dcef1ee45a (diff)
downloadgcc-dc5d559494656c17c4faa99f398047b7d0c33adc.zip
gcc-dc5d559494656c17c4faa99f398047b7d0c33adc.tar.gz
gcc-dc5d559494656c17c4faa99f398047b7d0c33adc.tar.bz2
testsuite: arm: Use effective-target arm_libc_fp_abi for pr68620.c test
This fixes reported regression at https://linaro.atlassian.net/browse/GNU-1407. gcc/testsuite/ChangeLog: * gcc.target/arm/pr68620.c: Use effective-target arm_libc_fp_abi. * lib/target-supports.exp: Define effective-target arm_libc_fp_abi. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> Co-authored-by: Richard Earnshaw <rearnsha@arm.com>
-rw-r--r--gcc/testsuite/gcc.target/arm/pr68620.c4
-rw-r--r--gcc/testsuite/lib/target-supports.exp35
2 files changed, 38 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/arm/pr68620.c b/gcc/testsuite/gcc.target/arm/pr68620.c
index 6e38671..3ffaa5c 100644
--- a/gcc/testsuite/gcc.target/arm/pr68620.c
+++ b/gcc/testsuite/gcc.target/arm/pr68620.c
@@ -1,8 +1,10 @@
/* { dg-do compile } */
/* { dg-skip-if "-mpure-code supports M-profile without Neon only" { *-*-* } { "-mpure-code" } } */
/* { dg-require-effective-target arm_arch_v7a_ok } */
-/* { dg-options "-mfp16-format=ieee -mfpu=auto -mfloat-abi=softfp" } */
+/* { dg-require-effective-target arm_libc_fp_abi_ok } */
+/* { dg-options "-mfp16-format=ieee -mfpu=auto" } */
/* { dg-add-options arm_arch_v7a } */
+/* { dg-add-options arm_libc_fp_abi } */
#include "arm_neon.h"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 75703dd..0c2fd83 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4950,6 +4950,41 @@ proc add_options_for_arm_fp { flags } {
return "$flags $et_arm_fp_flags"
}
+# Some libc headers will only compile correctly if the correct ABI flags
+# are picked for the target environment. Try to find an ABI setting
+# that works. Glibc falls into this category. This test is intended
+# to enable FP as far as possible, so does not try -mfloat-abi=soft.
+proc check_effective_target_arm_libc_fp_abi_ok_nocache { } {
+ global et_arm_libc_fp_abi_flags
+ set et_arm_libc_fp_abi_flags ""
+ if { [check_effective_target_arm32] } {
+ foreach flags {"-mfloat-abi=hard" "-mfloat-abi=softfp"} {
+ if { [check_no_compiler_messages_nocache arm_libc_fp_abi_ok object {
+ #include <stdint.h>
+ } "$flags"] } {
+ set et_arm_libc_fp_abi_flags $flags
+ return 1
+ }
+ }
+ }
+ return 0
+}
+
+proc check_effective_target_arm_libc_fp_abi_ok { } {
+ return [check_cached_effective_target arm_libc_fp_abi_ok \
+ check_effective_target_arm_libc_fp_abi_ok_nocache]
+}
+
+# Add flags that pick the right ABI for the supported libc headers on
+# this platform.
+proc add_options_for_arm_libc_fp_abi { flags } {
+ if { ! [check_effective_target_arm_libc_fp_abi_ok] } {
+ return "$flags"
+ }
+ global et_arm_libc_fp_abi_flags
+ return "$flags $et_arm_libc_fp_abi_flags"
+}
+
# Return 1 if this is an ARM target defining __ARM_FP with
# double-precision support. We may need -mfloat-abi=softfp or
# equivalent options. Some multilibs may be incompatible with these