Fortran/OpenMP: Add missing EXEC_OMP_DEPOBJ case val [PR100642]
authorTobias Burnus <tobias@codesourcery.com>
Tue, 18 May 2021 14:40:45 +0000 (16:40 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Tue, 18 May 2021 14:40:45 +0000 (16:40 +0200)
PR fortran/100642

gcc/fortran/ChangeLog:

* openmp.c (omp_code_to_statement): Add missing EXEC_OMP_DEPOBJ.

gcc/testsuite/ChangeLog:

* gfortran.dg/goacc-gomp/depobj.f90: New test.

gcc/fortran/openmp.c
gcc/testsuite/gfortran.dg/goacc-gomp/depobj.f90 [new file with mode: 0644]

index 294b6d0..005b6c1 100644 (file)
@@ -6902,7 +6902,8 @@ omp_code_to_statement (gfc_code *code)
       return ST_OMP_PARALLEL_DO;
     case EXEC_OMP_PARALLEL_DO_SIMD:
       return ST_OMP_PARALLEL_DO_SIMD;
-
+    case EXEC_OMP_DEPOBJ:
+      return ST_OMP_DEPOBJ;
     default:
       gcc_unreachable ();
     }
diff --git a/gcc/testsuite/gfortran.dg/goacc-gomp/depobj.f90 b/gcc/testsuite/gfortran.dg/goacc-gomp/depobj.f90
new file mode 100644 (file)
index 0000000..e1c6830
--- /dev/null
@@ -0,0 +1,11 @@
+! PR fortran/100642
+! Contributed by G. Steinmetz
+program p
+   !use omp_lib, only: omp_depend_kind
+   use iso_c_binding, only: c_intptr_t
+   integer, parameter :: omp_depend_kind = 2*c_intptr_t
+   integer(omp_depend_kind) :: a, b
+   !$acc data
+   !$omp depobj(b) depend(out:a)  ! { dg-error "The !\\\$OMP DEPOBJ directive cannot be specified within a !\\\$ACC DATA region" }
+   !$acc end data
+end