PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / sra-15.c
bloba22062e32d1a94711e20c06676aed7ce4a7513f3
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=32" } */
5 extern void abort (void);
7 struct S
9 char c;
10 unsigned short f[2][2];
11 int i;
12 unsigned short f3, f4;
16 int __attribute__ ((noinline))
17 foo (struct S *p)
19 struct S l;
21 l = *p;
22 l.i++;
23 l.f[1][0] += 3;
24 *p = l;
27 int
28 main (int argc, char **argv)
30 struct S a = {0, { {5, 7}, {9, 11} }, 4, 0, 0};
31 foo (&a);
32 if (a.i != 5 || a.f[1][0] != 12)
33 abort ();
34 return 0;
37 /* { dg-final { scan-tree-dump-times "l;" 0 "release_ssa" } } */