about summary refs log tree commit diff homepage
path: root/test/Merging/unexpected_close.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Merging/unexpected_close.c')
-rw-r--r--test/Merging/unexpected_close.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Merging/unexpected_close.c b/test/Merging/unexpected_close.c
new file mode 100644
index 00000000..b4994de1
--- /dev/null
+++ b/test/Merging/unexpected_close.c
@@ -0,0 +1,35 @@
+// RUN: %llvmgcc -emit-llvm -g -c -o %t.bc %s
+// RUN: rm -rf %t.klee-out
+// RUN: klee --output-dir=%t.klee-out --use-merge --search=nurs:covnew --max-time=2 %t.bc
+
+// CHECK: ran into a close at
+// CHECK: generated tests = 2{{$}}
+
+#include <klee/klee.h>
+
+int main(int argc, char **args) {
+
+  int x;
+  int a;
+  int foo = 0;
+
+  klee_make_symbolic(&x, sizeof(x), "x");
+  klee_make_symbolic(&a, sizeof(a), "a");
+
+  if (a == 0) {
+    klee_open_merge();
+
+    if (x == 1) {
+      foo = 5;
+    } else if (x == 2) {
+      foo = 6;
+    } else {
+      foo = 7;
+    }
+
+    klee_close_merge();
+  }
+  klee_close_merge();
+
+  return foo;
+}