summaryrefslogtreecommitdiffstats
path: root/test/Headers/ms-null-ms-header-vs-stddef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Headers/ms-null-ms-header-vs-stddef.cpp')
-rw-r--r--test/Headers/ms-null-ms-header-vs-stddef.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Headers/ms-null-ms-header-vs-stddef.cpp b/test/Headers/ms-null-ms-header-vs-stddef.cpp
new file mode 100644
index 0000000..7efa871
--- /dev/null
+++ b/test/Headers/ms-null-ms-header-vs-stddef.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang -fsyntax-only -target i686-pc-win32 %s
+// RUN: %clang -fsyntax-only -target i386-mingw32 %s
+
+// Something in MSVC's headers (pulled in e.g. by <crtdefs.h>) defines __null
+// to something, mimick that.
+#define __null
+
+#include <stddef.h>
+
+// __null is used as a type annotation in MS headers, with __null defined to
+// nothing in regular builds. This should continue to work even with stddef.h
+// included.
+void f(__null void* p) { }
+
+// NULL should work fine even with __null defined to nothing.
+void* p = NULL;
OpenPOWER on IntegriCloud