1 /* PR tree-optimization/83047 */
2 /* { dg-do run { target mmap } } */
3 /* { dg-options "-O2" } */
9 #define MAP_ANONYMOUS MAP_ANON
15 #define MAP_FAILED ((void *)-1)
19 __attribute__((noipa
)) void
20 foo (char *p
, char *q
, int r
)
33 char *p
= mmap (NULL
, 131072, PROT_READ
| PROT_WRITE
,
34 MAP_PRIVATE
| MAP_ANONYMOUS
, -1, 0);
37 if (munmap (p
+ 65536, 65536) < 0)
44 foo (p
, p
+ 65536 - 2, r
);
45 if (p
[0] != 'c' || p
[1] != 'd')
48 foo (p
, p
+ 65536 - 2, r
);
49 if (p
[0] != 'a' || p
[1] != 'b')
54 foo (p
, p
+ 65536 - 1, r
);
55 if (p
[0] != 'e' || p
[1] != 'f')