Debian Codegraph @

gcc/testsuite/gcc.dg/graphite/scop-22a.c

raw
1 /* { dg-require-effective-target size32plus } */
2 double u[1782225];
3
4 void foo(int N, int *res)
5 {
6 int i, j;
7 double a, b;
8 double sum = 0.0;
9
10 for (j = 3; j < N; j = j * j)
11 {
12 sum += a + b;
13 }
14
15 /* Next two loops form first SCoP */
16 for (i = 0; i < N; i++)
17 sum += u[i];
18
19 for (i = 0; i < N; i++)
20 {
21 a = u[i];
22 u[i] = i * i;
23 b = u[i];
24 sum += a + b;
25 }
26
27 for (j = 3; j < N; j = j * j)
28 {
29 sum += a + b;
30 }
31
32 for (j = 3; j < N; j = j * j)
33 {
34 sum += a + b;
35 }
36
37 /* Next two loop-nests form second SCoP */
38 for (i = 0; i < N; i++)
39 sum += u[i];
40
41 for (i = 0; i < N; i++)
42 for (j = 0; j < N; j++)
43 {
44 a = u[i];
45 u[i] = i * i;
46 b = u[j];
47 sum += a + b;
48 }
49
50 *res = sum + N;
51 }
52
53 /* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
54 /* { dg-final { scan-tree-dump-times "Loops in SCoP" 2 "graphite"} } */
55 /* { dg-final { scan-tree-dump "Loops in SCoP: 2, 3" "graphite"} } */
56 /* { dg-final { scan-tree-dump "Loops in SCoP: 6, 7, 8" "graphite"} } */