xref: /aosp_15_r20/external/clang/test/PCH/stmt-attrs.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -emit-pch -o %t.a %s
2*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -include-pch %t.a %s -ast-print -o - | FileCheck %s
3*67e74705SXin Li 
4*67e74705SXin Li #ifndef HEADER
5*67e74705SXin Li #define HEADER
6*67e74705SXin Li 
test(int i)7*67e74705SXin Li inline void test(int i) {
8*67e74705SXin Li   switch (i) {
9*67e74705SXin Li     case 1:
10*67e74705SXin Li       // Notice that the NullStmt has two attributes.
11*67e74705SXin Li       // CHECK: {{\[\[clang::fallthrough\]\] \[\[clang::fallthrough\]\]}}
12*67e74705SXin Li       [[clang::fallthrough]] [[clang::fallthrough]];
13*67e74705SXin Li     case 2:
14*67e74705SXin Li       break;
15*67e74705SXin Li   }
16*67e74705SXin Li }
17*67e74705SXin Li 
18*67e74705SXin Li #else
19*67e74705SXin Li 
foo(void)20*67e74705SXin Li void foo(void) {
21*67e74705SXin Li   test(1);
22*67e74705SXin Li }
23*67e74705SXin Li 
24*67e74705SXin Li #endif
25