Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/sra-16.c

raw
1 /* Verify that SRA total scalarization works on records containing arrays. */
2 /* { dg-do run } */
3 /* { dg-options "-O1 -fdump-tree-release_ssa --param sra-max-scalarization-size-Ospeed=16" } */
4
5 extern void abort (void);
6
7 struct S
8 {
9 long zilch[0];
10 char c;
11 int i;
12 unsigned short f3, f4;
13 };
14
15
16 int __attribute__ ((noinline))
17 foo (struct S *p)
18 {
19 struct S l;
20
21 l = *p;
22 l.i++;
23 l.f3++;
24 *p = l;
25 }
26
27 int
28 main (int argc, char **argv)
29 {
30 struct S a = { { }, 0, 4, 0, 0};
31 foo (&a);
32 if (a.i != 5 || a.f3 != 1)
33 abort ();
34 return 0;
35 }
36
37 /* { dg-final { scan-tree-dump-times "l;" 0 "release_ssa" } } */