brintos

brintos / llvm-project-archived public Read only

0
0
Text · 577 B · 6366fd3 Raw
17 lines · cpp
1// RUN: %clang_cl_asan %Od %s %Fe%t2// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s3// UNSUPPORTED: asan-64-bits4#include <cassert>5#include <windows.h>6 7int main() {8  void *allocation = HeapAlloc(GetProcessHeap(), 0, 10);9  assert(allocation != 0);10  assert(HeapFree(GetProcessHeap(), 0, allocation));11  HeapFree(GetProcessHeap(), 0, allocation); //will dump12  assert(0 && "HeapFree double free should produce an ASAN dump\n");13  return 0;14}15 16// CHECK: AddressSanitizer: attempting double-free on [[addr:0x[0-9a-fA-F]+]] in thread T0:17