[test/asan] Update a test case to work with old Darwin SDK's

On Darwin, MAP_ANONYMOUS is a synonym for MAP_ANON. However, some SDK's
don't define MAP_ANONYMOUS. Use MAP_ANON to work around this.

(As a point of interest, the situation is exactly reversed on Linux.)

llvm-svn: 267907
This commit is contained in:
Vedant Kumar 2016-04-28 17:48:35 +00:00
parent ab93394a29
commit 6a2ec9fc57
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ int main(int argc, char **argv) {
// shadow mapping works). This is kinda hard to fix. Test a random address in
// the application part of the address space.
void *volatile p =
mmap(nullptr, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
mmap(nullptr, 4096, PROT_READ, MAP_PRIVATE | MAP_ANON, 0, 0);
munmap(p, 4096);
if (argc == 1)
Read((int *)p);