Saleem Abdulrasool | c68237b | 2014-07-16 03:13:50 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -fms-compatibility -fms-compatibility-version=17.00 %s |
Chandler Carruth | 2c93cb2 | 2013-09-20 21:12:25 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -triple i386-mingw32 %s |
Nico Weber | 1d725ec | 2012-04-24 21:27:01 +0000 | [diff] [blame] | 3 | |
| 4 | // Something in MSVC's headers (pulled in e.g. by <crtdefs.h>) defines __null |
| 5 | // to something, mimick that. |
| 6 | #define __null |
| 7 | |
| 8 | #include <stddef.h> |
| 9 | |
| 10 | // __null is used as a type annotation in MS headers, with __null defined to |
| 11 | // nothing in regular builds. This should continue to work even with stddef.h |
| 12 | // included. |
| 13 | void f(__null void* p) { } |
| 14 | |
| 15 | // NULL should work fine even with __null defined to nothing. |
| 16 | void* p = NULL; |