1 // RUN: %clangxx_memprof -O0 %s -o %t
2 // Default is true (free on realloc to 0 size)
3 // RUN: %run %t 2>&1 | FileCheck %s
4 // RUN: %env_memprof_opts=allocator_frees_and_returns_null_on_realloc_zero=true %run %t 2>&1 | FileCheck %s
5 // RUN: %env_memprof_opts=allocator_frees_and_returns_null_on_realloc_zero=false %run %t 2>&1 | FileCheck %s --check-prefix=NO-FREE
14 // NO-FREE: Allocated something on realloc(p, 0)
15 fprintf(stderr
, "Allocated something on realloc(p, 0)\n");
17 // CHECK: realloc(p, 0) returned nullptr
18 fprintf(stderr
, "realloc(p, 0) returned nullptr\n");