libgomp/testsuite/libgomp.oacc-c-c++-common/collapse-4.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | #include <string.h> |
| 4 | |
| 5 | int |
| 6 | main (void) |
| 7 | { |
| 8 | int l = 0; |
| 9 | int b[3][3]; |
| 10 | int i, j; |
| 11 | |
| 12 | memset (b, '\0', sizeof (b)); |
| 13 | |
| 14 | #pragma acc parallel copy(b[0:3][0:3]) |
| 15 | { |
| 16 | #pragma acc loop collapse(2) reduction(+:l) |
| 17 | for (i = 0; i < 2; i++) |
| 18 | for (j = 0; j < 2; j++) |
| 19 | if (b[i][j] != 16) |
| 20 | l += 1; |
| 21 | } |
| 22 | |
| 23 | if (l != 2 * 2) |
| 24 | __builtin_abort(); |
| 25 | |
| 26 | return 0; |
| 27 | } |