/* { 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"
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