[PATCH] D40285: [MINGW] normalize WIN32 macros

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 03:03:48 PST 2017


mstorsjo accepted this revision.
mstorsjo added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: test/Preprocessor/predefined-macros.c:200
+// CHECK-X86-WIN: #define _WIN32 1
+// CHECK-X86-WIN-NOT: #define _WIN64 1
+// CHECK-X86-WIN-NOT: #define WINNT 1
----------------
In general, these kinds of `-NOT` tests don't work quite as one would want here - if the non-wanted `#define _WIN64` would appear before the expected `#define _WIN32`, it would actually pass this test. Usually the `-DAG` kinds of checks can be used to avoid that issue. Not sure how well it mixes with `-DAG` and `-DAG-NOT` though.

Can we assume that these defines appear in alphabetical order? In that case, we can be pretty sure to catch the issue if they're reordered slightly. This at least clearly documents what is the intended behaviour in any case.


Repository:
  rL LLVM

https://reviews.llvm.org/D40285





More information about the cfe-commits mailing list