about summary refs log tree commit diff homepage
path: root/test/DeterministicAllocation/nullpage-read.c
blob: 15bdfd7d38266b3700cf1a1650e99d0579eb0a84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang %s -emit-llvm -g -c -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee -kdalloc -kdalloc-quarantine=1 -output-dir=%t.klee-out %t.bc -exit-on-error >%t.output 2>&1
// RUN: FileCheck %s -input-file=%t.output

#include <stdlib.h>
#include <string.h>

int main() {
  struct {
    int x;
    int y;
  } *ptr = NULL;

  // CHECK: null page access
  int y;
  memcpy(&y, &ptr->y, sizeof(ptr->y));

  return 0;
}