aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2017-01-20 15:29:21 +0000
committerThomas Preud'homme <thopre01@gcc.gnu.org>2017-01-20 15:29:21 +0000
commit449cd5af046c35e021ff0a6261c728479ae6fb91 (patch)
tree707571242512a63ab07685f563273fd96e5ec9e4 /gcc
parent12905f106c1cc8c6757038e3c41df478077bb870 (diff)
downloadgcc-449cd5af046c35e021ff0a6261c728479ae6fb91.zip
gcc-449cd5af046c35e021ff0a6261c728479ae6fb91.tar.gz
gcc-449cd5af046c35e021ff0a6261c728479ae6fb91.tar.bz2
Skip optional_mthumb tests if GCC has a default mode
2017-01-20 Thomas Preud'homme <thomas.preudhomme@arm.com> gcc/testsuite/ * 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. From-SVN: r244723
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/gcc.target/arm/optional_thumb-1.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/optional_thumb-2.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/optional_thumb-3.c4
-rw-r--r--gcc/testsuite/lib/target-supports.exp20
5 files changed, 36 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fde9328..cc98016 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+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
diff --git a/gcc/testsuite/gcc.target/arm/optional_thumb-1.c b/gcc/testsuite/gcc.target/arm/optional_thumb-1.c
index 23df628..99cb0c3 100644
--- a/gcc/testsuite/gcc.target/arm/optional_thumb-1.c
+++ b/gcc/testsuite/gcc.target/arm/optional_thumb-1.c
@@ -1,5 +1,5 @@
-/* { 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. */
diff --git a/gcc/testsuite/gcc.target/arm/optional_thumb-2.c b/gcc/testsuite/gcc.target/arm/optional_thumb-2.c
index 4bd53a4..280dfb3 100644
--- a/gcc/testsuite/gcc.target/arm/optional_thumb-2.c
+++ b/gcc/testsuite/gcc.target/arm/optional_thumb-2.c
@@ -1,5 +1,5 @@
-/* { 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. */
diff --git a/gcc/testsuite/gcc.target/arm/optional_thumb-3.c b/gcc/testsuite/gcc.target/arm/optional_thumb-3.c
index f1fd5c8..d9150e0 100644
--- a/gcc/testsuite/gcc.target/arm/optional_thumb-3.c
+++ b/gcc/testsuite/gcc.target/arm/optional_thumb-3.c
@@ -1,8 +1,8 @@
/* { 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. */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 12dbf47..e1d6dcb 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -252,6 +252,20 @@ proc check_runtime {prop args} {
}]
}
+# 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 { }
###############################
@@ -3817,6 +3831,12 @@ proc add_options_for_arm_arch_v7ve { flags } {
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)