24 lines · c
1// RUN: %clang_cc1 -DFIRST_WAY -E -dM %s | FileCheck --strict-whitespace %s2// RUN: %clang_cc1 -DFIRST_WAY -fms-compatibility -E -dM %s | FileCheck --strict-whitespace %s3// RUN: %clang_cc1 -E -dM %s | FileCheck --strict-whitespace %s4// RUN: %clang_cc1 -fms-compatibility -E -dM %s | FileCheck --strict-whitespace %s5 6// If the assert macro is defined in MS compatibility mode in C, we7// automatically inject a macro definition for static_assert. Test that the8// macro is not added if there is already a definition of static_assert to9// ensure that we don't re-define the macro in the event the Microsoft assert.h10// header starts to define the macro some day (or the user defined their own11// macro with the same name). Test that the order of the macro definitions does12// not matter to the behavior.13 14#ifdef FIRST_WAY15#define static_assert 1216#define assert17#else18#define assert19#define static_assert 1220#endif21 22CHECK: #define static_assert 1223 24