[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / Preprocessor / static_assert-already-defined.c
blob1308e123100c8483f4d30b92c0c060b01ae59f1f
1 // RUN: %clang_cc1 -DFIRST_WAY -E -dM %s | FileCheck --strict-whitespace %s
2 // RUN: %clang_cc1 -DFIRST_WAY -fms-compatibility -E -dM %s | FileCheck --strict-whitespace %s
3 // RUN: %clang_cc1 -E -dM %s | FileCheck --strict-whitespace %s
4 // RUN: %clang_cc1 -fms-compatibility -E -dM %s | FileCheck --strict-whitespace %s
6 // If the assert macro is defined in MS compatibility mode in C, we
7 // automatically inject a macro definition for static_assert. Test that the
8 // macro is not added if there is already a definition of static_assert to
9 // ensure that we don't re-define the macro in the event the Microsoft assert.h
10 // header starts to define the macro some day (or the user defined their own
11 // macro with the same name). Test that the order of the macro definitions does
12 // not matter to the behavior.
14 #ifdef FIRST_WAY
15 #define static_assert 12
16 #define assert
17 #else
18 #define assert
19 #define static_assert 12
20 #endif
22 CHECK: #define static_assert 12