diff --git a/src/test/py/bazel/bazel_windows_cpp_test.py b/src/test/py/bazel/bazel_windows_cpp_test.py index f8ae542de5c176..b97e91cb4d097a 100644 --- a/src/test/py/bazel/bazel_windows_cpp_test.py +++ b/src/test/py/bazel/bazel_windows_cpp_test.py @@ -789,7 +789,11 @@ def testBuildWithClangClByToolchainResolution(self): '', 'cc_binary(', ' name = "main",', - ' srcs = ["main.cc"],', + ' srcs = [' + ' "main.cc",', + ' "inc.asm",', # Test assemble action_config + ' "dec.S",', # Test preprocess-assemble action_config + ' ],', ')', ]) self.ScratchFile('main.cc', [ @@ -797,6 +801,26 @@ def testBuildWithClangClByToolchainResolution(self): ' return 0;', '}', ]) + self.ScratchFile('inc.asm', [ + '.code', + 'PUBLIC increment', + 'increment PROC x:WORD', + ' xchg rcx,rax', + ' inc rax', + ' ret', + 'increment EndP', + 'END', + ]) + self.ScratchFile('dec.S', [ + '.code', + 'PUBLIC decrement', + 'decrement PROC x:WORD', + ' xchg rcx,rax', + ' dec rax', + ' ret', + 'decrement EndP', + 'END', + ]) exit_code, _, stderr = self.RunBazel(['build', '-s', '//:main']) self.AssertExitCode(exit_code, 0, stderr) self.assertIn('clang-cl.exe', ''.join(stderr)) diff --git a/tools/cpp/windows_cc_configure.bzl b/tools/cpp/windows_cc_configure.bzl index ea1ffb3872c3a8..7f612f3e3f8b8a 100644 --- a/tools/cpp/windows_cc_configure.bzl +++ b/tools/cpp/windows_cc_configure.bzl @@ -794,7 +794,8 @@ def _get_clang_cl_vars(repository_ctx, paths, msvc_vars, target_arch): "%{clang_cl_cl_path_" + target_arch + "}": clang_cl_path, "%{clang_cl_link_path_" + target_arch + "}": lld_link_path, "%{clang_cl_lib_path_" + target_arch + "}": llvm_lib_path, - "%{clang_cl_ml_path_" + target_arch + "}": clang_cl_path, + # clang-cl does not support assembly files as input. + "%{clang_cl_ml_path_" + target_arch + "}": msvc_vars["%{msvc_ml_path_" + target_arch + "}"], # LLVM's lld-link.exe doesn't support /DEBUG:FASTLINK. "%{clang_cl_dbg_mode_debug_flag_" + target_arch + "}": "/DEBUG", "%{clang_cl_fastbuild_mode_debug_flag_" + target_arch + "}": "/DEBUG",