1 // Check that free hook doesn't conflict with Realloc.
2 // RUN: %clangxx_asan -O2 %s -o %t
3 // RUN: %run %t 2>&1 | FileCheck %s
10 void __asan_free_hook(void *ptr
) {
11 if (ptr
== glob_ptr
) {
13 write(1, "FreeHook\n", sizeof("FreeHook\n"));
19 int *x
= (int*)malloc(100);
22 int *y
= (int*)realloc(x
, 200);
23 // Verify that free hook was called and didn't spoil the memory.
27 write(1, "Passed\n", sizeof("Passed\n"));