https://gcc.gnu.org/g:52d7f5b1033492b53573f833ca6daf7315406bf5

commit r16-6032-g52d7f5b1033492b53573f833ca6daf7315406bf5
Author: supers1ngular <[email protected]>
Date:   Thu Dec 11 08:12:50 2025 -0800

    openmp: Bump Version from 4.5 to 5.2 (3/4)
    
    Implements the OpenMP 5.2 Fortran deprecations. Uses the warning
    established in patch 1/4, -Wdeprecated-openmp, for said deprecations.
    Similarly, we do not implement the relaxing of constraints for the
    interop construct since it is not a deprecation. However, the
    deprecation for 'uses_allocators' is implemented, since support
    exists in Fortran mainline. Additionally implements the
    Fortran-specific deprecation for executable allocate directives,
    and adds new tests.
    
    gcc/fortran/ChangeLog:
    
            * openmp.cc (gfc_match_omp_clause_reduction): Deprecate '-'
            operator for reductions.
            (gfc_match_omp_clause_uses_allocators): Deprecate
            allocator(traits) pattern for 'uses_allocators'.
            (gfc_match_omp_clauses): Deprecate 'sink' and 'source' for
            'depend' clause. Deprecate list items as arguments with 'linear'
            clause. Deprecate non-comma-separated modifiers for the map
            clause. Deprecate 'to' clause with declare target.
            (gfc_match_omp_declare_target): Whitespace.
            (match_omp_metadirective): Deprecate 'default' clause on
            metadirectives.
            (resolve_omp_clauses): Deprecate executable allocate directives.
    
    libgomp/ChangeLog:
    
            * testsuite/libgomp.fortran/allocate-8a.f90: Suppress warnings.
            * testsuite/libgomp.fortran/allocators-1.f90: Ditto.
            * testsuite/libgomp.fortran/allocators-2.f90: Ditto.
            * testsuite/libgomp.fortran/allocators-4.f90: Ditto.
            * testsuite/libgomp.fortran/declare-target-1.f90: Ditto.
            * testsuite/libgomp.fortran/declare-target-2.f90: Ditto.
            * testsuite/libgomp.fortran/declare-target-indirect-1.f90: Ditto.
            * testsuite/libgomp.fortran/declare-target-indirect-2.f90: Ditto.
            * testsuite/libgomp.fortran/doacross1.f90: Ditto.
            * testsuite/libgomp.fortran/doacross2.f90: Ditto.
            * testsuite/libgomp.fortran/doacross3.f90: Ditto.
            * testsuite/libgomp.fortran/map-alloc-ptr-2.f90: Ditto.
            * testsuite/libgomp.fortran/pr84418-1.f90: Ditto.
            * testsuite/libgomp.fortran/pr84418-2.f90: Ditto.
            * testsuite/libgomp.fortran/reduction1.f90: Ditto.
            * testsuite/libgomp.fortran/udr11.f90: Ditto.
            * testsuite/libgomp.fortran/uses_allocators_1.f90: Ditto.
            * testsuite/libgomp.fortran/uses_allocators_2.f90: Ditto.
            * testsuite/libgomp.fortran/dep-uses-allocators.f90: New test.
    
    gcc/testsuite/ChangeLog:
    
            * gfortran.dg/gomp/allocate-14.f90: Suppress warnings.
            * gfortran.dg/gomp/allocate-16.f90: Ditto.
            * gfortran.dg/gomp/allocate-5.f90: Ditto.
            * gfortran.dg/gomp/allocate-6.f90: Ditto.
            * gfortran.dg/gomp/allocate-7.f90: Ditto.
            * gfortran.dg/gomp/allocators-3.f90: Ditto.
            * gfortran.dg/gomp/declare-simd-2.f90: Ditto.
            * gfortran.dg/gomp/declare-simd-6.f90: Ditto.
            * gfortran.dg/gomp/declare-target-1.f90: Ditto.
            * gfortran.dg/gomp/declare-target-2.f90: Ditto.
            * gfortran.dg/gomp/declare-target-4.f90: Ditto.
            * gfortran.dg/gomp/declare-target-5.f90: Ditto.
            * gfortran.dg/gomp/declare-target-indirect-1.f90: Ditto.
            * gfortran.dg/gomp/declare-target-indirect-2.f90: Ditto.
            * gfortran.dg/gomp/declare-variant-10.f90: Ditto.
            * gfortran.dg/gomp/declare-variant-8.f90: Ditto.
            * gfortran.dg/gomp/implicit-save.f90: Ditto.
            * gfortran.dg/gomp/linear-1.f90: Ditto.
            * gfortran.dg/gomp/linear-2.f90: Ditto.
            * gfortran.dg/gomp/linear-3.f90: Ditto.
            * gfortran.dg/gomp/linear-4.f90: Ditto.
            * gfortran.dg/gomp/linear-6.f90: Ditto.
            * gfortran.dg/gomp/map-12.f90: Ditto.
            * gfortran.dg/gomp/map-6.f90: Ditto.
            * gfortran.dg/gomp/map-7.f90: Ditto.
            * gfortran.dg/gomp/map-8.f90: Ditto.
            * gfortran.dg/gomp/order-8.f90: Ditto.
            * gfortran.dg/gomp/pr83977.f90: Ditto.
            * gfortran.dg/gomp/reduction1.f90: Ditto.
            * gfortran.dg/gomp/schedule-modifiers-2.f90: Ditto.
            * gfortran.dg/gomp/workshare-reduction-55.f90: Ditto.
            * gfortran.dg/gomp/workshare-reduction-56.f90: Ditto.
            * gfortran.dg/gomp/workshare-reduction-57.f90: Ditto.
            * gfortran.dg/gomp/workshare-reduction-58.f90: Ditto.
            * gfortran.dg/gomp/52-deps.f90: New test.

Diff:
---
 gcc/fortran/openmp.cc                              | 64 ++++++++++++++++++----
 gcc/testsuite/gfortran.dg/gomp/52-deps.f90         | 44 +++++++++++++++
 gcc/testsuite/gfortran.dg/gomp/allocate-14.f90     |  6 +-
 gcc/testsuite/gfortran.dg/gomp/allocate-16.f90     |  3 +-
 gcc/testsuite/gfortran.dg/gomp/allocate-5.f90      |  1 +
 gcc/testsuite/gfortran.dg/gomp/allocate-6.f90      |  1 +
 gcc/testsuite/gfortran.dg/gomp/allocate-7.f90      |  1 +
 gcc/testsuite/gfortran.dg/gomp/allocators-3.f90    |  1 +
 gcc/testsuite/gfortran.dg/gomp/declare-simd-2.f90  |  2 +-
 gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90  |  2 +-
 .../gfortran.dg/gomp/declare-target-1.f90          |  2 +-
 .../gfortran.dg/gomp/declare-target-2.f90          |  2 +-
 .../gfortran.dg/gomp/declare-target-4.f90          |  2 +-
 .../gfortran.dg/gomp/declare-target-5.f90          |  1 +
 .../gfortran.dg/gomp/declare-target-indirect-1.f90 |  2 +-
 .../gfortran.dg/gomp/declare-target-indirect-2.f90 |  2 +-
 .../gfortran.dg/gomp/declare-variant-10.f90        |  2 +-
 .../gfortran.dg/gomp/declare-variant-8.f90         |  2 +-
 gcc/testsuite/gfortran.dg/gomp/implicit-save.f90   |  4 +-
 gcc/testsuite/gfortran.dg/gomp/linear-1.f90        |  1 +
 gcc/testsuite/gfortran.dg/gomp/linear-2.f90        |  2 +-
 gcc/testsuite/gfortran.dg/gomp/linear-3.f90        |  2 +-
 gcc/testsuite/gfortran.dg/gomp/linear-4.f90        |  2 +-
 gcc/testsuite/gfortran.dg/gomp/linear-6.f90        |  2 +-
 gcc/testsuite/gfortran.dg/gomp/map-12.f90          |  2 +-
 gcc/testsuite/gfortran.dg/gomp/map-6.f90           |  2 +-
 gcc/testsuite/gfortran.dg/gomp/map-7.f90           |  2 +-
 gcc/testsuite/gfortran.dg/gomp/map-8.f90           |  1 +
 gcc/testsuite/gfortran.dg/gomp/order-8.f90         |  1 +
 gcc/testsuite/gfortran.dg/gomp/pr83977.f90         |  2 +-
 gcc/testsuite/gfortran.dg/gomp/reduction1.f90      |  2 +-
 .../gfortran.dg/gomp/schedule-modifiers-2.f90      |  2 +-
 .../gfortran.dg/gomp/workshare-reduction-55.f90    |  1 +
 .../gfortran.dg/gomp/workshare-reduction-56.f90    |  1 +
 .../gfortran.dg/gomp/workshare-reduction-57.f90    |  1 +
 .../gfortran.dg/gomp/workshare-reduction-58.f90    |  1 +
 libgomp/testsuite/libgomp.fortran/allocate-8a.f90  |  1 +
 libgomp/testsuite/libgomp.fortran/allocators-1.f90 |  3 +-
 libgomp/testsuite/libgomp.fortran/allocators-2.f90 |  1 +
 libgomp/testsuite/libgomp.fortran/allocators-4.f90 |  1 +
 .../testsuite/libgomp.fortran/declare-target-1.f90 |  2 +-
 .../testsuite/libgomp.fortran/declare-target-2.f90 |  1 -
 .../libgomp.fortran/declare-target-indirect-1.f90  |  2 +-
 .../libgomp.fortran/declare-target-indirect-2.f90  |  2 +-
 .../libgomp.fortran/dep-uses-allocators.f90        | 14 +++++
 libgomp/testsuite/libgomp.fortran/doacross1.f90    |  2 +-
 libgomp/testsuite/libgomp.fortran/doacross2.f90    |  2 +-
 libgomp/testsuite/libgomp.fortran/doacross3.f90    |  2 +-
 .../testsuite/libgomp.fortran/map-alloc-ptr-2.f90  |  2 +-
 libgomp/testsuite/libgomp.fortran/pr84418-1.f90    |  2 +-
 libgomp/testsuite/libgomp.fortran/pr84418-2.f90    |  4 +-
 libgomp/testsuite/libgomp.fortran/reduction1.f90   |  2 +-
 libgomp/testsuite/libgomp.fortran/udr11.f90        |  2 +-
 .../libgomp.fortran/uses_allocators_1.f90          |  1 +
 .../libgomp.fortran/uses_allocators_2.f90          |  2 +-
 55 files changed, 169 insertions(+), 50 deletions(-)

diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index a771f0dd2134..e6997427fc5f 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -1494,7 +1494,11 @@ gfc_match_omp_clause_reduction (char pc, gfc_omp_clauses 
*c, bool openacc,
   else if (gfc_match_char ('*') == MATCH_YES)
     rop = OMP_REDUCTION_TIMES;
   else if (gfc_match_char ('-') == MATCH_YES)
-    rop = OMP_REDUCTION_MINUS;
+    {
+      gfc_warning (OPT_Wdeprecated_openmp, "%<-%> operator at %C "
+       "for reductions deprecated in OpenMP 5.2");
+      rop = OMP_REDUCTION_MINUS;
+    }
   else if (gfc_match (".and.") == MATCH_YES)
     rop = OMP_REDUCTION_AND;
   else if (gfc_match (".or.") == MATCH_YES)
@@ -1852,7 +1856,13 @@ gfc_match_omp_clause_uses_allocators (gfc_omp_clauses *c)
       if (gfc_match ("%S ", &p->sym) != MATCH_YES)
        goto error;
       if (!has_modifiers)
-       gfc_match ("( %S ) ", &p->u2.traits_sym);
+       {
+         if (gfc_match ("( %S ) ", &p->u2.traits_sym) == MATCH_YES)
+           gfc_warning (OPT_Wdeprecated_openmp, "The specification of "
+             "arguments to %<uses_allocators%> at %L where each item is of "
+             "the form %<allocator(traits)%> is deprecated since OpenMP 5.2",
+             &p->where);
+       }
       else if (gfc_peek_ascii_char () == '(')
        {
          gfc_error ("Unexpected %<(%> at %C");
@@ -2907,6 +2917,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
                                 "at %C");
                      goto error;
                    }
+                 if (is_depend)
+                   gfc_warning (OPT_Wdeprecated_openmp, "%<source%> "
+                     "modifier with %<depend%> clause at %L deprecated "
+                     "since OpenMP 5.2, use with %<doacross%>", &old_loc);
                  c->doacross_source = true;
                  c->depend_source = is_depend;
                  continue;
@@ -2930,6 +2944,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
                                 "at %C");
                      goto error;
                    }
+                 if (is_depend)
+                   gfc_warning (OPT_Wdeprecated_openmp, "%<sink%> "
+                     "modifier with %<depend%> clause at %L "
+                     "deprecated since OpenMP 5.2, use with %<doacross%>",
+                     &old_loc);
                  m = gfc_match_omp_doacross_sink (&c->lists[OMP_LIST_DEPEND],
                                                   is_depend);
                  if (m == MATCH_YES)
@@ -3405,6 +3424,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
              bool old_linear_modifier = false;
              gfc_omp_linear_op linear_op = OMP_LINEAR_DEFAULT;
              gfc_expr *step = NULL;
+             locus saved_loc = gfc_current_locus;
 
              if (gfc_match_omp_variable_list (" ref (",
                                               &c->lists[OMP_LIST_LINEAR],
@@ -3440,6 +3460,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
                  gfc_current_locus = old_loc;
                  break;
                }
+             if (old_linear_modifier)
+               gfc_warning (OPT_Wdeprecated_openmp,
+                 "Specification of the list items as arguments to the "
+                 "modifiers at %L is deprecated since OpenMP 5.2",
+                 &saved_loc);
              if (linear_op != OMP_LINEAR_DEFAULT)
                {
                  if (gfc_match (" :") == MATCH_YES)
@@ -3624,7 +3649,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
                    }
                  else
                    break;
-                 gfc_match (", ");
+                 if (gfc_match (", ") != MATCH_YES)
+                   gfc_warning (OPT_Wdeprecated_openmp,
+                     "The specification of modifiers without comma "
+                     "separators for the %<map%> clause at %C has "
+                     "been deprecated since OpenMP 5.2");
                }
 
              gfc_omp_map_op map_op = OMP_MAP_TOFROM;
@@ -4287,7 +4316,12 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
              if (m == MATCH_ERROR)
                goto error;
              if (m == MATCH_YES)
-               continue;
+               {
+                 gfc_warning (OPT_Wdeprecated_openmp, "%<to%> clause with "
+                   "%<declare target%> at %L deprecated since OpenMP 5.2, "
+                   "use %<enter%>", &old_loc);
+                 continue;
+               }
            }
          else if ((mask & OMP_CLAUSE_TO)
                   && gfc_match_motion_var_list ("to (", &c->lists[OMP_LIST_TO],
@@ -7056,17 +7090,21 @@ match_omp_metadirective (bool begin_p)
 
       locus variant_locus = gfc_current_locus;
 
-      if (gfc_match (" default ( ") == MATCH_YES)
-       default_p = true;
-      else if (gfc_match (" otherwise ( ") == MATCH_YES)
+      if (gfc_match ("default ( ") == MATCH_YES)
+       {
+         default_p = true;
+         gfc_warning (OPT_Wdeprecated_openmp,
+           "%<default%> clause with metadirective at %L "
+           "deprecated since OpenMP 5.2", &variant_locus);
+       }
+      else if (gfc_match ("otherwise ( ") == MATCH_YES)
        default_p = true;
-      else if (gfc_match (" when ( ") != MATCH_YES)
+      else if (gfc_match ("when ( ") != MATCH_YES)
        {
          gfc_error ("expected %<when%>, %<otherwise%>, or %<default%> at %C");
          gfc_current_locus = old_loc;
          return MATCH_ERROR;
        }
-
       if (default_p && default_seen)
        {
          gfc_error ("too many %<otherwise%> or %<default%> clauses "
@@ -9414,6 +9452,12 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses 
*omp_clauses,
          && code->block->next
          && code->block->next->op == EXEC_ALLOCATE)
        {
+         if (code->op == EXEC_OMP_ALLOCATE)
+           gfc_warning (OPT_Wdeprecated_openmp,
+             "The use of one or more %<allocate%> directives with "
+             "an associated %<allocate%> statement at %L is "
+             "deprecated since OpenMP 5.2, use an %<allocators%> "
+             "directive", &code->loc);
          gfc_alloc *a;
          gfc_omp_namelist *n_null = NULL;
          bool missing_allocator = false;
@@ -9436,7 +9480,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses 
*omp_clauses,
                           n->sym->name, &n->where);
              for (a = code->block->next->ext.alloc.list; a; a = a->next)
                if (a->expr->expr_type == EXPR_VARIABLE
-                   && a->expr->symtree->n.sym == n->sym)
+                 && a->expr->symtree->n.sym == n->sym)
                  {
                    gfc_ref *ref;
                    for (ref = a->expr->ref; ref; ref = ref->next)
diff --git a/gcc/testsuite/gfortran.dg/gomp/52-deps.f90 
b/gcc/testsuite/gfortran.dg/gomp/52-deps.f90
new file mode 100644
index 000000000000..9cb8233a191e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/52-deps.f90
@@ -0,0 +1,44 @@
+! { dg-error ".* at \\(1\\) requires '-fopenmp-allocators'" "" { target *-*-* 
} 24 }
+! { dg-warning "All files that might deallocate such a variable must be 
compiled with '-fopenmp-allocators'" "" { target *-*-* } 24 }
+program test_deprecations
+  integer :: i
+  integer :: j
+  integer, allocatable :: a(:)
+  integer :: x(10)
+  integer :: y, z
+
+  ! { dg-warning "'to' clause with 'declare target' at \\(1\\) deprecated 
since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 
11 }
+  !$omp declare target to(i)
+  !$omp do ordered(1)
+    do i = 1,10
+      ! { dg-warning "'source' modifier with 'depend' clause at \\(1\\) 
deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" 
"" { target *-*-* } 15 }
+      !$omp ordered depend(source)
+        j = i
+      ! { dg-warning "'sink' modifier with 'depend' clause at \\(1\\) 
deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" 
"" { target *-*-* } 18 }
+      !$omp ordered depend(sink : i)
+        j = i
+    end do
+  !$omp end do
+
+  ! { dg-warning "The use of one or more 'allocate' directives with an 
associated 'allocate' statement at \\(1\\) is deprecated since OpenMP 5.2, use 
an 'allocators' directive \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 24 }
+  !$omp allocate(a)
+    allocate(a(100))
+    do i = 1,100
+      a(i) = i
+    end do
+    deallocate(a)
+
+
+  ! { dg-warning "The specification of modifiers without comma separators for 
the 'map' clause at \\(1\\) has been deprecated since OpenMP 5.2 
\\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 33 }
+  !$omp target map(close to: x)
+    x = 1
+  !$omp end target
+
+  z = 1
+  ! { dg-warning "'-' operator at \\(1\\) for reductions deprecated in OpenMP 
5.2 \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 39 }
+  !$omp parallel do reduction(-:z)
+  do y = 1,10
+      z = z - y
+  end do
+
+end program
diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-14.f90 
b/gcc/testsuite/gfortran.dg/gomp/allocate-14.f90
index 4db950f90a71..77738344cead 100644
--- a/gcc/testsuite/gfortran.dg/gomp/allocate-14.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/allocate-14.f90
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fcoarray=single -fcray-pointer" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 use iso_c_binding
 integer, parameter :: omp_allocator_handle_kind = c_intptr_t
@@ -38,7 +38,7 @@ subroutine coarrays(x)
   !$omp allocate(z) ! { dg-error "18:Unexpected coarray 'z' in 'allocate' at 
.1." }
     allocate(z(5)[*])
   x = 5
-end 
+end
 
 
 integer function f() result(res)
@@ -114,7 +114,7 @@ subroutine coarray_3
   integer :: x
   integer, allocatable :: a, b, c[:], d
   x = 5 ! executable stmt
-  !$omp allocators allocate(align(16): a,b) allocate(align(32) : d) 
+  !$omp allocators allocate(align(16): a,b) allocate(align(32) : d)
   allocate(a,b,c[*],d)  ! OK - Fortran allocator used for 'C'
 end
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-16.f90 
b/gcc/testsuite/gfortran.dg/gomp/allocate-16.f90
index 6c203e02d57a..6bba4536e4b9 100644
--- a/gcc/testsuite/gfortran.dg/gomp/allocate-16.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/allocate-16.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 integer, pointer :: ptr
 
 !$omp flush
@@ -5,6 +6,6 @@ integer, pointer :: ptr
 allocate(ptr)
 end
 
-! { dg-error "'!.OMP ALLOCATE' at .1. requires '-fopenmp-allocators'" "" { 
target *-*-* } 4 }
+! { dg-error "'!$OMP ALLOCATE' at .1. requires '-fopenmp-allocators'" "" { 
target *-*-* } 4 }
 ! { dg-warning "All files that might deallocate such a variable must be 
compiled with '-fopenmp-allocators'" "" { target *-*-* } 4 }
 ! { dg-note "This includes explicit DEALLOCATE, reallocation on intrinsic 
assignment, INTENT\\(OUT\\) for allocatable dummy arguments, and reallocation 
of allocatable components allocated with an OpenMP allocator" "" { target *-*-* 
} 0 }
diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-5.f90 
b/gcc/testsuite/gfortran.dg/gomp/allocate-5.f90
index 28369ae876bf..3e1f9a070282 100644
--- a/gcc/testsuite/gfortran.dg/gomp/allocate-5.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/allocate-5.f90
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fopenmp-allocators" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module my_omp_lib
   use iso_c_binding, only: c_intptr_t
   !use omp_lib
diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-6.f90 
b/gcc/testsuite/gfortran.dg/gomp/allocate-6.f90
index 063431d3582a..7b7d4fd46455 100644
--- a/gcc/testsuite/gfortran.dg/gomp/allocate-6.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/allocate-6.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module my_omp_lib
   use iso_c_binding, only: c_intptr_t
   !use omp_lib
diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90 
b/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90
index e919f78ce6da..81adf689ac35 100644
--- a/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fmax-errors=1000" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module my_omp_lib
   use iso_c_binding, only: c_intptr_t
   !use omp_lib
diff --git a/gcc/testsuite/gfortran.dg/gomp/allocators-3.f90 
b/gcc/testsuite/gfortran.dg/gomp/allocators-3.f90
index d0e31ee87272..7cc43db735f5 100644
--- a/gcc/testsuite/gfortran.dg/gomp/allocators-3.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/allocators-3.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine f
   integer, allocatable :: A1, A2, B(:), C
   !$omp declare target
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-simd-2.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-simd-2.f90
index 8f76774fd6e0..261bba3bea0b 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-simd-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-simd-2.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 function f1 (a, b, c, d, e, f)
   integer, value :: a, b, c
   integer :: d, e, f, f1
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90
index 83f2c0ab7cb0..1f639748315c 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-additional-options "-fdump-tree-gimple" }
-!
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! PR fortran/106566
 !
 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare simd 
\\(linear\\(ref\\(0\\):4\\) simdlen\\(8\\)\\)\\)\\)" 2 "gimple" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-1.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-target-1.f90
index bf64e72d082f..a02bb427f4f6 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-target-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-1.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module declare_target_1
   !$omp declare target to (var_1, var_4) link (var_2, var_3) &
   !$omp & link (var_5) to (var_6)
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90
index b4f1e52f7251..235fcc871796 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module declare_target_2
   !$omp declare target to (a) link (a) ! { dg-error "mentioned multiple times 
in clauses of the same OMP DECLARE TARGET directive" }
   !$omp declare target (b)
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90
index 296c0dbd869d..dd67ff58a34d 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-additional-options "-fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine f1
   !$omp declare target device_type (any)  ! { dg-warning "OMP DECLARE TARGET 
directive at .1. with only DEVICE_TYPE or INDIRECT clauses is ignored" }
 end subroutine
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90
index 0dacb8952295..04178613ffcf 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo()
   !$omp declare target  to(foo) device_type(bar)  ! { dg-error "Expected HOST, 
NOHOST or ANY" }
 end
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-1.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-1.f90
index 504c1a29813e..b50fb37027f5 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-1.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   integer :: a
   integer, parameter :: X = 1
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90
index 4345c69b74bb..5c2c73170ddc 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp -fdump-tree-gimple" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 contains
   subroutine sub1
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-10.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-variant-10.f90
index 01f59c528087..0e0ab5180107 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-10.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-variant-10.f90
@@ -1,7 +1,7 @@
 ! { dg-do compile }
 ! { dg-additional-options "-cpp -foffload=disable -fdump-tree-gimple" }
 ! { dg-additional-options "-mavx512bw" { target { i?86-*-* x86_64-*-* } } }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 #undef i386
 
 program main
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-8.f90 
b/gcc/testsuite/gfortran.dg/gomp/declare-variant-8.f90
index e3935768bc4d..68ff1e1333e7 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-8.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-variant-8.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-additional-options "-fdump-tree-gimple" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 program main
   !$omp requires atomic_default_mem_order(seq_cst)
   !$omp declare target to (test3)
diff --git a/gcc/testsuite/gfortran.dg/gomp/implicit-save.f90 
b/gcc/testsuite/gfortran.dg/gomp/implicit-save.f90
index 2af9647490e7..041de9799c34 100644
--- a/gcc/testsuite/gfortran.dg/gomp/implicit-save.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/implicit-save.f90
@@ -1,11 +1,11 @@
 subroutine foo
   integer :: n = 5, m = 7
-  !$omp declare target to(n)
+  !$omp declare target to(n) ! { dg-warning "'to' clause with 'declare target' 
at \\(1\\) deprecated since OpenMP 5.2, use 'enter' 
\\\[-Wdeprecated-openmp\\\]" }
   !$omp threadprivate (m)
 end
 
 program main
   integer :: i, j
-  !$omp declare target to(i)
+  !$omp declare target to(i) ! { dg-warning "'to' clause with 'declare target' 
at \\(1\\) deprecated since OpenMP 5.2, use 'enter' 
\\\[-Wdeprecated-openmp\\\]" }
   !$omp threadprivate (j)
 end
diff --git a/gcc/testsuite/gfortran.dg/gomp/linear-1.f90 
b/gcc/testsuite/gfortran.dg/gomp/linear-1.f90
index 0d7eb8e3f8fd..cc306ba49a70 100644
--- a/gcc/testsuite/gfortran.dg/gomp/linear-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/linear-1.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo (x, y)
   integer :: i, x, y
   common /i/ i
diff --git a/gcc/testsuite/gfortran.dg/gomp/linear-2.f90 
b/gcc/testsuite/gfortran.dg/gomp/linear-2.f90
index 88df96e9b8f1..31288a6e4305 100644
--- a/gcc/testsuite/gfortran.dg/gomp/linear-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/linear-2.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp -fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   implicit none (type, external)
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/linear-3.f90 
b/gcc/testsuite/gfortran.dg/gomp/linear-3.f90
index dee87b1a899a..ddbe4bc21ec2 100644
--- a/gcc/testsuite/gfortran.dg/gomp/linear-3.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/linear-3.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m2
   implicit none (type, external)
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/linear-4.f90 
b/gcc/testsuite/gfortran.dg/gomp/linear-4.f90
index ac532f81000b..e72211e458df 100644
--- a/gcc/testsuite/gfortran.dg/gomp/linear-4.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/linear-4.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 implicit none
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/linear-6.f90 
b/gcc/testsuite/gfortran.dg/gomp/linear-6.f90
index 57693ba6de1b..42123e251ed7 100644
--- a/gcc/testsuite/gfortran.dg/gomp/linear-6.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/linear-6.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 implicit none
 integer, parameter :: val = 1
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-12.f90 
b/gcc/testsuite/gfortran.dg/gomp/map-12.f90
index ac9a0f8aae04..e45ac73de346 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-12.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-12.f90
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fdump-tree-omplower -fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo
   implicit none
   integer :: a, b, b1
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-6.f90 
b/gcc/testsuite/gfortran.dg/gomp/map-6.f90
index 309f84543335..33df6900630f 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-6.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-6.f90
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 implicit none
 
 integer :: a, b, b1, b2, b3, b4, b5, b6
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-7.f90 
b/gcc/testsuite/gfortran.dg/gomp/map-7.f90
index 317090acb508..13c06ec01cf1 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-7.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-7.f90
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 implicit none
 
 integer :: a, b, close, always, to, present
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-8.f90 
b/gcc/testsuite/gfortran.dg/gomp/map-8.f90
index 15ebdd68b95b..c131291efad2 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-8.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-8.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 implicit none
 
 integer :: a
diff --git a/gcc/testsuite/gfortran.dg/gomp/order-8.f90 
b/gcc/testsuite/gfortran.dg/gomp/order-8.f90
index 80b4b722be0a..37b138b09cb5 100644
--- a/gcc/testsuite/gfortran.dg/gomp/order-8.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/order-8.f90
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine f1 (a)
   integer :: a(*)
   integer i
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr83977.f90 
b/gcc/testsuite/gfortran.dg/gomp/pr83977.f90
index b8ad1a7e39c1..dea5406dea8c 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr83977.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr83977.f90
@@ -1,6 +1,6 @@
 ! PR middle-end/83977
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 integer function foo (a, b)
    integer :: a, b
 !$omp declare simd uniform(b) linear(ref(a):b)
diff --git a/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 
b/gcc/testsuite/gfortran.dg/gomp/reduction1.f90
index cdc530bf0f25..a9789361e917 100644
--- a/gcc/testsuite/gfortran.dg/gomp/reduction1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/reduction1.f90
@@ -1,7 +1,7 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp -fmax-errors=100" }
 ! { dg-require-effective-target tls }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo (ia1)
 integer :: i1, i2, i3
 integer, dimension (*) :: ia1
diff --git a/gcc/testsuite/gfortran.dg/gomp/schedule-modifiers-2.f90 
b/gcc/testsuite/gfortran.dg/gomp/schedule-modifiers-2.f90
index 537fba23c111..864a36ce3371 100644
--- a/gcc/testsuite/gfortran.dg/gomp/schedule-modifiers-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/schedule-modifiers-2.f90
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo
   integer :: i
   !$omp do schedule (nonmonotonic: static, 2)
diff --git a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-55.f90 
b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-55.f90
index 4d2e1e509ef4..aa8effe3ec23 100644
--- a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-55.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-55.f90
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_doacross_start 
\[^\n\r]*, (?:2147483648|-2147483648), 0, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } 
}
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_post " 1 
"optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-56.f90 
b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-56.f90
index a5fa4c04c6fb..211619267571 100644
--- a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-56.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-56.f90
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times 
"__builtin_GOMP_loop(?:_ull)?_doacross_start \[^\n\r]*, 
(?:2147483649|-2147483647), 0, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } 
}
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross(?:_ull)?_post " 1 
"optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-57.f90 
b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-57.f90
index 6c52abacfaa4..f95ad77db0b8 100644
--- a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-57.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-57.f90
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times 
"__builtin_GOMP_loop(?:_ull)?_doacross_start \[^\n\r]*, 
(?:2147483650|-2147483646), 1, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } 
}
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross(?:_ull)?_post " 1 
"optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-58.f90 
b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-58.f90
index ae4f8bc5ef8f..eae6277b5de3 100644
--- a/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-58.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/workshare-reduction-58.f90
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_doacross_start 
\[^\n\r]*, (?:2147483651|-2147483645), 1, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } 
}
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_post " 1 
"optimized" } }
diff --git a/libgomp/testsuite/libgomp.fortran/allocate-8a.f90 
b/libgomp/testsuite/libgomp.fortran/allocate-8a.f90
index 5f6c8c1e2717..00416ed1a193 100644
--- a/libgomp/testsuite/libgomp.fortran/allocate-8a.f90
+++ b/libgomp/testsuite/libgomp.fortran/allocate-8a.f90
@@ -1,5 +1,6 @@
 ! { dg-additional-options "-fopenmp-allocators" }
 ! { dg-additional-options "-fdump-tree-omplower" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 program main
   use iso_c_binding
   use omp_lib
diff --git a/libgomp/testsuite/libgomp.fortran/allocators-1.f90 
b/libgomp/testsuite/libgomp.fortran/allocators-1.f90
index 935a37cd9594..8e1d1944fa5f 100644
--- a/libgomp/testsuite/libgomp.fortran/allocators-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/allocators-1.f90
@@ -1,9 +1,10 @@
 ! { dg-additional-options "-fopenmp-allocators -fdump-tree-original" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   use omp_lib
   use iso_c_binding, only: c_intptr_t
   implicit none (type,external)
-  integer(omp_allocator_handle_kind) :: handle  
+  integer(omp_allocator_handle_kind) :: handle
   integer(c_intptr_t) :: iptr
 end module m
 
diff --git a/libgomp/testsuite/libgomp.fortran/allocators-2.f90 
b/libgomp/testsuite/libgomp.fortran/allocators-2.f90
index c42fbd31e3e1..ada24de61310 100644
--- a/libgomp/testsuite/libgomp.fortran/allocators-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/allocators-2.f90
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fopenmp-allocators" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   implicit none (type, external)
   type t
diff --git a/libgomp/testsuite/libgomp.fortran/allocators-4.f90 
b/libgomp/testsuite/libgomp.fortran/allocators-4.f90
index 12689ea41ac0..a58c2d352839 100644
--- a/libgomp/testsuite/libgomp.fortran/allocators-4.f90
+++ b/libgomp/testsuite/libgomp.fortran/allocators-4.f90
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fopenmp-allocators" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 implicit none
 type t
diff --git a/libgomp/testsuite/libgomp.fortran/declare-target-1.f90 
b/libgomp/testsuite/libgomp.fortran/declare-target-1.f90
index d9abf685a545..894c54154958 100644
--- a/libgomp/testsuite/libgomp.fortran/declare-target-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/declare-target-1.f90
@@ -1,6 +1,6 @@
 ! { dg-do run }
 ! { dg-additional-sources declare-target-2.f90 }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module declare_target_1_mod
   integer :: var_x, var_y, var_z
   !$omp declare target(var_x)
diff --git a/libgomp/testsuite/libgomp.fortran/declare-target-2.f90 
b/libgomp/testsuite/libgomp.fortran/declare-target-2.f90
index 2210fc5a52f5..12ec7bc92b3b 100644
--- a/libgomp/testsuite/libgomp.fortran/declare-target-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/declare-target-2.f90
@@ -2,7 +2,6 @@
 ! file compiled together with declare-target-1.f90
 ! to verify inter-CU module handling of omp declare target.
 ! { dg-do compile { target { lp64 && { ! lp64 } } } }
-
 subroutine foo
   use declare_target_1_mod
 
diff --git a/libgomp/testsuite/libgomp.fortran/declare-target-indirect-1.f90 
b/libgomp/testsuite/libgomp.fortran/declare-target-indirect-1.f90
index 39a91dfcdcac..7a870acd56c6 100644
--- a/libgomp/testsuite/libgomp.fortran/declare-target-indirect-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/declare-target-indirect-1.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 contains
   integer function foo ()
diff --git a/libgomp/testsuite/libgomp.fortran/declare-target-indirect-2.f90 
b/libgomp/testsuite/libgomp.fortran/declare-target-indirect-2.f90
index d3baa81dd079..bdb08b5ed806 100644
--- a/libgomp/testsuite/libgomp.fortran/declare-target-indirect-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/declare-target-indirect-2.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 contains
   integer function foo ()
diff --git a/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 
b/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90
new file mode 100644
index 000000000000..c48bca2ffa97
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-warning "The specification of arguments to 'uses_allocators' at \\(1\\) 
where each item is of the form 'allocator\\(traits\\)' is deprecated since 
OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 11 }
+
+program test
+  use omp_lib
+  implicit none
+  integer(kind=omp_allocator_handle_kind) :: a1
+
+  type(omp_alloctrait), parameter :: trait(0) = [omp_alloctrait :: ]
+
+  !$omp target uses_allocators(omp_default_mem_alloc, a1(trait))
+  ! { dg-message "sorry, unimplemented: 'uses_allocators' clause with traits 
and memory spaces" "" { target *-*-* } .-1 }
+  block; end block
+end program
diff --git a/libgomp/testsuite/libgomp.fortran/doacross1.f90 
b/libgomp/testsuite/libgomp.fortran/doacross1.f90
index 2b15e7d7d115..da2d664816e7 100644
--- a/libgomp/testsuite/libgomp.fortran/doacross1.f90
+++ b/libgomp/testsuite/libgomp.fortran/doacross1.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
   integer, parameter :: N = 256
   integer, save :: a(N), b(N / 16, 8, 4), c(N / 32, 8, 8)
   integer, save, volatile :: d, e
diff --git a/libgomp/testsuite/libgomp.fortran/doacross2.f90 
b/libgomp/testsuite/libgomp.fortran/doacross2.f90
index 213ac715f9ed..47aa7d1873c3 100644
--- a/libgomp/testsuite/libgomp.fortran/doacross2.f90
+++ b/libgomp/testsuite/libgomp.fortran/doacross2.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
   integer, parameter :: N = 256
   integer, save :: a(N), b(N / 16, 8, 4), c(N / 32, 8, 8), g(N/16,8,6)
   integer, save, volatile :: d, e
diff --git a/libgomp/testsuite/libgomp.fortran/doacross3.f90 
b/libgomp/testsuite/libgomp.fortran/doacross3.f90
index 5ba57008c6f3..6deaf7164e0c 100644
--- a/libgomp/testsuite/libgomp.fortran/doacross3.f90
+++ b/libgomp/testsuite/libgomp.fortran/doacross3.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
   integer, parameter :: N = 256
   integer, save :: a(N), b(N / 16, 8, 4), c(N / 32, 8, 8), g(N/16,8,6)
   integer, save, volatile :: d, e
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-ptr-2.f90 
b/libgomp/testsuite/libgomp.fortran/map-alloc-ptr-2.f90
index c69a9bf44ad1..1ff6a7f9024d 100644
--- a/libgomp/testsuite/libgomp.fortran/map-alloc-ptr-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-ptr-2.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-! 
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! PR fortran/96668
 
 module m
diff --git a/libgomp/testsuite/libgomp.fortran/pr84418-1.f90 
b/libgomp/testsuite/libgomp.fortran/pr84418-1.f90
index 8547fceb79e8..65dae5d0b0b0 100644
--- a/libgomp/testsuite/libgomp.fortran/pr84418-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/pr84418-1.f90
@@ -20,7 +20,7 @@
 contains
   real function foo (x, y)
     real :: x, y
-    !$omp declare simd linear (ref (x, y))
+    !$omp declare simd linear (ref (x, y)) ! { dg-warning "Specification of 
the list items as arguments to the modifiers at \\(1\\) is deprecated since 
OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
     foo = x + y
   end function
 end
diff --git a/libgomp/testsuite/libgomp.fortran/pr84418-2.f90 
b/libgomp/testsuite/libgomp.fortran/pr84418-2.f90
index 481e24e5d8a8..0a50a539ae8c 100644
--- a/libgomp/testsuite/libgomp.fortran/pr84418-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/pr84418-2.f90
@@ -3,7 +3,7 @@
 ! { dg-options "-fno-inline" }
 ! { dg-additional-options "-msse2" { target sse2_runtime } }
 ! { dg-additional-options "-mavx" { target avx_runtime } }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
   type p
     integer :: i, j
   end type
@@ -25,7 +25,7 @@
   do i = 1, 1024
     if (c(i).ne.(6 * i)) stop 1
   end do
-contains  
+contains
   function foo (x, y)
     type (p) :: x
     integer :: y(4), foo
diff --git a/libgomp/testsuite/libgomp.fortran/reduction1.f90 
b/libgomp/testsuite/libgomp.fortran/reduction1.f90
index 622a7059d6c6..f02526b715e5 100644
--- a/libgomp/testsuite/libgomp.fortran/reduction1.f90
+++ b/libgomp/testsuite/libgomp.fortran/reduction1.f90
@@ -77,7 +77,7 @@
   cnt = -1
 
 !$omp parallel num_threads (3) private (n) reduction (.or.:v) &
-!$omp & reduction (-:i, ia, r, ra, d, da, c, ca)
+!$omp & reduction (-:i, ia, r, ra, d, da, c, ca) ! { dg-warning "'-' operator 
at \\(1\\) for reductions deprecated in OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" 
}
 !$ if (i .ne. 0 .or. any (ia .ne. 0)) v = .true.
 !$ if (r .ne. 0 .or. any (ra .ne. 0)) v = .true.
 !$ if (d .ne. 0 .or. any (da .ne. 0)) v = .true.
diff --git a/libgomp/testsuite/libgomp.fortran/udr11.f90 
b/libgomp/testsuite/libgomp.fortran/udr11.f90
index 57989be4a010..a60822cd7aab 100644
--- a/libgomp/testsuite/libgomp.fortran/udr11.f90
+++ b/libgomp/testsuite/libgomp.fortran/udr11.f90
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module udr11
   type dt
     integer :: x = 0
diff --git a/libgomp/testsuite/libgomp.fortran/uses_allocators_1.f90 
b/libgomp/testsuite/libgomp.fortran/uses_allocators_1.f90
index 66984d98c893..46f18e20ed88 100644
--- a/libgomp/testsuite/libgomp.fortran/uses_allocators_1.f90
+++ b/libgomp/testsuite/libgomp.fortran/uses_allocators_1.f90
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 
 subroutine test
   use omp_lib
diff --git a/libgomp/testsuite/libgomp.fortran/uses_allocators_2.f90 
b/libgomp/testsuite/libgomp.fortran/uses_allocators_2.f90
index 073279697758..0ab09975f490 100644
--- a/libgomp/testsuite/libgomp.fortran/uses_allocators_2.f90
+++ b/libgomp/testsuite/libgomp.fortran/uses_allocators_2.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! Minimal test for valid code:
 ! - predefined allocators do not need any special treatment in uses_allocators
 !   (as 'requires dynamic_allocators' is the default).

Reply via email to