Files
clang-p2996/compiler-rt/test/asan/TestCases/poison_partial.cpp
Florian Mayer be366041fa [ASan] rename left/right to before/after.
left/right is a weird way to refer to address ordering.

Reviewed By: eugenis, MaskRay

Differential Revision: https://reviews.llvm.org/D132611
2022-09-06 13:25:15 -07:00

20 lines
444 B
C++

// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: not %run %t heap 2>&1 | FileCheck %s
// RUN: %env_asan_opts=poison_partial=0 %run %t
// RUN: %env_asan_opts=poison_partial=0 %run %t heap
#include <string.h>
char g[21];
char *x;
int main(int argc, char **argv) {
if (argc >= 2)
x = new char[21];
else
x = &g[0];
memset(x, 0, 21);
int *y = (int*)x;
return y[5];
}
// CHECK: 0 bytes after