diff --git a/compiler-rt/test/asan/lit.cfg.py b/compiler-rt/test/asan/lit.cfg.py --- a/compiler-rt/test/asan/lit.cfg.py +++ b/compiler-rt/test/asan/lit.cfg.py @@ -59,9 +59,9 @@ # Platform-specific default ASAN_OPTIONS for lit tests. default_asan_opts = list(config.default_sanitizer_opts) -# On Darwin, leak checking is not enabled by default. Enable for x86_64 +# On Darwin, leak checking is not enabled by default. Enable on macOS # tests to prevent regressions -if config.host_os == 'Darwin' and config.target_arch == 'x86_64': +if config.host_os == 'Darwin' and config.apple_platform == 'osx': default_asan_opts += ['detect_leaks=1'] default_asan_opts_str = ':'.join(default_asan_opts) @@ -203,7 +203,7 @@ # Turn on leak detection on 64-bit Linux. leak_detection_android = config.android and 'android-thread-properties-api' in config.available_features and (config.target_arch in ['x86_64', 'i386', 'i686', 'aarch64']) leak_detection_linux = (config.host_os == 'Linux') and (not config.android) and (config.target_arch in ['x86_64', 'i386', 'riscv64']) -leak_detection_mac = (config.host_os == 'Darwin') and (config.target_arch == 'x86_64') +leak_detection_mac = (config.host_os == 'Darwin') and (config.apple_platform == 'osx') leak_detection_netbsd = (config.host_os == 'NetBSD') and (config.target_arch in ['x86_64', 'i386']) if leak_detection_android or leak_detection_linux or leak_detection_mac or leak_detection_netbsd: config.available_features.add('leak-detection')