OpenMP: Robustify C front end handling of attribute-syntax pragmas
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-sra-9.c
blob41d7ddd9fecb4cfc805d963ffdb392c843120d87
1 /* { dg-do run } */
2 /* { dg-options "-O3" } */
4 typedef unsigned int myint __attribute__((aligned(1)));
6 typedef struct S {
7 unsigned a, b, c;
8 } SS;
10 typedef SS __attribute__((aligned(1))) SSS;
12 typedef struct U {
13 SS s[2];
14 } UU;
16 typedef UU __attribute__((aligned(1))) UUU;
18 static unsigned int __attribute__ ((noinline))
19 get_a (SSS s)
21 return s.a;
24 static int __attribute__ ((noinline, noclone))
25 foo (UUU *p)
27 int r = (int) get_a(p->s[0]) + 2;
28 return r;
31 char buf[512];
33 static UUU * __attribute__ ((noinline, noclone))
34 get_uuu (void)
36 return (UUU *)(buf + 1);
39 int
40 main(int argc, char *argv[])
42 UUU *p = get_uuu();
43 if (foo(p) != 2)
44 __builtin_abort ();
45 return 0;