// RUN: %llvmgcc %s -emit-llvm -g -c -o %t1.bc // RUN: %klee --optimize %t1.bc 2>&1 | FileCheck %s // RUN: test -f %T/klee-last/test000001.ptr.err #include #include #include int main(int argc, char **argv) { unsigned char *buf = malloc(3); klee_make_symbolic(buf, 3); if (buf[0]>4) klee_silent_exit(0); unsigned char x = buf[1]; free(buf); if (x) { // CHECK: 2007-10-11-illegal-access-after-free-and-branch.c:18: memory error: out of bound pointer return buf[2]; } klee_silent_exit(0); return 0; }