xref: /minix3/external/bsd/llvm/dist/clang/test/Headers/ms-null-ms-header-vs-stddef.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -fms-compatibility -fms-compatibility-version=17.00 %s
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -triple i386-mingw32 %s
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc // Something in MSVC's headers (pulled in e.g. by <crtdefs.h>) defines __null
5f4a2713aSLionel Sambuc // to something, mimick that.
6f4a2713aSLionel Sambuc #define __null
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc #include <stddef.h>
9f4a2713aSLionel Sambuc 
10f4a2713aSLionel Sambuc // __null is used as a type annotation in MS headers, with __null defined to
11f4a2713aSLionel Sambuc // nothing in regular builds. This should continue to work even with stddef.h
12f4a2713aSLionel Sambuc // included.
f(__null void * p)13f4a2713aSLionel Sambuc void f(__null void* p) { }
14f4a2713aSLionel Sambuc 
15f4a2713aSLionel Sambuc // NULL should work fine even with __null defined to nothing.
16f4a2713aSLionel Sambuc void* p = NULL;
17