1 // RUN: %clang_cl_asan -O0 %s -Fe%t 2 // RUN: not %run %t 2>&1 | FileCheck %s 3 4 #include <malloc.h> 5 6 int main() { 7 int *x = new int[42]; 8 delete [] x; 9 delete [] x; 10 // CHECK: AddressSanitizer: attempting double-free on [[ADDR:0x[0-9a-f]+]] 11 // FIXME: The 'operator delete' frame should have []. 12 // CHECK-NEXT: {{#0 .* operator delete}} 13 // CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-4]] 14 // CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region 15 // CHECK-LABEL: freed by thread T0 here: 16 // FIXME: The 'operator delete' frame should have []. 17 // CHECK-NEXT: {{#0 .* operator delete}} 18 // CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-10]] 19 // CHECK-LABEL: previously allocated by thread T0 here: 20 // FIXME: The 'operator new' frame should have []. 21 // CHECK-NEXT: {{#0 .* operator new}} 22 // CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-15]] 23 return 0; 24 } 25 26