diff --git a/compiler-rt/lib/asan/asan_win.cpp b/compiler-rt/lib/asan/asan_win.cpp --- a/compiler-rt/lib/asan/asan_win.cpp +++ b/compiler-rt/lib/asan/asan_win.cpp @@ -173,7 +173,9 @@ ASAN_INTERCEPT_FUNC(__C_specific_handler); #else ASAN_INTERCEPT_FUNC(_except_handler3); +#if ASAN_DYNAMIC || !defined(__MINGW32__) ASAN_INTERCEPT_FUNC(_except_handler4); +#endif #endif // Try to intercept kernel32!RaiseException, and if that fails, intercept diff --git a/compiler-rt/test/asan/Unit/lit.site.cfg.py.in b/compiler-rt/test/asan/Unit/lit.site.cfg.py.in --- a/compiler-rt/test/asan/Unit/lit.site.cfg.py.in +++ b/compiler-rt/test/asan/Unit/lit.site.cfg.py.in @@ -48,6 +48,10 @@ config.test_source_root = config.test_exec_root +target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple)) +if config.host_os == 'Windows' and not @ASAN_TEST_DYNAMIC@ and not target_is_msvc: + config.unsupported = True + # When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of # config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the # host triple as the trailing path component. The value is incorrect for i386 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 @@ -244,6 +244,9 @@ if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'SunOS', 'Windows', 'NetBSD']: config.unsupported = True +if config.host_os == 'Windows' and not config.asan_dynamic and not target_is_msvc: + config.unsupported = True + if not config.parallelism_group: config.parallelism_group = 'shadow-memory' diff --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py --- a/llvm/utils/lit/lit/formats/googletest.py +++ b/llvm/utils/lit/lit/formats/googletest.py @@ -28,6 +28,9 @@ self.run_under = run_under def get_num_tests(self, path, litConfig, localConfig): + if localConfig.unsupported: + return 0 + list_test_cmd = self.prepareCmd( [path, '--gtest_list_tests', '--gtest_filter=-*DISABLED_*']) try: @@ -132,6 +135,9 @@ if litConfig.noExecute: return lit.Test.PASS, '' + if test.config.unsupported: + return lit.Test.UNSUPPORTED, '' + def get_shard_header(shard_env): shard_envs = ' '.join([k + '=' + v for k, v in shard_env.items()]) return f"Script(shard):\n--\n%s %s\n--\n" % (shard_envs, ' '.join(cmd))