aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2016-02-03 18:01:01 +0100
committerUros Bizjak <uros@gcc.gnu.org>2016-02-03 18:01:01 +0100
commitccc71ab85a5737ed554c8586d7e1900897c16b86 (patch)
tree530e99aa031df09d45baafd523d286333475f499
parent203ae08bb31cd53e725fe29c5a21e5613e09fc3b (diff)
downloadgcc-ccc71ab85a5737ed554c8586d7e1900897c16b86.zip
gcc-ccc71ab85a5737ed554c8586d7e1900897c16b86.tar.gz
gcc-ccc71ab85a5737ed554c8586d7e1900897c16b86.tar.bz2
tsan-dg.exp (tsan_init): Move check if tsan executable works from here ...
* lib/tsan-dg.exp (tsan_init): Move check if tsan executable works from here ... (check_effective_target_fsanitize_thread): ... to here. Do not specify additional compile flags for the test source. * lib/asan-dg.exp (check_effective_target_fsanitize_address): Do not specify additional compile flags for the test source. From-SVN: r233106
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/lib/asan-dg.exp2
-rw-r--r--gcc/testsuite/lib/tsan-dg.exp41
3 files changed, 32 insertions, 20 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 88ec6dc..8ad0a60 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2016-02-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/tsan-dg.exp (tsan_init): Move check if tsan executable
+ works from here ...
+ (check_effective_target_fsanitize_thread): ... to here. Do not
+ specify additional compile flags for the test source.
+ * lib/asan-dg.exp (check_effective_target_fsanitize_address): Do not
+ specify additional compile flags for the test source.
+
2016-02-03 Wilco Dijkstra <wdijkstr@arm.com>
* gcc.target/aarch64/ccmp_1.c: Fix test issue.
diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp
index 994160e..a1198c0 100644
--- a/gcc/testsuite/lib/asan-dg.exp
+++ b/gcc/testsuite/lib/asan-dg.exp
@@ -20,7 +20,7 @@
proc check_effective_target_fsanitize_address {} {
return [check_no_compiler_messages fsanitize_address executable {
int main (void) { return 0; }
- } "-fsanitize=address"]
+ }]
}
proc asan_include_flags {} {
diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp
index eb1f3a9..7ca10ab 100644
--- a/gcc/testsuite/lib/tsan-dg.exp
+++ b/gcc/testsuite/lib/tsan-dg.exp
@@ -15,12 +15,31 @@
# <http://www.gnu.org/licenses/>.
# Return 1 if compilation with -fsanitize=thread is error-free for trivial
-# code, 0 otherwise.
+# code, 0 otherwise. Also set what to do by default here, depending on the
+# result of a runtime test.
proc check_effective_target_fsanitize_thread {} {
- return [check_runtime fsanitize_thread {
+ global individual_timeout
+ global dg-do-what-default
+
+ if ![check_no_compiler_messages fsanitize_thread executable {
int main (void) { return 0; }
- } "-fsanitize=thread"]
+ }] {
+ return 0
+ }
+
+ # Lower timeout value in case test does not terminate properly.
+ set individual_timeout 20
+ if [check_runtime_nocache tsan_works {
+ int main () { return 0; }
+ }] {
+ set dg-do-what-default run
+ } else {
+ set dg-do-what-default link
+ }
+ unset individual_timeout
+
+ return 1
}
#
@@ -101,22 +120,6 @@ proc tsan_init { args } {
set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=thread -g"
}
}
-
- set dg-do-what-default run
- if { $link_flags != "" } {
- global individual_timeout
-
- # Lower timeout value in case test does not terminate properly.
- set individual_timeout 20
- if [check_runtime_nocache tsan_works {
- int main () { return 0; }
- } "-fsanitize=thread -g"] {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
- }
- unset individual_timeout
- }
}
#