1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
10 #if defined(__FreeBSD__)
11 // The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before
12 // that, it was never implemented. So just define it to zero.
14 #define MAP_NORESERVE 0
19 const size_t kLog2Size
= 39;
20 #elif defined(__mips64) || defined(__aarch64__) || \
21 defined(__loongarch_lp64) || (defined(__riscv) && __riscv_xlen == 64)
22 const size_t kLog2Size
= 32;
23 #elif defined(__powerpc64__)
24 const size_t kLog2Size
= 39;
25 #elif defined(__s390x__)
26 const size_t kLog2Size
= 43;
28 const uintptr_t kLocation
= 0x40ULL
<< kLog2Size
;
30 reinterpret_cast<void*>(kLocation
),
33 MAP_PRIVATE
|MAP_ANON
|MAP_NORESERVE
,
35 fprintf(stderr
, "DONE %p %d\n", p
, errno
);
36 return p
== MAP_FAILED
;