[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 18:44:04 PST 2024


================
@@ -0,0 +1,11 @@
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+//
+// Note: see also cl-zc.cpp
+
+// RUN: %clang_cl /TC /dev/null /E -Xclang -dM /Zc:__STDC__- 2>&1 | FileCheck %s --check-prefix=ZCSTDCIGNORED
+// ZCSTDCIGNORED-NOT: #define __STDC__ 1
+// ZCSTDCIGNORED: argument unused during compilation
+
+// RUN: not %clang -Xclang -fno-ms-define-stdc %s 2>&1 | FileCheck %s --check-prefix="NOARG"
----------------
MaskRay wrote:

This tests that -fno-ms-define-stdc is not a cc1 option. We almost never do it. There could be a value to test whether the driver -fno-ms-define-stdc option is present.

https://github.com/llvm/llvm-project/pull/68690


More information about the cfe-commits mailing list