about summary refs log tree commit diff homepage
path: root/test/Runtime/POSIX/MixedConcreteSymbolic.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Runtime/POSIX/MixedConcreteSymbolic.c')
-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;
+}