1// RUN: %clang %s -o %t && %run %t
2
3#include <assert.h>
4#include <sys/mman.h>
5
6int main() {
7 char *buf = (char *)mmap(addr: 0, len: 100000, PROT_READ | PROT_WRITE,
8 MAP_PRIVATE | MAP_ANONYMOUS, fd: -1, offset: 0);
9 assert(buf);
10 munmap(addr: buf, len: 100000);
11}
12

source code of compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_test.c