Skip to content

[Darwin][Test][leaks] Disable leak detection for asan tests on non-Intel Darwin devices #131676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions compiler-rt/test/asan/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ def get_required_attr(config, attr_name):
default_asan_opts = list(config.default_sanitizer_opts)

# On Darwin, leak checking is not enabled by default. Enable on macOS
# tests to prevent regressions
if config.host_os == "Darwin" and config.apple_platform == "osx":
# tests to prevent regressions.
# Currently, detect_leaks for asan tests only work on Intel MacOS.
if (
config.host_os == "Darwin"
and config.apple_platform == "osx"
and config.target_arch == "x86_64"
):
default_asan_opts += ["detect_leaks=1"]

default_asan_opts_str = ":".join(default_asan_opts)
Expand Down Expand Up @@ -273,7 +278,11 @@ def build_invocation(compile_flags, with_lto=False):
and (not config.android)
and (config.target_arch in ["x86_64", "i386", "riscv64", "loongarch64"])
)
leak_detection_mac = (config.host_os == "Darwin") and (config.apple_platform == "osx")
leak_detection_mac = (
(config.host_os == "Darwin")
and (config.apple_platform == "osx")
and (config.target_arch == "x86_64")
)
leak_detection_netbsd = (config.host_os == "NetBSD") and (
config.target_arch in ["x86_64", "i386"]
)
Expand Down