[cfe-commits] r93503 - /cfe/trunk/test/Sema/warn-unreachable.c
Mike Stump
mrs at apple.com
Thu Jan 14 19:15:37 PST 2010
Author: mrs
Date: Thu Jan 14 21:15:36 2010
New Revision: 93503
URL: http://llvm.org/viewvc/llvm-project?rev=93503&view=rev
Log:
Add testcase for recent checkin.
Added:
cfe/trunk/test/Sema/warn-unreachable.c
Added: cfe/trunk/test/Sema/warn-unreachable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-unreachable.c?rev=93503&view=auto
==============================================================================
--- cfe/trunk/test/Sema/warn-unreachable.c (added)
+++ cfe/trunk/test/Sema/warn-unreachable.c Thu Jan 14 21:15:36 2010
@@ -0,0 +1,20 @@
+// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code
+
+void test1() {
+ goto c;
+ d:
+ goto e; // expected-warning {{will never be executed}}
+ c: ;
+ int i;
+ return;
+ goto b; // expected-warning {{will never be executed}}
+ goto a; // expected-warning {{will never be executed}}
+ b:
+ i = 1;
+ a:
+ i = 2;
+ goto f;
+ e:
+ goto d;
+ f: ;
+}
More information about the cfe-commits
mailing list