about summary refs log tree commit diff homepage
path: root/test/Feature/Realloc.c
blob: 4f075e5e3bc99657c28edbdb830be0ae4165da15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %llvmgcc %s -emit-llvm %O0opt -c -o %t1.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out --exit-on-error --warnings-only-to-file=false %t1.bc 2>&1 | FileCheck %s

#include <assert.h>
#include <stdlib.h>
#include <stdio.h>

int main() {
  int *p = malloc(sizeof(int)*2);
  assert(p);
  p[1] = 52;

  // CHECK: KLEE: WARNING ONCE: Large alloc
  int *p2 = realloc(p, 1<<30);
  assert(!p2 || p2[1] == 52);

  return 0;
}