Index: llvm/utils/lit/lit/llvm/config.py =================================================================== --- llvm/utils/lit/lit/llvm/config.py +++ llvm/utils/lit/lit/llvm/config.py @@ -347,10 +347,10 @@ return True def add_err_msg_substitutions(self): - host_cxx = getattr(self.config, 'host_cxx', '') - # On Windows, python's os.strerror() does not emit the same spelling as the C++ std::error_code. - # As a workaround, hardcode the Windows error message. - if (sys.platform == 'win32' and 'MSYS' not in host_cxx): + # When using Visual Studio, python's os.strerror() does not emit the same spelling as the C++ std::error_code. + # As a workaround, hardcode the Visual Studio error messages. + host_triple = getattr(self.config, 'host_triple', '') + if re.search(r'windows-msvc', host_triple): self.config.substitutions.append(('%errc_ENOENT', '\'no such file or directory\'')) self.config.substitutions.append(('%errc_EISDIR', '\'is a directory\'')) self.config.substitutions.append(('%errc_EINVAL', '\'invalid argument\''))