diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-10-08 12:30:44 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2019-10-08 14:30:44 +0200 |
commit | 65b67cf390bc0240a91730e8eb95d7a7b2d8aca0 (patch) | |
tree | b10fb9025ed0c26d31a8bc2f3390aa3f8cfba6de /libgomp | |
parent | 07f37a7fd4b84f996264b7498c55ac333efd4db9 (diff) | |
download | gcc-65b67cf390bc0240a91730e8eb95d7a7b2d8aca0.zip gcc-65b67cf390bc0240a91730e8eb95d7a7b2d8aca0.tar.gz gcc-65b67cf390bc0240a91730e8eb95d7a7b2d8aca0.tar.bz2 |
Fortran - fix OpenMP 'target simd'
gcc/fortran/
* parse.c (parse_executable): Add missing ST_OMP_TARGET_SIMD.
libgomp/
* testsuite/libgomp.fortran/target-simd.f90: New.
From-SVN: r276698
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/target-simd.f90 | 26 |
2 files changed, 30 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 2059e05..67d5737 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2019-10-08 Tobias Burnus <tobias@codesourcery.com> + + * gfortran.dg/gomp/target-simd.f90: New. + 2019-10-02 Julian Brown <julian@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> diff --git a/libgomp/testsuite/libgomp.fortran/target-simd.f90 b/libgomp/testsuite/libgomp.fortran/target-simd.f90 new file mode 100644 index 0000000..d49ae74 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/target-simd.f90 @@ -0,0 +1,26 @@ +! { dg-do run } + +program test + implicit none + real, allocatable :: a(:), b(:) + integer :: i + + a = [(i, i = 1, 100)] + allocate(b, mold=a) + b = 0 + + !$omp target simd map(to:a) map(from:b) + do i = 0, size(a) + b(i) = 5.0 * a(i) + end do + + if (any (b - 5.0 *a > 10.0*epsilon(a))) call abort() + + !$omp target simd map(to:a) map(from:b) + do i = 0, size(a) + b(i) = 2.0 * a(i) + end do + !$omp end target simd + + if (any (b - 2.0 *a > 10.0*epsilon(a))) call abort() +end program test |