Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / 20041106-1.c
blobf83e835ed1d5a06b12af449117e50b37dbce83a7
1 /* { dg-do run { target *-*-linux* *-*-solaris* } } */
2 /* { dg-options -O2 } */
4 #include <sys/types.h>
5 #include <sys/mman.h>
6 #include <unistd.h>
7 #include <stdlib.h>
9 struct S { long x __attribute__((packed)); }; /* { dg-warning "attribute ignored" "" { target default_packed } } */
10 volatile long sink;
12 void foo (struct S *s)
14 sink = s->x;
17 int main ()
19 size_t ps = getpagesize ();
20 char *ptr, *page;
21 struct S *s;
23 ptr = malloc (3*ps);
24 page = (char *)(((size_t)ptr + (ps - 1)) & -ps);
25 munmap (page + ps, ps);
27 s = (struct S *)(page + ps - sizeof(struct S));
28 foo(s);
30 return 0;