Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / drs / dr2390.cpp
blobd8ab1e9a1b3853bd60f38a186fe8294c334a776e
1 // RUN: %clang_cc1 -E -P %s -o - | FileCheck %s
3 // dr2390: yes
5 namespace PR48462 {
6 // Test that macro expansion of the builtin argument works.
7 #define C clang
8 #define F fallthrough
9 #define CF clang::fallthrough
11 #if __has_cpp_attribute(F)
12 int has_fallthrough;
13 #endif
14 // CHECK: int has_fallthrough;
16 #if __has_cpp_attribute(C::F)
17 int has_clang_fallthrough_1;
18 #endif
19 // CHECK: int has_clang_fallthrough_1;
21 #if __has_cpp_attribute(clang::F)
22 int has_clang_fallthrough_2;
23 #endif
24 // CHECK: int has_clang_fallthrough_2;
26 #if __has_cpp_attribute(C::fallthrough)
27 int has_clang_fallthrough_3;
28 #endif
29 // CHECK: int has_clang_fallthrough_3;
31 #if __has_cpp_attribute(CF)
32 int has_clang_fallthrough_4;
33 #endif
34 // CHECK: int has_clang_fallthrough_4;
36 #define FUNCLIKE1(x) clang::x
37 #if __has_cpp_attribute(FUNCLIKE1(fallthrough))
38 int funclike_1;
39 #endif
40 // CHECK: int funclike_1;
42 #define FUNCLIKE2(x) _Clang::x
43 #if __has_cpp_attribute(FUNCLIKE2(fallthrough))
44 int funclike_2;
45 #endif
46 // CHECK: int funclike_2;
47 } // namespace PR48462