mirror of https://github.com/microsoft/clang.git
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:
parent
dfc9e6a5fb
commit
1d90e7928e
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue