Add test for r263138.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263155 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Smith 2016-03-10 19:22:21 +00:00
parent dfc9e6a5fb
commit 1d90e7928e
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -DUNREACHABLE=1 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -DUNREACHABLE=0 -Wimplicit-fallthrough %s
void fallthrough(int n) {
switch (n) {
case 1:
if (UNREACHABLE)
return;
[[fallthrough]]; // expected-no-diagnostics, only checked when UNREACHABLE=0
case 2:
break;
}
}