summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-08-12 23:24:41 +0000
committerReid Kleckner <rnk@google.com>2015-08-12 23:24:41 +0000
commit1d70301a36406720f0d04e4f9fe6eeaee289ae2b (patch)
tree3fd1b7e7b4947b2dfd30011a8c808a348bfbfe56
parent38f885143efca6b6204860aff793c50a1de14606 (diff)
Combine helper file into main test file with ifdefs
Keeping tests isolated to a single file is nice, and it was suggested in post-commit review for r244827. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244833 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc2
-rw-r--r--test/asan/TestCases/Posix/init-order-pthread-create.cc13
2 files changed, 12 insertions, 3 deletions
diff --git a/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc b/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc
deleted file mode 100644
index 54f26f167..000000000
--- a/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc
+++ /dev/null
@@ -1,2 +0,0 @@
-void *bar(void *input, bool sleep_before_init);
-void *glob2 = bar((void*)0x2345, true);
diff --git a/test/asan/TestCases/Posix/init-order-pthread-create.cc b/test/asan/TestCases/Posix/init-order-pthread-create.cc
index d8c83440b..1850432ca 100644
--- a/test/asan/TestCases/Posix/init-order-pthread-create.cc
+++ b/test/asan/TestCases/Posix/init-order-pthread-create.cc
@@ -1,9 +1,13 @@
// Check that init-order checking is properly disabled if pthread_create is
// called.
-// RUN: %clangxx_asan %s %p/../Helpers/init-order-pthread-create-extra.cc -pthread -o %t
+// RUN: %clangxx_asan -c -DCONFIG1 %s -o %t1.o
+// RUN: %clangxx_asan -c %s -o %t2.o
+// RUN: %clangxx_asan -pthread %t1.o %t2.o -o %t
// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true %run %t
+#ifdef CONFIG1
+
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
@@ -41,3 +45,10 @@ int main() {
printf("%p %p\n", glob, glob2);
return 0;
}
+
+#else // CONFIG1
+
+void *bar(void *input, bool sleep_before_init);
+void *glob2 = bar((void*)0x2345, true);
+
+#endif