forked from OSchip/llvm-project
[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:
parent
ab93394a29
commit
6a2ec9fc57
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue