about summary refs log tree commit diff homepage
path: root/test/Runtime/POSIX/FreeArgv.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Runtime/POSIX/FreeArgv.c')
-rw-r--r--test/Runtime/POSIX/FreeArgv.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Runtime/POSIX/FreeArgv.c b/test/Runtime/POSIX/FreeArgv.c
new file mode 100644
index 00000000..37909b80
--- /dev/null
+++ b/test/Runtime/POSIX/FreeArgv.c
@@ -0,0 +1,20 @@
+// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc
+// RUN: %klee --init-env --posix-runtime %t.bc --sym-args 1 1 1
+// RUN: test -f klee-last/test000001.free.err
+// RUN: test -f klee-last/test000002.free.err
+// RUN: test -f klee-last/test000003.free.err
+
+int main(int argc, char **argv) {
+  switch(klee_range(0, 3, "range")) {
+  case 0:
+    free(argv);
+    break;
+  case 1:
+    free(argv[0]);
+    break;
+  case 2:
+    free(argv[1]);
+    break;
+  }
+  return 0;
+}