gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ldist-14.c
blob700599f1ccb83a1f0e795465b5f0d45e61d17402
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-strict-aliasing -ftree-loop-distribution -fdump-tree-ldist-details" } */
4 struct desc {
5 int i;
6 void * __restrict__ data;
7 int j;
8 } a, b;
10 float foo (int n)
12 int i;
13 float * __restrict__ x, * __restrict__ y, tmp = 0.0;
14 x = (float * __restrict__)a.data;
15 y = (float * __restrict__)b.data;
16 for (i = 0; i < n; ++i)
18 x[i] = 0.0;
19 tmp += y[i];
21 return tmp;
24 /* We should apply loop distribution. */
26 /* { dg-final { scan-tree-dump "Loop 1 distributed: split to 2 loops" "ldist" } } */
27 /* { dg-final { cleanup-tree-dump "ldist" } } */