+2017-01-20 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * lib/target-supports.exp (check_configured_with): New procedure.
+ (check_effective_target_default_mode): new effective target.
+ * gcc.target/arm/optional_thumb-1.c: Skip if GCC was configured with a
+ default mode. Fix dg-skip-if target selector syntax.
+ * gcc.target/arm/optional_thumb-2.c: Likewise.
+ * gcc.target/arm/optional_thumb-3.c: Fix dg-skip-if target selector
+ syntax.
+
2017-01-20 David Malcolm <dmalcolm@redhat.com>
PR c++/77829
-/* { dg-do compile } */
-/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-*} { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */
+/* { dg-do compile { target { ! default_mode } } } */
+/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-* } { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */
/* { dg-options "-march=armv6-m" } */
/* Check that -mthumb is not needed when compiling for a Thumb-only target. */
-/* { dg-do compile } */
-/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-*} { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */
+/* { dg-do compile { target { ! default_mode } } } */
+/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-* } { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */
/* { dg-options "-mcpu=cortex-m4" } */
/* Check that -mthumb is not needed when compiling for a Thumb-only target. */
/* { dg-do compile } */
/* { dg-require-effective-target arm_cortex_m } */
-/* { dg-skip-if "-mthumb given" { *-*-*} { "-mthumb" } } */
+/* { dg-skip-if "-mthumb given" { *-*-* } { "-mthumb" } } */
/* { dg-options "-marm" } */
-/* { dg-error "target CPU does not support ARM mode" "missing error with -marm on Thumb-only targets" { target *-*-*} 0 } */
+/* { dg-error "target CPU does not support ARM mode" "missing error with -marm on Thumb-only targets" { target *-*-* } 0 } */
/* Check that -marm gives an error when compiling for a Thumb-only target. */
}]
}
+# Return 1 if GCC was configured with $pattern.
+proc check_configured_with { pattern } {
+ global tool
+
+ set gcc_output [${tool}_target_compile "-v" "" "none" ""]
+ if { [ regexp "Configured with: \[^\n\]*$pattern" $gcc_output ] } {
+ verbose "Matched: $pattern" 2
+ return 1
+ }
+
+ verbose "Failed to match: $pattern" 2
+ return 0
+}
+
###############################
# proc check_weak_available { }
###############################
return "$flags -march=armv7ve"
}
+# Return 1 if GCC was configured with --with-mode=
+proc check_effective_target_default_mode { } {
+
+ return [check_configured_with "with-mode="]
+}
+
# Return 1 if this is an ARM target where -marm causes ARM to be
# used (not Thumb)