]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: testsuite: correctly detect armv6t2 hardware for acle execution tests
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 3 Nov 2023 14:03:50 +0000 (14:03 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Mon, 13 Nov 2023 14:15:54 +0000 (14:15 +0000)
Some of the ACLE tests for Arm are executable, but we were only testing
that the compiler could generate code for them, not that the hardware
was capable of executing them.  Fix this by adding an execution test for
suitable hardware.

gcc/testsuite:

* lib/target-supports.exp (check_effective_target_arm_arch_v6t2_hw_ok):
New function.
* gcc.target/arm/acle/data-intrinsics-armv6.c: Use it.
* gcc.target/arm/acle/data-intrinsics-rbit.c: Likewise.

gcc/testsuite/gcc.target/arm/acle/data-intrinsics-armv6.c
gcc/testsuite/gcc.target/arm/acle/data-intrinsics-rbit.c
gcc/testsuite/lib/target-supports.exp

index 988ecac37878f95c636f90bf47cc626cc45282e3..6dc8c55e2f9a164abcf8d920821fadc95f468e55 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-require-effective-target arm_arch_v6t2_ok } */
+/* { dg-require-effective-target arm_arch_v6t2_hw_ok } */
 /* { dg-add-options arm_arch_v6t2 } */
 
 #include "arm_acle.h"
index d1fe274b5ce951d975e1f5e7c2b188afefa2a245..b01c4219a7e73e6cf7dd5a7b29629e597ea953c9 100644 (file)
@@ -1,6 +1,6 @@
 /* Test the ACLE data intrinsics existence for specific instruction.  */
 /* { dg-do run } */
-/* { dg-require-effective-target arm_arch_v6t2_ok } */
+/* { dg-require-effective-target arm_arch_v6t2_hw_ok } */
 /* { dg-additional-options "--save-temps -O1" } */
 /* { dg-add-options arm_arch_v6t2 } */
 /* { dg-final { check-function-bodies "**" "" "" } } */
index 1a7bea96c1e4ccb8ef30ac7012c04e8d44c5ad01..d414cddf4dcd515dabc1970709ac8934aaf2774e 100644 (file)
@@ -5590,6 +5590,24 @@ proc check_effective_target_arm_thumb1_cbz_ok {} {
     }
 }
 
+# Return 1 if this is an Arm target which supports the Armv6t2 extensions.
+# This can be either in Arm state or in Thumb state.
+
+proc check_effective_target_arm_arch_v6t2_hw_ok {} {
+    if [check_effective_target_arm_thumb1_ok] {
+       return [check_no_compiler_messages arm_movt object {
+           int
+           main (void)
+           {
+             asm ("bfc r0, #1, #2");
+             return 0;
+           }
+       } [add_options_for_arm_arch_v6t2 ""]]
+    } else {
+       return 0
+    }
+}
+
 # Return 1 if this is an ARM target where ARMv8-M Security Extensions is
 # available.