sched1: debug/model: dump predecessor list and BB num [NFC]
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / collapse-2.c
blob7a8cfd2f3d442b20f1449e9a4c6cad856ebd4bca
1 /* { dg-do run } */
3 #include <stdlib.h>
5 int
6 main (void)
8 int i, j, k, l = 0, f = 0, x = 0, l2 = 0;
9 int m1 = 4, m2 = -5, m3 = 17;
11 #pragma acc parallel
12 #pragma acc loop seq collapse(3) reduction(+:l)
13 for (i = -2; i < m1; i++)
14 for (j = m2; j < -2; j++)
16 for (k = 13; k < m3; k++)
18 if ((i + 2) * 12 + (j + 5) * 4 + (k - 13) != 9 + f++)
19 l++;
23 /* Test loop with > condition. */
24 #pragma acc parallel
25 #pragma acc loop seq collapse(3) reduction(+:l2)
26 for (i = -2; i < m1; i++)
27 for (j = -3; j > (m2 - 1); j--)
29 for (k = 13; k < m3; k++)
31 if ((i + 2) * 12 + (j + 5) * 4 + (k - 13) != 9 + f++)
32 l2++;
36 for (i = -2; i < m1; i++)
37 for (j = m2; j < -2; j++)
39 for (k = 13; k < m3; k++)
41 if ((i + 2) * 12 + (j + 5) * 4 + (k - 13) != 9 + f++)
42 x++;
46 if (l != x || l2 != x)
47 abort ();
49 return 0;