1 /* PR middle-end/55430 */
2 /* { dg-do run { target mmap } } */
3 /* { dg-options "-O2" } */
9 #define MAP_ANONYMOUS MAP_ANON
15 #define MAP_FAILED ((void *)-1)
25 __attribute__((noinline
, noclone
)) int
26 foo (int x
, int y
, struct S
*z
, unsigned int w
)
28 if (z
[y
].s2
== x
&& z
[y
].s1
== w
)
36 char *p
= mmap (NULL
, 131072, PROT_READ
| PROT_WRITE
,
37 MAP_PRIVATE
| MAP_ANONYMOUS
, -1, 0);
40 if (munmap (p
+ 65536, 65536) < 0)
42 if ((65536 / sizeof (struct S
)) * sizeof (struct S
) != 65536)
44 struct S
*s
= (struct S
*) (p
+ 65536);
45 return foo (0, 0, s
- 1, 0) != 1;