about summary refs log tree commit diff homepage
path: root/test/Runtime
diff options
context:
space:
mode:
authorTimotej Kapus <timotej.kapus13@imperial.ac.uk>2017-12-13 17:37:16 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-05-17 15:38:14 +0100
commit8bec949fc84d8fe8dacbf38ff123b404f1eb4737 (patch)
tree2d703f77babe6ff009574049e9d01757453a4ed1 /test/Runtime
parent8fe14b1041f39b61cdb43c32840f3d2cb97cc110 (diff)
downloadklee-8bec949fc84d8fe8dacbf38ff123b404f1eb4737.tar.gz
Add support for concretizing symbolic objects passed to external functions
Diffstat (limited to 'test/Runtime')
-rw-r--r--test/Runtime/POSIX/MixedConcreteSymbolic.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Runtime/POSIX/MixedConcreteSymbolic.c b/test/Runtime/POSIX/MixedConcreteSymbolic.c
new file mode 100644
index 00000000..48e06934
--- /dev/null
+++ b/test/Runtime/POSIX/MixedConcreteSymbolic.c
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee --output-dir=%t.klee-out -allow-external-sym-calls --exit-on-error --libc=uclibc --posix-runtime %t.bc --sym-stdin 10  2>%t.log | FileCheck %s
+
+#include "klee/klee.h"
+#include <assert.h>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+  char buf[32];
+
+  fread(buf, 1, 4, stdin);
+  klee_assume(buf[0] == 'a');
+  klee_assume(buf[1] > 'a');
+  klee_assume(buf[1] < 'z');
+  klee_assume(buf[2] == '\n');
+  klee_assume(buf[3] == '\0');
+  fwrite(buf, 1, 4, stdout);
+  //CHECK: a{{[b-y]}}
+
+  return 0;
+}