[PATCH] D98278: [test] Only use hardcoded errno messages when compiling with an MSVC implementation

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 01:39:38 PST 2021


zero9178 added a comment.

In D98278#2616022 <https://reviews.llvm.org/D98278#2616022>, @jhenderson wrote:

> Just to confirm, the problem is when using libc++ that the previous attempt doesn't fix?
>
> If so, I come back to my previous thought, namely that we could try leveraging https://cmake.org/cmake/help/latest/command/exec_program.html to run a program, and check its output to determine what pattern the messages will be. I'm not a CMake expert however, so I don't know how to get CMake to build that program at configuration time, prior to executing it. However, if we can get this to work, it would solve the issue no matter what C++ library is being used.

The previous attempt only fixes it on Windows when using MSVC. In my case I am running a MinGW clang toolchain which uses libc++, but one may also use libstdc++ or even libc++ in an MSVC environment.

Regarding the latter, since this is functionality of lit in general and is used in other projects in the Mono repo, not just llvm, is there some CMake config that configures lit, regardless of the test-suite run? 
A quick grep shows that %errc_* is eg. used by clang and lld as well. I was under the impression that projects may only influence the lit config through their lit.site.cfg.py.in. So if we were to add those checks to the cmake config of llvm/test those would not affect other test suites. Patching those projects lit.size.cfg.py.in to also pass the used Standard Library implementation would obviously not be a problem however.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98278/new/

https://reviews.llvm.org/D98278



More information about the llvm-commits mailing list