summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2014-02-07 11:48:06 +0000
committerDmitry Vyukov <dvyukov@google.com>2014-02-07 11:48:06 +0000
commitb2b3e4bd777927dcfd16514317e5e6b4d3e1962d (patch)
treef13e438b0795246ada13c8db657a97f0701fe6f3
parent5e8558fce07dab2ee58d55b231a31bca7bae1b3a (diff)
downloadbcm5719-llvm-b2b3e4bd777927dcfd16514317e5e6b4d3e1962d.tar.gz
bcm5719-llvm-b2b3e4bd777927dcfd16514317e5e6b4d3e1962d.zip
tsan: improve the test
remove TSAN_OPTIONS from the test, so that it runs in the presubmit script add a CHECK, so that it can run with FileCheck as well llvm-svn: 200972
-rw-r--r--compiler-rt/lib/tsan/lit_tests/getline_nohang.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/lit_tests/getline_nohang.cc b/compiler-rt/lib/tsan/lit_tests/getline_nohang.cc
index d5acb343a39..1dd17f0646a 100644
--- a/compiler-rt/lib/tsan/lit_tests/getline_nohang.cc
+++ b/compiler-rt/lib/tsan/lit_tests/getline_nohang.cc
@@ -1,4 +1,4 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && TSAN_OPTIONS=report_thread_leaks=0 %t
+// RUN: %clangxx_tsan -O1 %s -o %t && %t
// Make sure TSan doesn't deadlock on a file stream lock at program shutdown.
// See https://code.google.com/p/thread-sanitizer/issues/detail?id=47
@@ -22,7 +22,14 @@ void *thread(void *unused) {
int main() {
pthread_t t;
- pthread_create(&t, NULL, thread, NULL);
+ pthread_attr_t a;
+ pthread_attr_init(&a);
+ pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
+ pthread_create(&t, &a, thread, NULL);
+ pthread_attr_destroy(&a);
+ fprintf(stderr, "DONE\n");
return 0;
// ThreadSanitizer used to hang here because of a deadlock on a file stream.
}
+
+// CHECK: DONE
OpenPOWER on IntegriCloud