Fix compilation failure with C++98 compilers
[official-gcc.git] / libgomp / testsuite / libgomp.graphite / force-parallel-4.c
blobd2af142e8fe641d44add31e71bf55ce3045efdb3
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 ??? XFAILed for i1 because conditional store elimination wrecks
51 our dependence representation. */
52 /* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" { xfail *-*-* } } } */
53 /* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
54 /* { dg-final { scan-tree-dump-times "loopfn.0" 4 "optimized" } } */
55 /* { dg-final { scan-tree-dump-times "loopfn.1" 4 "optimized" } } */