]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc
dd50bf7fe6a83336abad0698bd90f6d4cc8bd2e1
1 // REQUIRES: asan-64-bits
2 // RUN: %clangxx_asan -O3 %s -o %t
3 // RUN: not %run %t 2>&1 | FileCheck %s
4 // RUN: %env_asan_opts=poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s
5 // RUN: %env_asan_opts=poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE
11 fprintf(stderr
, "ZZZZZZZZ\n");
16 int main(int argc
, char **argv
) {
17 C
*buffer
= new C
[argc
];
19 // CHECK: AddressSanitizer: heap-buffer-overflow
20 // CHECK: in main {{.*}}new_array_cookie_test.cc:[[@LINE-2]]
21 // CHECK: is located 0 bytes inside of 12-byte region
22 // NO_COOKIE: ZZZZZZZZ