From 8d251f18bd657a8f72f5f62c073f93a5dac5e2d3 Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Tue, 12 Mar 2024 10:18:19 -0700 Subject: [PATCH] Detect MSVC as a compiler-id for lit. This is only for "real" msvc and is to support running sanitizer tests with "real" MSVC --- compiler-rt/cmake/base-config-ix.cmake | 2 ++ compiler-rt/test/lit.common.cfg.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake index 5a97992756a9c..286a622a4b520 100644 --- a/compiler-rt/cmake/base-config-ix.cmake +++ b/compiler-rt/cmake/base-config-ix.cmake @@ -81,6 +81,8 @@ if("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[+]*$") set(COMPILER_RT_TEST_COMPILER_ID Clang) elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang.*.exe$") set(COMPILER_RT_TEST_COMPILER_ID Clang) +elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "cl.exe$") + set(COMPILER_RT_TEST_COMPILER_ID MSVC) else() set(COMPILER_RT_TEST_COMPILER_ID GNU) endif() diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index 1c6fbc80cd413..c533c7e9a7047 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -148,6 +148,9 @@ def push_dynamic_library_lookup_path(config, new_path): # requested it because it makes ASan reports more precise. config.debug_info_flags.append("-gcodeview") config.debug_info_flags.append("-gcolumn-info") +elif compiler_id == "MSVC": + config.debug_info_flags = ["/Z7"] + config.cxx_mode_flags = [] elif compiler_id == "GNU": config.cxx_mode_flags = ["-x c++"] config.debug_info_flags = ["-g"]