if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'SunOS', 'Windows', 'NetBSD']:
config.unsupported = True
-if config.host_os == 'Darwin':
- if config.target_arch in ["x86_64", "x86_64h"]:
- config.parallelism_group = "darwin-64bit-sanitizer"
+config.parallelism_group = 'shadow-memory'
config.substitutions.append(('%env_asan_opts=',
'env ASAN_OPTIONS=' + default_asan_opts_str))
-if config.host_os == 'Darwin':
- if config.target_arch in ["x86_64", "x86_64h"]:
- config.parallelism_group = "darwin-64bit-sanitizer"
+config.parallelism_group = 'shadow-memory'
if platform.system() == 'Windows':
config.test_retry_attempts = 2
-# Only run up to 3 64-bit sanitized processes simultaneously on Darwin.
-# Using more scales badly and hogs the system due to inefficient handling
-# of large mmap'd regions (terabytes) by the kernel.
-if platform.system() == 'Darwin':
- lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3
+# No throttling on non-Darwin platforms.
+lit_config.parallelism_groups['shadow-memory'] = None
-# Force sequential execution when running tests on iOS devices.
-if config.host_os == 'Darwin' and config.apple_platform != "osx" and not config.apple_platform.endswith("sim"):
- lit_config.warning("iOS device test cases being run sequentially")
- lit_config.parallelism_groups["ios-device"] = 1
- config.parallelism_group = "ios-device"
+if platform.system() == 'Darwin':
+ ios_device = config.apple_platform != 'osx' and not config.apple_platform.endswith('sim')
+ # Force sequential execution when running tests on iOS devices.
+ if ios_device:
+ lit_config.warning('Forcing sequential execution for iOS device tests')
+ lit_config.parallelism_groups['ios-device'] = 1
+ config.parallelism_group = 'ios-device'
+
+ # Only run up to 3 processes that require shadow memory simultaneously on
+ # 64-bit Darwin. Using more scales badly and hogs the system due to
+ # inefficient handling of large mmap'd regions (terabytes) by the kernel.
+ elif config.target_arch in ['x86_64', 'x86_64h']:
+ lit_config.warning('Throttling sanitizer tests that require shadow memory on Darwin 64bit')
+ lit_config.parallelism_groups['shadow-memory'] = 3
# Multiple substitutions are necessary to support multiple shared objects used
# at once.
config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@", "lib",
"sanitizer_common", "tests")
config.test_source_root = config.test_exec_root
+
+if config.host_os == 'Darwin':
+ config.parallelism_group = config.darwin_sanitizer_parallelism_group_func
if config.host_os not in ['Linux', 'Darwin', 'NetBSD', 'FreeBSD']:
config.unsupported = True
-if config.host_os == 'Darwin':
- if config.target_arch in ["x86_64", "x86_64h"]:
- config.parallelism_group = "darwin-64bit-sanitizer"
+config.parallelism_group = 'shadow-memory'
if config.android:
config.unsupported = True
-if config.host_os == 'Darwin':
- if config.target_arch in ["x86_64", "x86_64h"]:
- config.parallelism_group = "darwin-64bit-sanitizer"
+config.parallelism_group = 'shadow-memory'
config.environment['TEMP'] = os.environ['TEMP']
if config.host_os == 'Darwin':
- # Only run up to 3 64-bit sanitized processes simultaneously on Darwin.
- # Using more scales badly and hogs the system due to inefficient handling
- # of large mmap'd regions (terabytes) by the kernel.
- lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3
+ # Only run up to 3 processes that require shadow memory simultaneously on
+ # 64-bit Darwin. Using more scales badly and hogs the system due to
+ # inefficient handling of large mmap'd regions (terabytes) by the kernel.
+ lit_config.parallelism_groups["shadow-memory"] = 3
# The test config gets pickled and sent to multiprocessing workers, and that
# only works for code if it is stored at the top level of some module.
-# Put all 64-bit sanitizer tests in the darwin-64bit-sanitizer parallelism
-# group. This will only run three of them concurrently.
+# Put all 64-bit tests in the shadow-memory parallelism group. We throttle those
+# in our common lit config (lit.common.unit.cfg).
def darwin_sanitizer_parallelism_group_func(test):
- return "darwin-64bit-sanitizer" if "x86_64" in test.file_path else ""
+ return "shadow-memory" if "x86_64" in test.file_path else None