diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg --- a/compiler-rt/test/lit.common.cfg +++ b/compiler-rt/test/lit.common.cfg @@ -222,9 +222,9 @@ if not compiler_rt_debug: config.available_features.add('compiler-rt-optimized') -dispatch = getattr(config, 'compiler_rt_intercept_libdispatch') -if dispatch: - config.available_features.add('dispatch') +libdispatch = getattr(config, 'compiler_rt_intercept_libdispatch') +if libdispatch: + config.available_features.add('libdispatch') sanitizer_can_use_cxxabi = getattr(config, 'sanitizer_can_use_cxxabi', True) if sanitizer_can_use_cxxabi: diff --git a/compiler-rt/test/tsan/gcd-apply-race.c b/compiler-rt/test/tsan/libdispatch/apply-race.c rename from compiler-rt/test/tsan/gcd-apply-race.c rename to compiler-rt/test/tsan/libdispatch/apply-race.c --- a/compiler-rt/test/tsan/gcd-apply-race.c +++ b/compiler-rt/test/tsan/libdispatch/apply-race.c @@ -1,11 +1,9 @@ // RUN: %clang_tsan %s -o %t // RUN: %deflake %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include -#include "test.h" +#include "../test.h" long global; diff --git a/compiler-rt/test/tsan/gcd-apply.c b/compiler-rt/test/tsan/libdispatch/apply.c rename from compiler-rt/test/tsan/gcd-apply.c rename to compiler-rt/test/tsan/libdispatch/apply.c --- a/compiler-rt/test/tsan/gcd-apply.c +++ b/compiler-rt/test/tsan/libdispatch/apply.c @@ -1,15 +1,13 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - // TODO(yln): Deadlocks while gcd-apply.mm does not. What's the difference // between C and Obj-C compiler? // REQUIRES: disable #include -#include "test.h" +#include "../test.h" long global; long array[2]; diff --git a/compiler-rt/test/tsan/gcd-data.c b/compiler-rt/test/tsan/libdispatch/data.c rename from compiler-rt/test/tsan/gcd-data.c rename to compiler-rt/test/tsan/libdispatch/data.c --- a/compiler-rt/test/tsan/gcd-data.c +++ b/compiler-rt/test/tsan/libdispatch/data.c @@ -1,8 +1,6 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - // TODO(yln): fails on one of our bots, need to investigate // REQUIRES: disabled diff --git a/compiler-rt/test/tsan/gcd-dispatch_main.c b/compiler-rt/test/tsan/libdispatch/dispatch_main.c rename from compiler-rt/test/tsan/gcd-dispatch_main.c rename to compiler-rt/test/tsan/libdispatch/dispatch_main.c --- a/compiler-rt/test/tsan/gcd-dispatch_main.c +++ b/compiler-rt/test/tsan/libdispatch/dispatch_main.c @@ -4,8 +4,6 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include #include diff --git a/compiler-rt/test/tsan/gcd-dispatch_once_deadlock.c b/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c rename from compiler-rt/test/tsan/gcd-dispatch_once_deadlock.c rename to compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c --- a/compiler-rt/test/tsan/gcd-dispatch_once_deadlock.c +++ b/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c @@ -3,8 +3,6 @@ // RUN: %clang_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include #include diff --git a/compiler-rt/test/tsan/gcd-groups-destructor.c b/compiler-rt/test/tsan/libdispatch/groups-destructor.c rename from compiler-rt/test/tsan/gcd-groups-destructor.c rename to compiler-rt/test/tsan/libdispatch/groups-destructor.c --- a/compiler-rt/test/tsan/gcd-groups-destructor.c +++ b/compiler-rt/test/tsan/libdispatch/groups-destructor.c @@ -1,8 +1,6 @@ // RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include #import diff --git a/compiler-rt/test/tsan/gcd-groups-leave.c b/compiler-rt/test/tsan/libdispatch/groups-leave.c rename from compiler-rt/test/tsan/gcd-groups-leave.c rename to compiler-rt/test/tsan/libdispatch/groups-leave.c --- a/compiler-rt/test/tsan/gcd-groups-leave.c +++ b/compiler-rt/test/tsan/libdispatch/groups-leave.c @@ -1,11 +1,9 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include -#include "test.h" +#include "../test.h" dispatch_semaphore_t sem; diff --git a/compiler-rt/test/tsan/gcd-groups-stress.c b/compiler-rt/test/tsan/libdispatch/groups-stress.c rename from compiler-rt/test/tsan/gcd-groups-stress.c rename to compiler-rt/test/tsan/libdispatch/groups-stress.c --- a/compiler-rt/test/tsan/gcd-groups-stress.c +++ b/compiler-rt/test/tsan/libdispatch/groups-stress.c @@ -1,8 +1,6 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include #include diff --git a/compiler-rt/test/tsan/libdispatch/lit.local.cfg b/compiler-rt/test/tsan/libdispatch/lit.local.cfg new file mode 100644 --- /dev/null +++ b/compiler-rt/test/tsan/libdispatch/lit.local.cfg @@ -0,0 +1,9 @@ +def getRoot(config): + if not config.parent: + return config + return getRoot(config.parent) + +root = getRoot(config) + +if 'libdispatch' not in root.available_features: + config.unsupported = True diff --git a/compiler-rt/test/tsan/gcd-once.c b/compiler-rt/test/tsan/libdispatch/once.c rename from compiler-rt/test/tsan/gcd-once.c rename to compiler-rt/test/tsan/libdispatch/once.c --- a/compiler-rt/test/tsan/gcd-once.c +++ b/compiler-rt/test/tsan/libdispatch/once.c @@ -1,11 +1,9 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include -#include "test.h" +#include "../test.h" static const long kNumThreads = 4; diff --git a/compiler-rt/test/tsan/gcd-semaphore-norace.c b/compiler-rt/test/tsan/libdispatch/semaphore-norace.c rename from compiler-rt/test/tsan/gcd-semaphore-norace.c rename to compiler-rt/test/tsan/libdispatch/semaphore-norace.c --- a/compiler-rt/test/tsan/gcd-semaphore-norace.c +++ b/compiler-rt/test/tsan/libdispatch/semaphore-norace.c @@ -1,8 +1,6 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include #include diff --git a/compiler-rt/test/tsan/gcd-source-serial.c b/compiler-rt/test/tsan/libdispatch/source-serial.c rename from compiler-rt/test/tsan/gcd-source-serial.c rename to compiler-rt/test/tsan/libdispatch/source-serial.c --- a/compiler-rt/test/tsan/gcd-source-serial.c +++ b/compiler-rt/test/tsan/libdispatch/source-serial.c @@ -1,8 +1,6 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - // TODO(yln): fails on one of our bots, need to investigate // REQUIRES: disabled diff --git a/compiler-rt/test/tsan/gcd-suspend.c b/compiler-rt/test/tsan/libdispatch/suspend.c rename from compiler-rt/test/tsan/gcd-suspend.c rename to compiler-rt/test/tsan/libdispatch/suspend.c --- a/compiler-rt/test/tsan/gcd-suspend.c +++ b/compiler-rt/test/tsan/libdispatch/suspend.c @@ -1,8 +1,6 @@ // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s -// REQUIRES: dispatch - #include #include