[PATCH] D151661: [clang] [test] Narrow down an MSVC specific behaviour to only not covever MinGW
Martin Storsjö via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 29 23:59:52 PDT 2023
mstorsjo added a comment.
In D151661#4379958 <https://reviews.llvm.org/D151661#4379958>, @Endill wrote:
> Thank you!
> I've asked Aaron what is the best way to check for MSVC-like triple before relanding this test. So today we both learned.
Generally, the canonical way to check for it is `#ifdef _MSC_VER` - however in the `%clang_cc1` tests, it's not automatically defined. This, because the driver heuristically tries to guess a MSVC version to mimic, which it then passes as a version number to `clang -cc1` with `-fms-compatibility-version` or similar. When invoking `clang -cc1` manually, this doesn't get set and `_MSC_VER` is undefined. (I'm considering changing code to make sure that `_MSC_VER` always is defined in such cases too, even to a dummy version number .)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151661/new/
https://reviews.llvm.org/D151661
More information about the cfe-commits
mailing list