Debian Codegraph @

gcc/testsuite/gcc.dg/ipa/ipa-sra-9.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O3" } */
3
4 typedef unsigned int myint __attribute__((aligned(1)));
5
6 typedef struct S {
7 unsigned a, b, c;
8 } SS;
9
10 typedef SS __attribute__((aligned(1))) SSS;
11
12 typedef struct U {
13 SS s[2];
14 } UU;
15
16 typedef UU __attribute__((aligned(1))) UUU;
17
18 static unsigned int __attribute__ ((noinline))
19 get_a (SSS s)
20 {
21 return s.a;
22 };
23
24 static int __attribute__ ((noinline, noclone))
25 foo (UUU *p)
26 {
27 int r = (int) get_a(p->s[0]) + 2;
28 return r;
29 }
30
31 char buf[512];
32
33 static UUU * __attribute__ ((noinline, noclone))
34 get_uuu (void)
35 {
36 return (UUU *)(buf + 1);
37 }
38
39 int
40 main(int argc, char *argv[])
41 {
42 UUU *p = get_uuu();
43 if (foo(p) != 2)
44 __builtin_abort ();
45 return 0;
46 }