From f787cdd0318ae06797cf50d828659967b1503bc5 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 12 Aug 2015 23:24:41 +0000 Subject: [PATCH] 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. llvm-svn: 244833 --- .../TestCases/Helpers/init-order-pthread-create-extra.cc | 2 -- .../test/asan/TestCases/Posix/init-order-pthread-create.cc | 13 ++++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) delete mode 100644 compiler-rt/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc diff --git a/compiler-rt/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc b/compiler-rt/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc deleted file mode 100644 index 54f26f1..0000000 --- a/compiler-rt/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/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc b/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc index d8c8344..1850432 100644 --- a/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc +++ b/compiler-rt/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 #include #include @@ -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 -- 2.7.4