1 // RUN: %clang -O0 %s -o %t && %env_tool_opts=allocator_may_return_null=1:hard_rss_limit_mb=50:quarantine_size_mb=1 %run %t
6 // https://github.com/google/sanitizers/issues/981
7 // UNSUPPORTED: android-26
12 // Hwasan requires tagging of new allocations, so needs RSS for shadow.
13 // UNSUPPORTED: hwasan
15 // FIXME: Something wrong with MADV_FREE or MAP_NORESERVE there.
16 // UNSUPPORTED: target={{.*solaris.*}}
20 int main(int argc
, char **argv
) {
21 for (int i
= 0; i
< sizeof(void *) * 8; ++i
) {
22 // Calloc avoids MSAN shadow poisoning.
23 p
= calloc(1ull << i
, 1);
24 fprintf(stderr
, "%d %llu: %p\n", i
, (1ull << i
), p
);