]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: testsuite: correctly detect hard_float
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 3 Nov 2023 10:34:40 +0000 (10:34 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Mon, 13 Nov 2023 14:15:54 +0000 (14:15 +0000)
Add an arm-specific test to check_effective_target_hard_float for
Arm to handle cases where we only have single-precision FP in hardware.

gcc/testsuite:

* lib/target-supports.exp (check_effective_target_hard_float): Add
arm-specific test.

gcc/testsuite/lib/target-supports.exp

index d414cddf4dcd515dabc1970709ac8934aaf2774e..ee173b9fb6bdf390a9d8b252cef07797457e5c29 100644 (file)
@@ -1420,6 +1420,17 @@ proc check_effective_target_mpaired_single { args } {
 # Return true if the target has access to FPU instructions.
 
 proc check_effective_target_hard_float { } {
+    # This should work on cores that only have single-precision,
+    # and should also correctly handle legacy cores that had thumb1 and
+    # lacked FP support for that, but had it in Arm state.
+    if { [istarget arm*-*-*] } {
+       return [check_no_compiler_messages hard_float assembly {
+               #if __ARM_FP == 0
+               #error __arm_soft_float
+               #endif
+       }]
+    }
+
     if { [istarget loongarch*-*-*] } {
        return [check_no_compiler_messages hard_float assembly {
                #if (defined __loongarch_soft_float)