xref: /llvm-project/clang/test/Preprocessor/static_assert.c (revision 8da090381d567d0ec555840f6b2a651d2997e4b3)
1 // RUN: %clang_cc1 -E -dM %s | FileCheck --strict-whitespace --check-prefix=NOMS %s
2 // RUN: %clang_cc1 -fms-compatibility -E -dM %s | FileCheck --strict-whitespace --check-prefix=MS %s
3 
4 // If the assert macro is defined in MS compatibility mode in C, we
5 // automatically inject a macro definition for static_assert. Test that the
6 // macro is properly added to the preprocessed output. This allows us to
7 // diagonse use of the static_assert keyword when <assert.h> has not been
8 // included while still being able to compile preprocessed code.
9 #define assert
10 
11 MS: #define static_assert _Static_assert
12 NOMS-NOT: #define static_assert _Static_assert
13