diff --git a/compiler-rt/test/asan/lit.cfg.py b/compiler-rt/test/asan/lit.cfg.py index 83b3cbe789cac..b185f29636116 100644 --- a/compiler-rt/test/asan/lit.cfg.py +++ b/compiler-rt/test/asan/lit.cfg.py @@ -102,11 +102,11 @@ def get_required_attr(config, attr_name): def build_invocation(compile_flags, with_lto=False): - lto_flags = [] - if with_lto and config.lto_supported: - lto_flags += config.lto_flags + lto_flags = config.lto_flags if with_lto and config.lto_supported else [] + + invocation = [config.clang] + lto_flags + compile_flags + return " ".join(invocation) + " " - return " " + " ".join([config.clang] + lto_flags + compile_flags) + " " config.substitutions.append(("%clang ", build_invocation(target_cflags)))