comparison libgomp/testsuite/libgomp.c/collapse-3.c @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 04ced10e8804
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 /* { dg-do run } */
2 /* { dg-options "-O2 -std=gnu99" } */
3
4 #include <string.h>
5 #include <stdlib.h>
6
7 int
8 main (void)
9 {
10 int i2, l = 0;
11 int a[3][3][3];
12
13 memset (a, '\0', sizeof (a));
14 #pragma omp parallel for collapse(4 - 1) schedule(static, 4)
15 for (int i = 0; i < 2; i++)
16 for (int j = 0; j < 2; j++)
17 for (int k = 0; k < 2; k++)
18 a[i][j][k] = i + j * 4 + k * 16;
19 #pragma omp parallel
20 {
21 #pragma omp for collapse(2) reduction(|:l)
22 for (i2 = 0; i2 < 2; i2++)
23 for (int j = 0; j < 2; j++)
24 for (int k = 0; k < 2; k++)
25 if (a[i2][j][k] != i2 + j * 4 + k * 16)
26 l = 1;
27 }
28 if (l)
29 abort ();
30 return 0;
31 }