diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_getaffinity_np.cpp @@ -4,6 +4,7 @@ // (Note: libresolv is integrated with libc, but apparently only // sched_getaffinity). // UNSUPPORTED: android +// UNSUPPORTED: mismatched-core-count #include #include diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py --- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py @@ -34,6 +34,11 @@ if config.arm_thumb: config.available_features.add('thumb') +# Using cgroups on Linux the number of available cores can be different from the +# number of online cores. +if os.cpu_count() != len(os.sched_getaffinity(0)): + config.available_features.add('mismatched-core-count') + if config.host_os == 'Darwin': # On Darwin, we default to `abort_on_error=1`, which would make tests run # much slower. Let's override this and run lit tests with 'abort_on_error=0'.