aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-23 18:05:01 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-23 18:05:01 +0000
commitd1f5ff717dc019a01cae2d8d4bfe941a5eb6f67b (patch)
treeccf24557c69325a1b108eea10e2cefc0f4b51f5b
parentfa708259cb518e87a2e7f636671b94a49f823608 (diff)
Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56493 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/no-exit-cfg.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Analysis/no-exit-cfg.c b/test/Analysis/no-exit-cfg.c
new file mode 100644
index 0000000000..b61abf548f
--- /dev/null
+++ b/test/Analysis/no-exit-cfg.c
@@ -0,0 +1,18 @@
+// RUN: clang -checker-cfref -verify %s
+
+// This is a test case for the issue reported in PR 2819:
+// http://llvm.org/bugs/show_bug.cgi?id=2819
+// The flow-sensitive dataflow solver should work even when no block in
+// the CFG reaches the exit block.
+
+int g(int x);
+void h(int x);
+
+int f(int x)
+{
+out_err:
+ if (g(x)) {
+ h(x);
+ }
+ goto out_err;
+}