4 changes: 4 additions & 0 deletions compiler-rt/test/asan/TestCases/default_options.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s

// FIXME: Doesn't work with DLLs
// XFAIL: win32-dynamic-asan

const char *kAsanDefaultOptions = "verbosity=1 help=1";

// Required for dyld macOS 12.0+
#if (__APPLE__)
__attribute__((weak))
Expand Down
3 changes: 3 additions & 0 deletions compiler-rt/test/asan/TestCases/on_error_callback.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s

// FIXME: Doesn't work with DLLs
// XFAIL: win32-dynamic-asan

#include <stdio.h>
#include <stdlib.h>

Expand Down
3 changes: 3 additions & 0 deletions compiler-rt/test/asan/TestCases/report_error_summary.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s

// FIXME: Doesn't work with DLLs
// XFAIL: win32-dynamic-asan

#include <stdio.h>

// Required for ld64 macOS 12.0+
Expand Down
23 changes: 2 additions & 21 deletions compiler-rt/test/asan/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ def build_invocation(compile_flags, with_lto=False):
config.compiler_rt_libdir,
"libclang_rt.asan_{}_dynamic.dylib".format(config.apple_platform),
)
elif config.host_os == "Windows":
shared_libasan_path = os.path.join(
config.compiler_rt_libdir,
"clang_rt.asan_dynamic-{}.lib".format(config.target_suffix),
)
else:
lit_config.warning(
"%shared_libasan substitution not set but dynamic ASan is available."
Expand Down Expand Up @@ -183,22 +178,8 @@ def build_invocation(compile_flags, with_lto=False):
base_lib = os.path.join(
config.compiler_rt_libdir, "clang_rt.asan%%s%s.lib" % config.target_suffix
)
config.substitutions.append(("%asan_lib", base_lib % "_dynamic"))
if config.asan_dynamic:
config.substitutions.append(
("%asan_thunk", base_lib % "_dynamic_runtime_thunk")
)
else:
config.substitutions.append(
("%asan_thunk", base_lib % "_static_runtime_thunk")
)
config.substitutions.append(("%asan_lib", base_lib % ""))
config.substitutions.append(("%asan_cxx_lib", base_lib % "_cxx"))
config.substitutions.append(
("%asan_dynamic_runtime_thunk", base_lib % "_dynamic_runtime_thunk")
)
config.substitutions.append(
("%asan_static_runtime_thunk", base_lib % "_static_runtime_thunk")
)
config.substitutions.append(("%asan_dll_thunk", base_lib % "_dll_thunk"))
else:
# To make some of these tests work on MinGW target without changing their
Expand Down Expand Up @@ -281,7 +262,7 @@ def build_invocation(compile_flags, with_lto=False):

# Add the RT libdir to PATH directly so that we can successfully run the gtest
# binary to list its tests.
if config.host_os == "Windows":
if config.host_os == "Windows" and config.asan_dynamic:
os.environ["PATH"] = os.path.pathsep.join(
[config.compiler_rt_libdir, os.environ.get("PATH", "")]
)
Expand Down