diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-27 12:05:36 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-27 12:05:36 +0000 |
commit | 30f922c4abdfdec5cbd5d5561d6a162942807a59 (patch) | |
tree | 630f11e199c8239180ed1849a94feafb7c6ddc63 /libgomp/testsuite | |
parent | 1f95990294fdd867f7c2f62cdd665d1989fbcaa8 (diff) | |
download | gcc-30f922c4abdfdec5cbd5d5561d6a162942807a59.tar.gz |
PR fortran/47886
* gfortran.dg/gomp/task-1.f90: Removed.
* testsuite/libgomp.fortran/task3.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170535 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/task3.f90 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.fortran/task3.f90 b/libgomp/testsuite/libgomp.fortran/task3.f90 new file mode 100644 index 00000000000..30ff9803ea2 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/task3.f90 @@ -0,0 +1,27 @@ +! { dg-do run } +! { dg-options "-fopenmp" } +! +! PR fortran/47886 +! +! Test case contributed by Bill Long + +! derived from OpenMP test OMP3f/F03_2_7_1d.F90 +program F03_2_7_1d + use omp_lib + implicit none + integer, parameter :: NT = 4 + integer :: sum = 0 + + call omp_set_num_threads(NT); + + !$omp parallel + !$omp task if(omp_get_num_threads() > 0) + !$omp atomic + sum = sum + 1 + !$omp end task + !$omp end parallel + if (sum /= NT) then + print *, "FAIL - sum == ", sum, " (expected ", NT, ")" + call abort + end if +end program F03_2_7_1d |