Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.c/pr35549.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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 /* PR middle-end/35549 */ | |
2 /* { dg-do run } */ | |
3 | |
4 #include <omp.h> | |
5 #include <stdlib.h> | |
6 | |
7 int | |
8 main (void) | |
9 { | |
10 int i = 6, n = 0; | |
11 omp_set_dynamic (0); | |
12 omp_set_nested (1); | |
13 #pragma omp parallel shared (i) num_threads (3) | |
14 { | |
15 if (omp_get_num_threads () != 3) | |
16 #pragma omp atomic | |
17 n += 1; | |
18 #pragma omp parallel shared (i) num_threads (4) | |
19 { | |
20 if (omp_get_num_threads () != 4) | |
21 #pragma omp atomic | |
22 n += 1; | |
23 #pragma omp critical | |
24 i += 1; | |
25 } | |
26 } | |
27 if (n == 0 && i != 6 + 3 * 4) | |
28 abort (); | |
29 return 0; | |
30 } |