about summary refs log tree commit diff homepage
path: root/test/Feature/OverlappedError.c
blob: 3c79380c2cd6070b683c90be308a717fea30602f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %llvmgcc %s -g -emit-llvm -O0 -c -o %t1.bc
// RUN: %klee %t1.bc
// RUN: ls klee-last/ | grep .out | wc -l | grep 4
// RUN: ls klee-last/ | grep .ptr.err | wc -l | grep 2

#include <stdlib.h>

int main() {
  if (klee_range(0,2, "range")) {
    char *x = malloc(8);
    *((int*) &x[klee_range(0,6, "range")]) = 1;
    free(x);
  } else {
    char *x = malloc(8);
    *((int*) &x[klee_range(-1,5, "range")]) = 1;
        free(x);
  }
  return 0;
}