1 /* Check that the three loops are fused.  */
2 
3 /* Make sure we fuse the loops like this:
4 AST generated by isl:
5 for (int c0 = 0; c0 <= 99; c0 += 1) {
6   S_3(c0);
7   S_6(c0);
8   S_9(c0);
9 }
10 */
11 
12 /* { dg-final { scan-tree-dump-times "AST generated by isl:.*for \\(int c0 = 0; c0 <= 99; c0 \\+= 1\\) \\{.*S_.*\\(c0\\);.*S_.*\\(c0\\);.*S_.*\\(c0\\);.*\\}" 1 "graphite" } } */
13 
14 #define MAX 100
15 int A[MAX], B[MAX], C[MAX];
16 
17 extern void abort ();
18 
19 int
main(void)20 main (void)
21 {
22   int i;
23 
24   /* The next three loops should be fused.  */
25   for (i = 0; i < MAX; i++)
26     {
27       A[i] = i;
28       B[i] = i + 2;
29       C[i] = i + 1;
30     }
31   for(i=0; i<MAX; i++)
32     A[i] += B[i];
33   for(i=0; i<MAX; i++)
34     A[i] += C[i];
35 
36   for (i = 0; i < MAX; i++)
37     if (A[i] != 3*i+3)
38       abort ();
39 
40   return 0;
41 }
42