about summary refs log tree commit diff homepage
path: root/test/Merging/indirect_value.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Merging/indirect_value.c')
-rw-r--r--test/Merging/indirect_value.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Merging/indirect_value.c b/test/Merging/indirect_value.c
new file mode 100644
index 00000000..ffea14ec
--- /dev/null
+++ b/test/Merging/indirect_value.c
@@ -0,0 +1,32 @@
+// 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 --debug-log-merge --search=nurs:covnew --use-batching-search %t.bc 2>&1 | FileCheck %s
+
+// CHECK: generated tests = 2{{$}}
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <klee/klee.h>
+
+int main(int argc, char** argv) {
+
+  int sym = klee_int("sym");
+  int* heap_int = calloc(1, sizeof(*heap_int));
+
+  klee_open_merge();
+
+  if(sym != 0) {
+    *heap_int = 1;
+  }
+
+  klee_close_merge();
+
+  klee_print_expr("*heap_int: ", *heap_int);
+  if(*heap_int != 0) {
+    printf("true\n");
+  } else {
+    printf("false\n");
+  }
+
+  return 0;
+}