Author: rsmith
Date: Thu Mar 10 13:22:21 2016
New Revision: 263155

URL: http://llvm.org/viewvc/llvm-project?rev=263155&view=rev
Log:
Add test for r263138.

Added:
    cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp

Added: cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp?rev=263155&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp 
(added)
+++ cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp Thu 
Mar 10 13:22:21 2016
@@ -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;
+  }
+}


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to