about summary refs log tree commit diff homepage
path: root/test/DeterministicAllocation/double-free.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/DeterministicAllocation/double-free.c')
-rw-r--r--test/DeterministicAllocation/double-free.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/DeterministicAllocation/double-free.c b/test/DeterministicAllocation/double-free.c
new file mode 100644
index 00000000..141427fa
--- /dev/null
+++ b/test/DeterministicAllocation/double-free.c
@@ -0,0 +1,16 @@
+// RUN: %clang %s -emit-llvm -g -c -o %t.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee -kdalloc -kdalloc-quarantine=1 -output-dir=%t.klee-out %t.bc -exit-on-error >%t.output 2>&1
+// RUN: FileCheck %s -input-file=%t.output
+
+#include <stdlib.h>
+
+int main() {
+  void *ptr = malloc(8);
+  free(ptr);
+
+  // CHECK: double free
+  free(ptr);
+
+  return 0;
+}