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.
/* { 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"
/* 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 "**" "" "" } } */
}
}
+# 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.