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