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