summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/tests/unit
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-09-11 09:56:33 +0000
committerAlexey Samsonov <samsonov@google.com>2013-09-11 09:56:33 +0000
commite99a0b9b7692c5b9f8da0202093d7c13b6dda76e (patch)
tree0779d41d854f4239b56bb6c246c67946684d0f7c /compiler-rt/lib/tsan/tests/unit
parent7230246d14335b3186707548e9863d7e1c905f12 (diff)
downloadbcm5719-llvm-e99a0b9b7692c5b9f8da0202093d7c13b6dda76e.tar.gz
bcm5719-llvm-e99a0b9b7692c5b9f8da0202093d7c13b6dda76e.zip
[TSan] Use Clang to compile and link TSan unit tests with TSan runtime
llvm-svn: 190503
Diffstat (limited to 'compiler-rt/lib/tsan/tests/unit')
-rw-r--r--compiler-rt/lib/tsan/tests/unit/CMakeLists.txt9
-rw-r--r--compiler-rt/lib/tsan/tests/unit/tsan_unit_test_main.cc19
2 files changed, 24 insertions, 4 deletions
diff --git a/compiler-rt/lib/tsan/tests/unit/CMakeLists.txt b/compiler-rt/lib/tsan/tests/unit/CMakeLists.txt
index 1cd2abe4d21..6898f641d6a 100644
--- a/compiler-rt/lib/tsan/tests/unit/CMakeLists.txt
+++ b/compiler-rt/lib/tsan/tests/unit/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(TSAN_UNIT_TESTS
+set(TSAN_UNIT_TEST_SOURCES
tsan_clock_test.cc
tsan_flags_test.cc
tsan_mman_test.cc
@@ -6,7 +6,8 @@ set(TSAN_UNIT_TESTS
tsan_shadow_test.cc
tsan_stack_test.cc
tsan_sync_test.cc
- tsan_vector_test.cc
- )
+ tsan_unit_test_main.cc
+ tsan_vector_test.cc)
-add_tsan_unittest(TsanUnitTest ${TSAN_UNIT_TESTS})
+add_tsan_unittest(TsanUnitTest
+ SOURCES ${TSAN_UNIT_TEST_SOURCES})
diff --git a/compiler-rt/lib/tsan/tests/unit/tsan_unit_test_main.cc b/compiler-rt/lib/tsan/tests/unit/tsan_unit_test_main.cc
new file mode 100644
index 00000000000..84d94dd0374
--- /dev/null
+++ b/compiler-rt/lib/tsan/tests/unit/tsan_unit_test_main.cc
@@ -0,0 +1,19 @@
+//===-- tsan_unit_test_main.cc --------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of ThreadSanitizer (TSan), a race detector.
+//
+//===----------------------------------------------------------------------===//
+#include "gtest/gtest.h"
+
+int main(int argc, char **argv) {
+ testing::GTEST_FLAG(death_test_style) = "threadsafe";
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
OpenPOWER on IntegriCloud