stmt-attrs.cpp 476 B

123456789101112131415161718192021222324
  1. // RUN: %clang_cc1 -std=c++11 -emit-pch -o %t.a %s
  2. // RUN: %clang_cc1 -std=c++11 -include-pch %t.a %s -ast-print -o - | FileCheck %s
  3. #ifndef HEADER
  4. #define HEADER
  5. inline void test(int i) {
  6. switch (i) {
  7. case 1:
  8. // Notice that the NullStmt has two attributes.
  9. // CHECK: {{\[\[clang::fallthrough\]\] \[\[clang::fallthrough\]\]}}
  10. [[clang::fallthrough]] [[clang::fallthrough]];
  11. case 2:
  12. break;
  13. }
  14. }
  15. #else
  16. void foo(void) {
  17. test(1);
  18. }
  19. #endif