OSDN Git Service

PR rtl-optimization/52139
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ldist-pr45948.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-details" } */
3
4 extern void bar(int);
5
6 void
7 foo (int i, int n)
8 {
9   int a[30];
10   int b[30];
11   for (; i < n; i++)
12     a[i] = b[i] = 0;
13
14   while (1)
15     if (b[0])
16       bar (a[i - 1]);
17 }
18
19 /* We should apply loop distribution and generate 2 memset (0).  */
20
21 /* { dg-final { scan-tree-dump "distributed: split to 2" "ldist" } } */
22 /* { dg-final { scan-tree-dump-times "generated memset zero" 2 "ldist" } } */
23 /* { dg-final { cleanup-tree-dump "ldist" } } */