1 // Test that initially callocked memory is properly freed
2 // (see https://github.com/google/sanitizers/issues/626).
4 // RUN: %clang %s -o %t
5 // RUN: env LD_PRELOAD=%shared_libasan %run %t
7 // REQUIRES: asan-dynamic-runtime
9 // This way of setting LD_PRELOAD does not work with Android test runner.
17 // This constructor will run before __asan_init
18 // so calloc will allocate memory from special pool.
23 __attribute__((section(".preinit_array"), used
))
27 // This used to abort because
28 // Asan's free didn't recognize ptr.