1 // RUN: %clangxx_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
6 // Tests double-free error on pointers allocated with different allocation
13 int main(int argc, char **argv)
16 if (!strcmp(argv[1], "malloc")) {
17 void *p = malloc(sizeof(int));
22 if (!strcmp(argv[1], "new")) {
28 if (!strcmp(argv[1], "newarray")) {
37 // CHECK: ERROR: invalid chunk state