[compiler-rt] 81935c5 - [compiler-rt] [MSVC] Detect MSVC as a compiler-id for lit. (#108255)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 12 10:30:17 PDT 2024
Author: Charlie Barto
Date: 2024-09-12T10:30:13-07:00
New Revision: 81935c5e96ef9310bb16a18ea1d74fb64eaf43da
URL: https://github.com/llvm/llvm-project/commit/81935c5e96ef9310bb16a18ea1d74fb64eaf43da
DIFF: https://github.com/llvm/llvm-project/commit/81935c5e96ef9310bb16a18ea1d74fb64eaf43da.diff
LOG: [compiler-rt] [MSVC] Detect MSVC as a compiler-id for lit. (#108255)
This is only for "real" msvc and is to support running sanitizer tests
with "real" MSVC. Most compiler-rt tests do not yet pass with msvc,
which will be addressed in future PRs for asan, sanitizer_common, and
the fuzzer.
We've been using these changes to lit to run CI for the version of
address sanitizer that ships with MSVC, by upstreaming them we can avoid
being broken by future lit changes and allow contributors (importantly
_us_) to run the MSVC tests on changes developed in the open.
Added:
Modified:
compiler-rt/cmake/base-config-ix.cmake
compiler-rt/test/lit.common.cfg.py
Removed:
################################################################################
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 5a97992756a9c9..286a622a4b5202 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 1c6fbc80cd4137..c533c7e9a70476 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"]
More information about the llvm-commits
mailing list