]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/scudo/double-free.cpp
1 // RUN: %clang_scudo %s -o %t
2 // RUN: not %run %t malloc 2>&1 | FileCheck %s
3 // RUN: not %run %t new 2>&1 | FileCheck %s
4 // RUN: not %run %t newarray 2>&1 | FileCheck %s
5 // RUN: not %run %t memalign 2>&1 | FileCheck %s
7 // Tests double-free error on pointers allocated with different allocation
14 int main(int argc
, char **argv
)
17 if (!strcmp(argv
[1], "malloc")) {
18 void *p
= malloc(sizeof(int));
24 if (!strcmp(argv
[1], "new")) {
31 if (!strcmp(argv
[1], "newarray")) {
38 if (!strcmp(argv
[1], "memalign")) {
40 posix_memalign(&p
, 0x100, sizeof(int));
49 // CHECK: ERROR: invalid chunk state