summaryrefslogtreecommitdiffstats
path: root/test/Analysis/no-exit-cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/no-exit-cfg.c')
-rw-r--r--test/Analysis/no-exit-cfg.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Analysis/no-exit-cfg.c b/test/Analysis/no-exit-cfg.c
new file mode 100644
index 0000000..cad2127
--- /dev/null
+++ b/test/Analysis/no-exit-cfg.c
@@ -0,0 +1,19 @@
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -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;
+}
OpenPOWER on IntegriCloud