about summary refs log tree commit diff homepage
path: root/test/regression/2007-08-01-cache-unclear-on-overwrite-flushed.c
blob: 73ceec918cbdded3ec2b119551e5841c7064de76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out %t1.bc

#include "klee/klee.h"
#include <assert.h>
#include <stdio.h>

int main() {  
  unsigned char x;

  klee_make_symbolic(&x, sizeof x, "x");
  if (x >= 2) klee_silent_exit(0);

  char delete[2] = {0,1};

  char tmp = delete[ x ];
  char tmp2 = delete[0];
  delete[ x ] = tmp2;

  if (x==1) {
    assert(delete[1] == 0);
    return 0;
  }

  return 0;
}