Fix PR42930.
[official-gcc/constexpr.git] / libgomp / testsuite / libgomp.graphite / force-parallel-4.c
blobc0c6b1c6e5568ffdd90e4e04550ff88c1b180212
1 /* Autopar with IF conditions. */
3 void abort();
5 #define N 10000
6 #define T 1000
8 void foo(void)
10 int i;
11 int A[2*N], B[2*N];
13 /* Initialize array: carried no dependency. */
14 for (i = 0; i < 2*N; i++)
15 B[i] = A[i] = i;
17 for (i = 0; i < N; i++)
19 if (i < T)
20 /* loop i1: carried no dependency. */
21 A[i] = A[i+T];
22 else
23 /* loop i2: carried dependency. */
24 A[i] = A[i+T+1];
27 /* If it runs a wrong answer, abort. */
28 for (i = 0; i < N; i++)
30 if (i < T)
32 if (A[i] != B[i+T])
33 abort();
35 else
37 if (A[i] != B[i+T+1])
38 abort();
43 int main(void)
45 foo();
46 return 0;
49 /* Check that parallel code generation part make the right answer. */
50 /* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
51 /* { dg-final { cleanup-tree-dump "graphite" } } */
52 /* { dg-final { scan-tree-dump-times "loopfn.0" 5 "optimized" } } */
53 /* { dg-final { scan-tree-dump-times "loopfn.1" 5 "optimized" } } */
54 /* { dg-final { cleanup-tree-dump "parloops" } } */
55 /* { dg-final { cleanup-tree-dump "optimized" } } */