@@ -1,5 +1,7 @@
/* Check that attribute target thumb is recognized. */
/* { dg-do compile } */
+/* Make sure the current multilib supports thumb. */
+/* { dg-require-effective-target arm_thumb_ok } */
/* { dg-options "-O2 -mno-restrict-it" } */
/* { dg-final { scan-assembler-not "\\.arm" } } */
/* { dg-final { scan-assembler "\\.thumb_func" } } */
@@ -2910,6 +2910,15 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
}]
}
+# Return 1 if this is an ARM target supporting -mthumb. Some
+# multilibs may be incompatible with this option.
+
+proc check_effective_target_arm_thumb_ok { } {
+ return [check_no_compiler_messages arm_thumb_ok object {
+ int foo (int i) { return i; }
+ } "-mthumb"]
+}
+
# Return 1 if this is an ARM target where -marm causes ARM to be
# used (not Thumb)