summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/unreachable-code-path.c
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-07-27 03:39:53 +0000
committerJordy Rose <jediknil@belkadan.com>2010-07-27 03:39:53 +0000
commit55442abee6a51f132de780eef47728e9fe8da9c1 (patch)
treeaaeb406b8b74bdd4a4e3252e88cf01d03ef3e9e6 /clang/test/Analysis/unreachable-code-path.c
parent2bd41d1e30fd1bcea568d9f1c68d1e802caf803f (diff)
downloadbcm5719-llvm-55442abee6a51f132de780eef47728e9fe8da9c1.tar.gz
bcm5719-llvm-55442abee6a51f132de780eef47728e9fe8da9c1.zip
Don't warn about unreachable code if the block starts with __builtin_unreachable().
The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810. llvm-svn: 109487
Diffstat (limited to 'clang/test/Analysis/unreachable-code-path.c')
-rw-r--r--clang/test/Analysis/unreachable-code-path.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/unreachable-code-path.c b/clang/test/Analysis/unreachable-code-path.c
index cfe0408c3fe..e7e1d0b3ebc 100644
--- a/clang/test/Analysis/unreachable-code-path.c
+++ b/clang/test/Analysis/unreachable-code-path.c
@@ -53,3 +53,9 @@ void test5(const char *c) {
}
}
+void test6(const char *c) {
+ if (c) return;
+ if (!c) return;
+ __builtin_unreachable(); // no-warning
+}
+
OpenPOWER on IntegriCloud