brintos

brintos / llvm-project-archived public Read only

0
0
Text · 323 B · 467d5ec Raw
16 lines · cpp
1// REQUIRES: gwp_asan2// RUN: %clangxx_gwp_asan %s -o %t3// RUN: %expect_crash %run %t 2>&1 | FileCheck %s4 5// CHECK: GWP-ASan detected a memory error6// CHECK: Double Free at 0x{{[a-f0-9]+}} (a 50-byte allocation)7 8#include <cstdlib>9 10int main() {11  char *Ptr = new char[50];12  delete[] Ptr;13  delete[] Ptr;14  return 0;15}16