comparison libgomp/testsuite/libgomp.c/pr39591-1.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 /* PR other/39591 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
4
5 extern void abort (void);
6
7 int err;
8
9 int
10 main (void)
11 {
12 #pragma omp parallel
13 {
14 int array[40];
15 int i;
16 for (i = 0; i < sizeof array / sizeof array[0]; i++)
17 array[i] = 0x55555555;
18
19 #pragma omp for schedule(dynamic)
20 for (i = 0; i < 50; i++)
21 #pragma omp task shared(array)
22 {
23 int j;
24 for (j = 0; j < sizeof array / sizeof array[0]; j++)
25 if (array[j] != 0x55555555)
26 #pragma omp atomic
27 err++;
28 }
29 }
30 if (err)
31 abort ();
32 return 0;
33 }