about summary refs log tree commit diff homepage
path: root/test/Runtime/POSIX/MixedConcreteSymbolic.c
blob: 48e06934f60d0252c9f4cc050832d480cade5678 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}