[gcc r16-6030] openmp: Bump Version from 4.5 to 5.2 (2/4)

Gio T supers1ngular@gcc.gnu.org
Thu Dec 11 15:48:08 GMT 2025


https://gcc.gnu.org/g:382edf047effcd5b1ce66389742bd1b3e178ac95

commit r16-6030-g382edf047effcd5b1ce66389742bd1b3e178ac95
Author: supers1ngular <supers1ngular@baylibre.com>
Date:   Thu Dec 11 07:45:04 2025 -0800

    openmp: Bump Version from 4.5 to 5.2 (2/4)
    
    Implements the OpenMP 5.2 C and C++ deprecations. Uses the warning
    established in patch 1/4, -Wdeprecated-openmp, for said deprecations.
    Not implemented is 'uses_allocators', since the base is not yet in
    mainline, along with the relaxing of constraints for the interop
    construct, since this is not a deprecation. Additionally does not
    deprecate 'destroy' with no arguments on depobj construct, since
    this was undeprecated in OpenMP 6.0. Adds new tests.
    
    gcc/c/ChangeLog:
    
            * c-parser.cc (c_parser_omp_clause_reduction): Deprecate '-'
            operator for reductions.
            (c_parser_omp_clause_linear): Deprecate modifiers with parens.
            (c_parser_omp_clause_depend): Deprecate 'sink' and 'source'
            modifiers for 'depend' clause.
            (c_parser_omp_clause_map): Map clause modifiers comma-separated.
            (c_parser_omp_declare_target): Deprecate synonymous omp declare
            target for omp begin declare target. Deprecate 'to' clause.
            (c_parser_omp_metadirective): Deprecate default clause on
            metadirectives.
    
    gcc/cp/ChangeLog:
    
            * parser.cc (cp_parser_omp_clause_reduction): Deprecate '-'
            operator.
            (cp_parser_omp_clause_linear): Deprecate modifiers with parens.
            (cp_parser_omp_clause_depend): Deprecate sink and source.
            (cp_parser_omp_clause_map): Map clause modifiers
            comma-separated.
            (cp_parser_omp_declare_target): Deprecate synonymous omp declare
            target for omp begin declare target. Deprecate to clause.
            (cp_parser_omp_metadirective): Deprecate default clause on
            metadirectives.
    
    libgomp/ChangeLog:
    
            * testsuite/libgomp.c++/declare_target-1.C: Suppress warnings.
            * testsuite/libgomp.c++/depobj-1.C: Ditto.
            * testsuite/libgomp.c++/doacross-1.C: Ditto.
            * testsuite/libgomp.c++/for-15.C: Ditto.
            * testsuite/libgomp.c++/for-24.C: Ditto.
            * testsuite/libgomp.c++/pr101544-1-O0.C: Ditto.
            * testsuite/libgomp.c++/pr101544-1.C: Ditto.
            * testsuite/libgomp.c++/pr96835-1-O0.C: Ditto.
            * testsuite/libgomp.c++/pr96835-1.C: Ditto.
            * testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C: Ditto.
            * testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C: Ditto.
            * testsuite/libgomp.c++/static-aggr-constructor-destructor-3.C: Ditto.
            * testsuite/libgomp.c++/target-13.C: Ditto.
            * testsuite/libgomp.c++/target-cdtor-1.C: Ditto.
            * testsuite/libgomp.c++/target-cdtor-2.C: Ditto.
            * testsuite/libgomp.c++/target-std__array-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__array-concurrent.C: Ditto.
            * testsuite/libgomp.c++/target-std__cmath.C: Ditto.
            * testsuite/libgomp.c++/target-std__complex.C: Ditto.
            * testsuite/libgomp.c++/target-std__deque-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__deque-concurrent.C: Ditto.
            * testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__forward_list-concurrent.C: Ditto.
            * testsuite/libgomp.c++/target-std__list-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__list-concurrent.C: Ditto.
            * testsuite/libgomp.c++/target-std__numbers.C: Ditto.
            * testsuite/libgomp.c++/target-std__span-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__span-concurrent.C: Ditto.
            * testsuite/libgomp.c++/target-std__valarray-1.C: Ditto.
            * testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__valarray-concurrent.C: Ditto.
            * testsuite/libgomp.c++/target-std__vector-concurrent-usm.C: Ditto.
            * testsuite/libgomp.c++/target-std__vector-concurrent.C: Ditto.
            * testsuite/libgomp.c-c++-common/declare_target-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/depend-2.c: Ditto.
            * testsuite/libgomp.c-c++-common/depobj-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-11.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-12.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-16.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-3.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-5.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-6.c: Ditto.
            * testsuite/libgomp.c-c++-common/for-9.c: Ditto.
            * testsuite/libgomp.c-c++-common/function-not-offloaded.c: Ditto.
            * testsuite/libgomp.c-c++-common/metadirective-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/metadirective-2.c: Ditto.
            * testsuite/libgomp.c-c++-common/metadirective-3.c: Ditto.
            * testsuite/libgomp.c-c++-common/metadirective-5.c: Ditto.
            * testsuite/libgomp.c-c++-common/monotonic-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/monotonic-2.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr100059-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-2.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-4.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-5.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-6.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-7.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-8.c: Ditto.
            * testsuite/libgomp.c-c++-common/pr66199-9.c: Ditto.
            * testsuite/libgomp.c-c++-common/ptr-attach-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/reverse-offload-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-10.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-40.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-abi-struct-1-O0.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-abi-struct-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-cdtor-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/target-same-name-1.c: Ditto.
            * testsuite/libgomp.c-c++-common/task-reduction-14.c: Ditto.
            * testsuite/libgomp.c-c++-common/variable-not-offloaded.c: Ditto.
            * testsuite/libgomp.c/declare-variant-3.c: Ditto.
            * testsuite/libgomp.c/declare-variant-4.c: Ditto.
            * testsuite/libgomp.c/doacross-1.c: Ditto.
            * testsuite/libgomp.c/doacross-2.c: Ditto.
            * testsuite/libgomp.c/doacross-3.c: Ditto.
            * testsuite/libgomp.c/examples-4/async_target-1.c: Ditto.
            * testsuite/libgomp.c/examples-4/declare_target-1.c: Ditto.
            * testsuite/libgomp.c/examples-4/declare_target-3.c: Ditto.
            * testsuite/libgomp.c/examples-4/declare_target-4.c: Ditto.
            * testsuite/libgomp.c/examples-4/declare_target-5.c: Ditto.
            * testsuite/libgomp.c/max_vf-1.c: Ditto.
            * testsuite/libgomp.c/pr81778.c: Ditto.
            * testsuite/libgomp.c/pr86660.c: Ditto.
            * testsuite/libgomp.c/reduction-4.c: Ditto.
            * testsuite/libgomp.c/switch-conversion.c: Ditto.
            * testsuite/libgomp.c/target-26.c: Ditto.
            * testsuite/libgomp.c/target-28.c: Ditto.
            * testsuite/libgomp.c/target-30.c: Ditto.
            * testsuite/libgomp.c/target-32.c: Ditto.
            * testsuite/libgomp.c/target-35.c: Ditto.
            * testsuite/libgomp.c/target-38.c: Ditto.
            * testsuite/libgomp.c/target-39.c: Ditto.
            * testsuite/libgomp.c/target-9.c: Ditto.
            * testsuite/libgomp.c/target-link-1.c: Ditto.
            * testsuite/libgomp.c/target-teams-1.c: Ditto.
            * testsuite/libgomp.c/thread-limit-2.c: Ditto.
            * testsuite/libgomp.oacc-c-c++-common/vred2d-128.c: Ditto.
    
    gcc/testsuite/ChangeLog:
    
            * c-c++-common/gomp/Wparentheses-2.c: Suppress warnings.
            * c-c++-common/gomp/attrs-metadirective-1.c: Ditto.
            * c-c++-common/gomp/attrs-metadirective-2.c: Ditto.
            * c-c++-common/gomp/attrs-metadirective-3.c: Ditto.
            * c-c++-common/gomp/attrs-metadirective-4.c: Ditto.
            * c-c++-common/gomp/attrs-metadirective-5.c: Ditto.
            * c-c++-common/gomp/attrs-metadirective-8.c: Ditto.
            * c-c++-common/gomp/begin-declare-target-1.c: Ditto.
            * c-c++-common/gomp/begin-declare-target-2.c: Ditto.
            * c-c++-common/gomp/clauses-3.c: Ditto.
            * c-c++-common/gomp/declare-target-1.c: Ditto.
            * c-c++-common/gomp/declare-target-2.c: Ditto.
            * c-c++-common/gomp/declare-target-3.c: Ditto.
            * c-c++-common/gomp/declare-target-4.c: Ditto.
            * c-c++-common/gomp/declare-target-5.c: Ditto.
            * c-c++-common/gomp/declare-target-7.c: Ditto.
            * c-c++-common/gomp/declare-target-indirect-1.c: Ditto.
            * c-c++-common/gomp/declare-target-indirect-2.c: Ditto.
            * c-c++-common/gomp/declare-variant-10.c: Ditto.
            * c-c++-common/gomp/declare-variant-8.c: Ditto.
            * c-c++-common/gomp/defaultmap-2.c: Ditto.
            * c-c++-common/gomp/defaultmap-3.c: Ditto.
            * c-c++-common/gomp/depend-iterator-2.c: Ditto.
            * c-c++-common/gomp/depobj-1.c: Ditto.
            * c-c++-common/gomp/directive-1.c: Ditto.
            * c-c++-common/gomp/distribute-1.c: Ditto.
            * c-c++-common/gomp/doacross-1.c: Ditto.
            * c-c++-common/gomp/doacross-2.c: Ditto.
            * c-c++-common/gomp/doacross-3.c: Ditto.
            * c-c++-common/gomp/doacross-4.c: Ditto.
            * c-c++-common/gomp/doacross-8.c: Ditto.
            * c-c++-common/gomp/linear-1.c: Ditto.
            * c-c++-common/gomp/linear-2.c: Ditto.
            * c-c++-common/gomp/linear-3.c: Ditto.
            * c-c++-common/gomp/loop-6.c: Ditto.
            * c-c++-common/gomp/map-1.c: Ditto.
            * c-c++-common/gomp/map-3.c: Ditto.
            * c-c++-common/gomp/map-6.c: Ditto.
            * c-c++-common/gomp/metadirective-1.c: Ditto.
            * c-c++-common/gomp/metadirective-2.c: Ditto.
            * c-c++-common/gomp/metadirective-3.c: Ditto.
            * c-c++-common/gomp/metadirective-4.c: Ditto.
            * c-c++-common/gomp/metadirective-5.c: Ditto.
            * c-c++-common/gomp/metadirective-8.c: Ditto.
            * c-c++-common/gomp/metadirective-construct.c: Ditto.
            * c-c++-common/gomp/metadirective-device.c: Ditto.
            * c-c++-common/gomp/metadirective-target-device-1.c: Ditto.
            * c-c++-common/gomp/metadirective-target-device-2.c: Ditto.
            * c-c++-common/gomp/order-2.c: Ditto.
            * c-c++-common/gomp/ordered-3.c: Ditto.
            * c-c++-common/gomp/ordered-5.c: Ditto.
            * c-c++-common/gomp/pr102640.c: Ditto.
            * c-c++-common/gomp/pr106836.c: Ditto.
            * c-c++-common/gomp/pr120180-1.c: Ditto.
            * c-c++-common/gomp/pr88203-1.c: Ditto.
            * c-c++-common/gomp/pr88203-2.c: Ditto.
            * c-c++-common/gomp/pr88203-3.c: Ditto.
            * c-c++-common/gomp/pr91401-2.c: Ditto.
            * c-c++-common/gomp/pr91987.c: Ditto.
            * c-c++-common/gomp/reverse-offload-1.c: Ditto.
            * c-c++-common/gomp/schedule-modifiers-1.c: Ditto.
            * c-c++-common/gomp/sink-1.c: Ditto.
            * c-c++-common/gomp/sink-2.c: Ditto.
            * c-c++-common/gomp/sink-3.c: Ditto.
            * c-c++-common/gomp/sink-4.c: Ditto.
            * c-c++-common/gomp/sink-5.c: Ditto.
            * c-c++-common/gomp/target-teams-1.c: Ditto.
            * g++.dg/gomp/attrs-12.C: Ditto.
            * g++.dg/gomp/attrs-5.C: Ditto.
            * g++.dg/gomp/attrs-9.C: Ditto.
            * g++.dg/gomp/clause-3.C: Ditto.
            * g++.dg/gomp/declare-simd-3.C: Ditto.
            * g++.dg/gomp/declare-simd-4.C: Ditto.
            * g++.dg/gomp/declare-simd-6.C: Ditto.
            * g++.dg/gomp/declare-simd-7.C: Ditto.
            * g++.dg/gomp/declare-simd-8.C: Ditto.
            * g++.dg/gomp/declare-target-1.C: Ditto.
            * g++.dg/gomp/declare-target-2.C: Ditto.
            * g++.dg/gomp/declare-target-3.C: Ditto.
            * g++.dg/gomp/declare-target-indirect-1.C: Ditto.
            * g++.dg/gomp/depend-iterator-2.C: Ditto.
            * g++.dg/gomp/depobj-1.C: Ditto.
            * g++.dg/gomp/doacross-2.C: Ditto.
            * g++.dg/gomp/linear-1.C: Ditto.
            * g++.dg/gomp/linear-2.C: Ditto.
            * g++.dg/gomp/linear-3.C: Ditto.
            * g++.dg/gomp/linear-5.C: Ditto.
            * g++.dg/gomp/map-1.C: Ditto.
            * g++.dg/gomp/pr118876.C: Ditto.
            * g++.dg/gomp/pr119370.C: Ditto.
            * g++.dg/gomp/sink-1.C: Ditto.
            * g++.dg/gomp/sink-2.C: Ditto.
            * g++.dg/gomp/sink-3.C: Ditto.
            * g++.dg/gomp/target-simd-clone-1.C: Ditto.
            * g++.dg/gomp/target-simd-clone-2.C: Ditto.
            * g++.dg/gomp/target-teams-1.C: Ditto.
            * g++.dg/gomp/udr-5.C: Ditto.
            * gcc.dg/gomp/attrs-12.c: Ditto.
            * gcc.dg/gomp/attrs-5.c: Ditto.
            * gcc.dg/gomp/attrs-9.c: Ditto.
            * gcc.dg/gomp/clause-1.c: Ditto.
            * gcc.dg/gomp/declare-simd-3.c: Ditto.
            * gcc.dg/gomp/linear-1.c: Ditto.
            * gcc.dg/gomp/metadirective-1.c: Ditto.
            * gcc.dg/gomp/pr104757.c: Ditto.
            * gcc.dg/gomp/sink-fold-1.c: Ditto.
            * gcc.dg/gomp/sink-fold-2.c: Ditto.
            * gcc.dg/gomp/sink-fold-3.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-1.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-2.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-3.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-4.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-5.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-6.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-7.c: Ditto.
            * gcc.dg/gomp/target-simd-clone-8.c: Ditto.
            * gcc.dg/gomp/workshare-reduction-55.c: Ditto.
            * gcc.dg/gomp/workshare-reduction-56.c: Ditto.
            * gcc.dg/gomp/workshare-reduction-57.c: Ditto.
            * gcc.dg/gomp/workshare-reduction-58.c: Ditto.
            * c-c++-common/gomp/52-deps.c: New test.
            * g++.dg/gomp/map-csm-dep.C: New test.
            * gcc.dg/gomp/map-csm-dep.c: New test.

Diff:
---
 gcc/c/c-parser.cc                                  | 42 ++++++++++++++++++-
 gcc/cp/parser.cc                                   | 48 ++++++++++++++++++++--
 gcc/testsuite/c-c++-common/gomp/52-deps.c          | 32 +++++++++++++++
 gcc/testsuite/c-c++-common/gomp/Wparentheses-2.c   |  2 +-
 .../c-c++-common/gomp/attrs-metadirective-1.c      |  4 +-
 .../c-c++-common/gomp/attrs-metadirective-2.c      |  2 +-
 .../c-c++-common/gomp/attrs-metadirective-3.c      |  4 +-
 .../c-c++-common/gomp/attrs-metadirective-4.c      |  2 +-
 .../c-c++-common/gomp/attrs-metadirective-5.c      |  2 +-
 .../c-c++-common/gomp/attrs-metadirective-8.c      |  2 +-
 .../c-c++-common/gomp/begin-declare-target-1.c     |  2 +-
 .../c-c++-common/gomp/begin-declare-target-2.c     |  2 +-
 gcc/testsuite/c-c++-common/gomp/clauses-3.c        |  1 +
 gcc/testsuite/c-c++-common/gomp/declare-target-1.c |  2 +-
 gcc/testsuite/c-c++-common/gomp/declare-target-2.c |  2 +-
 gcc/testsuite/c-c++-common/gomp/declare-target-3.c |  2 +-
 gcc/testsuite/c-c++-common/gomp/declare-target-4.c |  2 +-
 gcc/testsuite/c-c++-common/gomp/declare-target-5.c |  1 +
 gcc/testsuite/c-c++-common/gomp/declare-target-7.c |  2 +-
 .../c-c++-common/gomp/declare-target-indirect-1.c  |  2 +-
 .../c-c++-common/gomp/declare-target-indirect-2.c  |  2 +-
 .../c-c++-common/gomp/declare-variant-10.c         |  2 +-
 .../c-c++-common/gomp/declare-variant-8.c          |  2 +-
 gcc/testsuite/c-c++-common/gomp/defaultmap-2.c     |  2 +-
 gcc/testsuite/c-c++-common/gomp/defaultmap-3.c     |  2 +-
 .../c-c++-common/gomp/depend-iterator-2.c          |  1 +
 gcc/testsuite/c-c++-common/gomp/depobj-1.c         |  1 +
 gcc/testsuite/c-c++-common/gomp/directive-1.c      |  1 +
 gcc/testsuite/c-c++-common/gomp/distribute-1.c     |  1 +
 gcc/testsuite/c-c++-common/gomp/doacross-1.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/doacross-2.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/doacross-3.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/doacross-4.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/doacross-8.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/linear-1.c         |  2 +-
 gcc/testsuite/c-c++-common/gomp/linear-2.c         |  2 +-
 gcc/testsuite/c-c++-common/gomp/linear-3.c         |  2 +-
 gcc/testsuite/c-c++-common/gomp/loop-6.c           |  1 +
 gcc/testsuite/c-c++-common/gomp/map-1.c            |  2 +-
 gcc/testsuite/c-c++-common/gomp/map-3.c            |  1 +
 gcc/testsuite/c-c++-common/gomp/map-6.c            | 12 +++---
 gcc/testsuite/c-c++-common/gomp/metadirective-1.c  |  4 +-
 gcc/testsuite/c-c++-common/gomp/metadirective-2.c  |  2 +-
 gcc/testsuite/c-c++-common/gomp/metadirective-3.c  |  4 +-
 gcc/testsuite/c-c++-common/gomp/metadirective-4.c  |  2 +-
 gcc/testsuite/c-c++-common/gomp/metadirective-5.c  |  2 +-
 gcc/testsuite/c-c++-common/gomp/metadirective-8.c  |  2 +-
 .../c-c++-common/gomp/metadirective-construct.c    |  6 +--
 .../c-c++-common/gomp/metadirective-device.c       |  4 +-
 .../gomp/metadirective-target-device-1.c           |  4 +-
 .../gomp/metadirective-target-device-2.c           |  2 +-
 gcc/testsuite/c-c++-common/gomp/order-2.c          |  3 +-
 gcc/testsuite/c-c++-common/gomp/ordered-3.c        |  2 +-
 gcc/testsuite/c-c++-common/gomp/ordered-5.c        |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr102640.c         |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr106836.c         |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr120180-1.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr88203-1.c        |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr88203-2.c        |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr88203-3.c        |  2 +-
 gcc/testsuite/c-c++-common/gomp/pr91401-2.c        |  1 +
 gcc/testsuite/c-c++-common/gomp/pr91987.c          |  2 +-
 .../c-c++-common/gomp/reverse-offload-1.c          |  2 +-
 .../c-c++-common/gomp/schedule-modifiers-1.c       |  2 +-
 gcc/testsuite/c-c++-common/gomp/sink-1.c           |  2 +-
 gcc/testsuite/c-c++-common/gomp/sink-2.c           |  2 +-
 gcc/testsuite/c-c++-common/gomp/sink-3.c           |  2 +-
 gcc/testsuite/c-c++-common/gomp/sink-4.c           |  2 +-
 gcc/testsuite/c-c++-common/gomp/sink-5.c           |  2 +-
 gcc/testsuite/c-c++-common/gomp/target-teams-1.c   |  2 +-
 gcc/testsuite/g++.dg/gomp/attrs-12.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/attrs-5.C                |  2 +-
 gcc/testsuite/g++.dg/gomp/attrs-9.C                |  2 +-
 gcc/testsuite/g++.dg/gomp/clause-3.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-simd-3.C         |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-simd-4.C         |  1 +
 gcc/testsuite/g++.dg/gomp/declare-simd-6.C         |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-simd-7.C         |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-simd-8.C         |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-target-1.C       |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-target-2.C       |  2 +-
 gcc/testsuite/g++.dg/gomp/declare-target-3.C       |  2 +-
 .../g++.dg/gomp/declare-target-indirect-1.C        |  2 +-
 gcc/testsuite/g++.dg/gomp/depend-iterator-2.C      |  1 +
 gcc/testsuite/g++.dg/gomp/depobj-1.C               |  1 +
 gcc/testsuite/g++.dg/gomp/doacross-2.C             |  2 +-
 gcc/testsuite/g++.dg/gomp/linear-1.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/linear-2.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/linear-3.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/linear-5.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/map-1.C                  |  1 +
 gcc/testsuite/g++.dg/gomp/map-csm-dep.C            | 40 ++++++++++++++++++
 gcc/testsuite/g++.dg/gomp/pr118876.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/pr119370.C               |  2 +-
 gcc/testsuite/g++.dg/gomp/sink-1.C                 |  2 +-
 gcc/testsuite/g++.dg/gomp/sink-2.C                 |  2 +-
 gcc/testsuite/g++.dg/gomp/sink-3.C                 |  2 +-
 gcc/testsuite/g++.dg/gomp/target-simd-clone-1.C    |  2 +-
 gcc/testsuite/g++.dg/gomp/target-simd-clone-2.C    |  2 +-
 gcc/testsuite/g++.dg/gomp/target-teams-1.C         |  2 +-
 gcc/testsuite/g++.dg/gomp/udr-5.C                  |  2 +-
 gcc/testsuite/gcc.dg/gomp/attrs-12.c               |  2 +-
 gcc/testsuite/gcc.dg/gomp/attrs-5.c                |  2 +-
 gcc/testsuite/gcc.dg/gomp/attrs-9.c                |  2 +-
 gcc/testsuite/gcc.dg/gomp/clause-1.c               |  2 +-
 gcc/testsuite/gcc.dg/gomp/declare-simd-3.c         |  1 +
 gcc/testsuite/gcc.dg/gomp/linear-1.c               |  2 +-
 gcc/testsuite/gcc.dg/gomp/map-csm-dep.c            | 30 ++++++++++++++
 gcc/testsuite/gcc.dg/gomp/metadirective-1.c        |  1 +
 gcc/testsuite/gcc.dg/gomp/pr104757.c               |  2 +-
 gcc/testsuite/gcc.dg/gomp/sink-fold-1.c            |  2 +-
 gcc/testsuite/gcc.dg/gomp/sink-fold-2.c            |  2 +-
 gcc/testsuite/gcc.dg/gomp/sink-fold-3.c            |  2 +-
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-1.c    |  2 +-
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-2.c    |  4 +-
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-3.c    |  2 +-
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-4.c    |  4 +-
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-5.c    |  6 +--
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-6.c    |  6 +--
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-7.c    |  4 +-
 gcc/testsuite/gcc.dg/gomp/target-simd-clone-8.c    |  4 +-
 gcc/testsuite/gcc.dg/gomp/workshare-reduction-55.c |  1 +
 gcc/testsuite/gcc.dg/gomp/workshare-reduction-56.c |  2 +-
 gcc/testsuite/gcc.dg/gomp/workshare-reduction-57.c |  1 +
 gcc/testsuite/gcc.dg/gomp/workshare-reduction-58.c |  1 +
 libgomp/testsuite/libgomp.c++/declare_target-1.C   |  3 +-
 libgomp/testsuite/libgomp.c++/depobj-1.C           |  1 +
 libgomp/testsuite/libgomp.c++/doacross-1.C         |  2 +-
 libgomp/testsuite/libgomp.c++/for-15.C             |  2 +-
 libgomp/testsuite/libgomp.c++/for-24.C             |  2 +-
 libgomp/testsuite/libgomp.c++/pr101544-1-O0.C      |  2 +-
 libgomp/testsuite/libgomp.c++/pr101544-1.C         |  1 +
 libgomp/testsuite/libgomp.c++/pr96835-1-O0.C       |  2 +-
 libgomp/testsuite/libgomp.c++/pr96835-1.C          |  1 +
 .../static-aggr-constructor-destructor-1.C         |  2 +-
 .../static-aggr-constructor-destructor-2.C         |  2 +-
 .../static-aggr-constructor-destructor-3.C         |  2 +-
 libgomp/testsuite/libgomp.c++/target-13.C          |  1 +
 libgomp/testsuite/libgomp.c++/target-cdtor-1.C     |  2 +-
 libgomp/testsuite/libgomp.c++/target-cdtor-2.C     |  2 +-
 .../libgomp.c++/target-std__array-concurrent-usm.C |  1 +
 .../libgomp.c++/target-std__array-concurrent.C     |  1 +
 libgomp/testsuite/libgomp.c++/target-std__cmath.C  |  2 +-
 .../testsuite/libgomp.c++/target-std__complex.C    |  2 +-
 .../libgomp.c++/target-std__deque-concurrent-usm.C |  1 +
 .../libgomp.c++/target-std__deque-concurrent.C     |  2 +-
 .../target-std__forward_list-concurrent-usm.C      |  1 +
 .../target-std__forward_list-concurrent.C          |  2 +-
 .../libgomp.c++/target-std__list-concurrent-usm.C  |  1 +
 .../libgomp.c++/target-std__list-concurrent.C      |  2 +-
 .../testsuite/libgomp.c++/target-std__numbers.C    |  1 +
 .../libgomp.c++/target-std__span-concurrent-usm.C  |  2 +-
 .../libgomp.c++/target-std__span-concurrent.C      |  2 +-
 .../testsuite/libgomp.c++/target-std__valarray-1.C |  2 +-
 .../target-std__valarray-concurrent-usm.C          |  1 +
 .../libgomp.c++/target-std__valarray-concurrent.C  |  2 +-
 .../target-std__vector-concurrent-usm.C            |  1 +
 .../libgomp.c++/target-std__vector-concurrent.C    |  2 +-
 .../libgomp.c-c++-common/declare_target-1.c        |  3 +-
 libgomp/testsuite/libgomp.c-c++-common/depend-2.c  |  5 ++-
 libgomp/testsuite/libgomp.c-c++-common/depobj-1.c  |  1 +
 libgomp/testsuite/libgomp.c-c++-common/for-11.c    |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/for-12.c    |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/for-16.c    |  1 +
 libgomp/testsuite/libgomp.c-c++-common/for-3.c     |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/for-5.c     |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/for-6.c     |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/for-9.c     |  2 +-
 .../libgomp.c-c++-common/function-not-offloaded.c  |  2 +-
 .../libgomp.c-c++-common/metadirective-1.c         |  2 +-
 .../libgomp.c-c++-common/metadirective-2.c         |  2 +-
 .../libgomp.c-c++-common/metadirective-3.c         |  2 +-
 .../libgomp.c-c++-common/metadirective-5.c         |  2 +-
 .../testsuite/libgomp.c-c++-common/monotonic-1.c   |  6 +--
 .../testsuite/libgomp.c-c++-common/monotonic-2.c   |  1 +
 .../testsuite/libgomp.c-c++-common/pr100059-1.c    |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-2.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-4.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-5.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-6.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-7.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-8.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/pr66199-9.c |  2 +-
 .../testsuite/libgomp.c-c++-common/ptr-attach-1.c  |  2 +-
 .../libgomp.c-c++-common/reverse-offload-1.c       |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/target-1.c  |  1 +
 libgomp/testsuite/libgomp.c-c++-common/target-10.c |  2 +-
 libgomp/testsuite/libgomp.c-c++-common/target-40.c |  2 +-
 .../libgomp.c-c++-common/target-abi-struct-1-O0.c  |  2 +-
 .../libgomp.c-c++-common/target-abi-struct-1.c     |  1 +
 .../libgomp.c-c++-common/target-cdtor-1.c          |  2 +-
 .../libgomp.c-c++-common/target-same-name-1.c      |  1 +
 .../libgomp.c-c++-common/task-reduction-14.c       |  1 +
 .../libgomp.c-c++-common/variable-not-offloaded.c  |  2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3.c    |  2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4.c    |  2 +-
 libgomp/testsuite/libgomp.c/doacross-1.c           |  1 +
 libgomp/testsuite/libgomp.c/doacross-2.c           |  1 +
 libgomp/testsuite/libgomp.c/doacross-3.c           |  1 +
 .../libgomp.c/examples-4/async_target-1.c          |  2 +-
 .../libgomp.c/examples-4/declare_target-1.c        |  1 +
 .../libgomp.c/examples-4/declare_target-3.c        |  2 +-
 .../libgomp.c/examples-4/declare_target-4.c        |  2 +-
 .../libgomp.c/examples-4/declare_target-5.c        |  2 +-
 libgomp/testsuite/libgomp.c/max_vf-1.c             |  2 +-
 libgomp/testsuite/libgomp.c/pr81778.c              |  2 +-
 libgomp/testsuite/libgomp.c/pr86660.c              |  1 +
 libgomp/testsuite/libgomp.c/reduction-4.c          |  3 +-
 libgomp/testsuite/libgomp.c/switch-conversion.c    |  2 +-
 libgomp/testsuite/libgomp.c/target-26.c            |  1 +
 libgomp/testsuite/libgomp.c/target-28.c            |  1 +
 libgomp/testsuite/libgomp.c/target-30.c            |  1 +
 libgomp/testsuite/libgomp.c/target-32.c            |  1 +
 libgomp/testsuite/libgomp.c/target-35.c            |  1 +
 libgomp/testsuite/libgomp.c/target-38.c            |  1 +
 libgomp/testsuite/libgomp.c/target-39.c            |  2 +-
 libgomp/testsuite/libgomp.c/target-9.c             |  2 +-
 libgomp/testsuite/libgomp.c/target-link-1.c        |  1 +
 libgomp/testsuite/libgomp.c/target-teams-1.c       |  2 +-
 libgomp/testsuite/libgomp.c/thread-limit-2.c       |  2 +-
 .../libgomp.oacc-c-c++-common/vred2d-128.c         |  1 +
 221 files changed, 431 insertions(+), 196 deletions(-)

diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index c81243d2ad21..f97b294f98ee 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -18849,6 +18849,9 @@ c_parser_omp_clause_reduction (c_parser *parser, enum omp_clause_code kind,
 	  code = MULT_EXPR;
 	  break;
 	case CPP_MINUS:
+	  warning_at (c_parser_peek_token (parser)->location,
+	    OPT_Wdeprecated_openmp,
+	    "%<-%> operator for reductions deprecated in OpenMP 5.2");
 	  code = MINUS_EXPR;
 	  break;
 	case CPP_AND:
@@ -19597,6 +19600,9 @@ c_parser_omp_clause_linear (c_parser *parser, tree list)
 	kind = OMP_CLAUSE_LINEAR_DEFAULT;
       if (kind != OMP_CLAUSE_LINEAR_DEFAULT)
 	{
+	  warning_at (clause_loc, OPT_Wdeprecated_openmp,
+	    "specifying the list items as arguments to the modifiers is "
+	    "deprecated since OpenMP 5.2");
 	  old_linear_modifier = true;
 	  c_parser_consume_token (parser);
 	  c_parser_consume_token (parser);
@@ -20133,9 +20139,19 @@ c_parser_omp_clause_depend (c_parser *parser, tree list)
       else if (strcmp ("depobj", p) == 0)
 	kind = OMP_CLAUSE_DEPEND_DEPOBJ;
       else if (strcmp ("sink", p) == 0)
-	dkind = OMP_CLAUSE_DOACROSS_SINK;
+	{
+	  warning_at (clause_loc, OPT_Wdeprecated_openmp,
+	    "%<sink%> modifier with %<depend%> clause deprecated since "
+	    "OpenMP 5.2, use with %<doacross%>");
+	  dkind = OMP_CLAUSE_DOACROSS_SINK;
+	}
       else if (strcmp ("source", p) == 0)
-	dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+	{
+	  warning_at (clause_loc, OPT_Wdeprecated_openmp,
+	    "%<source%> modifier with %<depend%> clause deprecated since "
+	    "OpenMP 5.2, use with %<doacross%>");
+	  dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+	}
       else
 	goto invalid_kind;
       break;
@@ -20435,6 +20451,8 @@ c_parser_omp_clause_map (c_parser *parser, tree list, bool declare_mapper_p)
   int close_modifier = 0;
   int present_modifier = 0;
   int mapper_modifier = 0;
+  int num_commas = 0;
+  int num_identifiers = 0;
   tree mapper_name = NULL_TREE;
   tree iterators = NULL_TREE;
   for (int pos = 1; pos < map_kind_pos; ++pos)
@@ -20443,6 +20461,9 @@ c_parser_omp_clause_map (c_parser *parser, tree list, bool declare_mapper_p)
 
       if (tok->type == CPP_COMMA)
 	{
+	  ++num_commas;
+	  if (num_commas > num_identifiers)
+	    c_parser_error (parser, "illegal comma");
 	  c_parser_consume_token (parser);
 	  continue;
 	}
@@ -20559,6 +20580,11 @@ c_parser_omp_clause_map (c_parser *parser, tree list, bool declare_mapper_p)
 	  parens.skip_until_found_close (parser);
 	  return list;
 	}
+      ++num_identifiers;
+      if (num_identifiers - 1 != num_commas)
+	warning_at (clause_loc, OPT_Wdeprecated_openmp,
+	  "%<map%> clause modifiers without comma separation is deprecated "
+	  "since OpenMP 5.2");
     }
 
   if (c_parser_next_token_is (parser, CPP_NAME)
@@ -28357,6 +28383,10 @@ c_parser_omp_declare_target (c_parser *parser)
     }
   else
     {
+      warning_at (c_parser_peek_token (parser)->location,
+	OPT_Wdeprecated_openmp,
+	"use of %<omp declare target%> as a synonym for %<omp begin declare "
+	"target%> has been deprecated since OpenMP 5.2");
       bool attr_syntax = parser->in_omp_attribute_pragma != NULL;
       c_parser_skip_to_pragma_eol (parser);
       c_omp_declare_target_attr attr = { attr_syntax, -1, 0 };
@@ -28365,6 +28395,10 @@ c_parser_omp_declare_target (c_parser *parser)
     }
   for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
     {
+      if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ENTER && OMP_CLAUSE_ENTER_TO (c))
+	warning_at (c_parser_peek_token (parser)->location,
+	  OPT_Wdeprecated_openmp, "%<to%> clause with %<declare target%> "
+	  "deprecated since OpenMP 5.2, use %<enter%>");
       if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEVICE_TYPE)
 	device_type |= OMP_CLAUSE_DEVICE_TYPE_KIND (c);
       if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_INDIRECT)
@@ -30170,6 +30204,10 @@ c_parser_omp_metadirective (c_parser *parser, bool *if_p)
 
       location_t match_loc = c_parser_peek_token (parser)->location;
       const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value);
+      if (strcmp (p, "default") == 0)
+	warning_at (pragma_loc, OPT_Wdeprecated_openmp,
+	  "%<default%> clause on metadirectives deprecated since "
+	  "OpenMP 5.2, use %<otherwise%>");
       c_parser_consume_token (parser);
       bool default_p
 	= strcmp (p, "default") == 0 || strcmp (p, "otherwise") == 0;
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 866708a7e46c..5525213c0347 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -42164,7 +42164,12 @@ cp_parser_omp_clause_reduction (cp_parser *parser, enum omp_clause_code kind,
     {
     case CPP_PLUS: code = PLUS_EXPR; break;
     case CPP_MULT: code = MULT_EXPR; break;
-    case CPP_MINUS: code = MINUS_EXPR; break;
+    case CPP_MINUS:
+      warning_at (cp_lexer_peek_token (parser->lexer)->location,
+	OPT_Wdeprecated_openmp,
+	"%<-%> operator for reductions deprecated in OpenMP 5.2");
+      code = MINUS_EXPR;
+      break;
     case CPP_AND: code = BIT_AND_EXPR; break;
     case CPP_XOR: code = BIT_XOR_EXPR; break;
     case CPP_OR: code = BIT_IOR_EXPR; break;
@@ -42860,6 +42865,10 @@ cp_parser_omp_clause_linear (cp_parser *parser, tree list,
 	{
 	  cp_lexer_consume_token (parser->lexer);
 	  old_linear_modifier = true;
+	  warning_at (cp_lexer_peek_token (parser->lexer)->location,
+	    OPT_Wdeprecated_openmp,
+	    "specifying the list items as arguments to the modifiers is "
+	    "deprecated since OpenMP 5.2");
 	}
       else
 	kind = OMP_CLAUSE_LINEAR_DEFAULT;
@@ -43469,9 +43478,19 @@ cp_parser_omp_clause_depend (cp_parser *parser, tree list, location_t loc)
       else if (strcmp ("depobj", p) == 0)
 	kind = OMP_CLAUSE_DEPEND_DEPOBJ;
       else if (strcmp ("sink", p) == 0)
-	dkind = OMP_CLAUSE_DOACROSS_SINK;
+	{
+	  warning_at (loc, OPT_Wdeprecated_openmp,
+	    "%<sink%> modifier with %<depend%> clause deprecated since "
+	    "OpenMP 5.2, use with %<doacross%>");
+	  dkind = OMP_CLAUSE_DOACROSS_SINK;
+	}
       else if (strcmp ("source", p) == 0)
-	dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+	{
+	  warning_at (loc, OPT_Wdeprecated_openmp,
+	    "%<source%> modifier with %<depend%> clause deprecated since "
+	    "OpenMP 5.2, use with %<doacross%>");
+	  dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+	}
       else
 	goto invalid_kind;
       break;
@@ -43852,6 +43871,7 @@ cp_parser_omp_clause_dyn_groupprivate (cp_parser *parser, tree list,
 static tree
 cp_parser_omp_clause_map (cp_parser *parser, tree list, bool declare_mapper_p)
 {
+  location_t clause_loc = cp_lexer_peek_token (parser->lexer)->location;
   tree nlist, c;
   enum gomp_map_kind kind = declare_mapper_p ? GOMP_MAP_UNSET : GOMP_MAP_TOFROM;
 
@@ -43899,6 +43919,8 @@ cp_parser_omp_clause_map (cp_parser *parser, tree list, bool declare_mapper_p)
   bool close_modifier = false;
   bool present_modifier = false;
   bool mapper_modifier = false;
+  int num_commas = 0;
+  int num_identifiers = 0;
   tree mapper_name = NULL_TREE;
   tree iterators = NULL_TREE;
   for (int pos = 1; pos < map_kind_pos; ++pos)
@@ -43906,6 +43928,9 @@ cp_parser_omp_clause_map (cp_parser *parser, tree list, bool declare_mapper_p)
       cp_token *tok = cp_lexer_peek_token (parser->lexer);
       if (tok->type == CPP_COMMA)
 	{
+	  ++num_commas;
+	  if (num_commas > num_identifiers)
+	    cp_parser_error (parser, "illegal comma");
 	  cp_lexer_consume_token (parser->lexer);
 	  continue;
 	}
@@ -44049,6 +44074,11 @@ cp_parser_omp_clause_map (cp_parser *parser, tree list, bool declare_mapper_p)
 						 /*consume_paren=*/true);
 	  return list;
 	}
+      ++num_identifiers;
+      if (num_identifiers - 1 != num_commas)
+	warning_at (clause_loc, OPT_Wdeprecated_openmp,
+	  "%<map%> clause modifiers without comma separation is "
+	  "deprecated since OpenMP 5.2");
     }
 
   if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
@@ -52748,6 +52778,10 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok)
     }
   else
     {
+      warning_at (cp_lexer_peek_token (parser->lexer)->location,
+	OPT_Wdeprecated_openmp,
+	"use of %<omp declare target%> as a synonym for %<omp begin declare "
+	"target%> has been deprecated since OpenMP 5.2");
       cp_omp_declare_target_attr a
 	= { parser->lexer->in_omp_attribute_pragma, -1, false };
       vec_safe_push (scope_chain->omp_declare_target_attribute, a);
@@ -52756,6 +52790,10 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok)
     }
   for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
     {
+      if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ENTER && OMP_CLAUSE_ENTER_TO (c))
+	warning_at (OMP_CLAUSE_LOCATION (c), OPT_Wdeprecated_openmp,
+	  "%<to%> clause with %<declare target%> deprecated since "
+	  "OpenMP 5.2, use %<enter%>");
       if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEVICE_TYPE)
 	device_type |= OMP_CLAUSE_DEVICE_TYPE_KIND (c);
       if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_INDIRECT)
@@ -53176,6 +53214,10 @@ cp_parser_omp_metadirective (cp_parser *parser, cp_token *pragma_tok,
       location_t match_loc = cp_lexer_peek_token (parser->lexer)->location;
       const char *p
 	= IDENTIFIER_POINTER (cp_lexer_peek_token (parser->lexer)->u.value);
+      if (strcmp (p, "default") == 0)
+	warning_at (match_loc, OPT_Wdeprecated_openmp,
+	  "%<default%> clause on metadirectives deprecated since "
+	  "OpenMP 5.2, use %<otherwise%>");
       cp_lexer_consume_token (parser->lexer);
       bool default_p
 	= strcmp (p, "default") == 0 || strcmp (p, "otherwise") == 0;
diff --git a/gcc/testsuite/c-c++-common/gomp/52-deps.c b/gcc/testsuite/c-c++-common/gomp/52-deps.c
new file mode 100644
index 000000000000..35577fa53c25
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/52-deps.c
@@ -0,0 +1,32 @@
+// tests for deprecation of 'to' clause with 'declare target' and the '-'
+// operator when used in reductions.
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c } 12 }
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c } 18 }
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c++ } 10 }
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c++ } 16 }
+
+int x = 24;
+
+#pragma omp declare target to(x)
+
+int foo(int x)
+{
+  return x + 1;
+}
+#pragma omp declare target to(foo)
+
+int
+main()
+{
+  int y;
+  int result = 0;
+
+  #pragma omp target map(from:y)
+  y = foo(x);
+
+  #pragma omp parallel for reduction(-: result) // { dg-warning "'-' operator for reductions deprecated in OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
+  for (int i = 0; i < 8; ++i)
+    result -= i;
+
+  return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/Wparentheses-2.c b/gcc/testsuite/c-c++-common/gomp/Wparentheses-2.c
index 4341b2232366..c1003d2d991c 100644
--- a/gcc/testsuite/c-c++-common/gomp/Wparentheses-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/Wparentheses-2.c
@@ -1,5 +1,5 @@
 /* PR c/70436 */
-/* { dg-additional-options "-Wparentheses" } */
+/* { dg-additional-options "-Wparentheses -Wno-deprecated-openmp" } */
 
 int a, b, c;
 void bar (void);
diff --git a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-1.c b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-1.c
index 275eab165add..032674e274de 100644
--- a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile { target { c || c++11 } } } */
 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 void
@@ -26,7 +26,7 @@ f (int a[], int b[], int c[])
       otherwise (teams loop)
       when (device={arch("nvptx")}: parallel loop))]] /* { dg-error "'otherwise' or 'default' clause must appear last" } */
     for (i = 0; i < N; i++) c[i] = a[i] * b[i];
-  
+
   [[omp::directive (metadirective
       when (device={arch("nvptx")} parallel loop) /* { dg-error "expected ':' before 'parallel'" } */
       default (teams loop))]]
diff --git a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-2.c b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-2.c
index bdb41e1017b7..36168c13ffa3 100644
--- a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile { target { c || c++11 } } } */
 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 int
diff --git a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-3.c b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-3.c
index 803bf0ad1ebf..eceec40a0040 100644
--- a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-3.c
@@ -1,7 +1,7 @@
 /* { dg-do compile { target { c || c++11 } } } */
 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 void
@@ -9,7 +9,7 @@ f (int x[], int y[], int z[])
 {
   int i;
 
-  [[omp::sequence (directive (target map(to: x, y) map(from: z)),  /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } }  */ 
+  [[omp::sequence (directive (target map(to: x, y) map(from: z)),  /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } }  */
 		   directive (metadirective
 			      when (device={arch("nvptx")}: teams loop)
 			      default (parallel loop)))]]
diff --git a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-4.c b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-4.c
index 5804eb5067a9..76561a314707 100644
--- a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-4.c
@@ -2,7 +2,7 @@
 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
 /* { dg-additional-options "-fdump-tree-original" } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 #pragma omp declare target
diff --git a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-5.c b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-5.c
index b24818a0fc71..daadf0fd9f2a 100644
--- a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-5.c
@@ -1,7 +1,7 @@
 /* { dg-do compile { target { c || c++11 } } } */
 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
 /* { dg-additional-options "-fdump-tree-original" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-8.c b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-8.c
index 43746b669ffd..dc3b60f75b5f 100644
--- a/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-8.c
+++ b/gcc/testsuite/c-c++-common/gomp/attrs-metadirective-8.c
@@ -1,6 +1,6 @@
 /* { dg-do compile { target { c || c++11 } } } */
 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 256
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/begin-declare-target-1.c b/gcc/testsuite/c-c++-common/gomp/begin-declare-target-1.c
index fd8cabaef0a7..1f9286b19539 100644
--- a/gcc/testsuite/c-c++-common/gomp/begin-declare-target-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/begin-declare-target-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern int a;
 #pragma omp begin declare target device_type (host)
 int b;
diff --git a/gcc/testsuite/c-c++-common/gomp/begin-declare-target-2.c b/gcc/testsuite/c-c++-common/gomp/begin-declare-target-2.c
index 2bc72cf46214..5f701f76ef4a 100644
--- a/gcc/testsuite/c-c++-common/gomp/begin-declare-target-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/begin-declare-target-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern int a;
 #pragma omp begin declare target
 #pragma omp declare target to (a)
diff --git a/gcc/testsuite/c-c++-common/gomp/clauses-3.c b/gcc/testsuite/c-c++-common/gomp/clauses-3.c
index a1f505a3a11d..4ceae407ee35 100644
--- a/gcc/testsuite/c-c++-common/gomp/clauses-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/clauses-3.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct T { int a; int *b; };
 struct S { int *s; char u; struct T v; long x; };
 
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-1.c b/gcc/testsuite/c-c++-common/gomp/declare-target-1.c
index 79ad556a9c73..901f2d06634d 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int foo (void), bar (void);
 extern int a;
 int b;
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-2.c b/gcc/testsuite/c-c++-common/gomp/declare-target-2.c
index 7b47e2b41823..92cc33a787e3 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern int a;
 #pragma omp declare target
 #pragma omp declare target to (a)
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-3.c b/gcc/testsuite/c-c++-common/gomp/declare-target-3.c
index e76e7a3c5c85..e08daf0a2198 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-3.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int a[] = { 1, 2, 3 };
 extern int b[];			/* { dg-error "'b' in declare target directive does not have mappable type" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-4.c b/gcc/testsuite/c-c++-common/gomp/declare-target-4.c
index a6bd1286ef17..4f45f32087a2 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-4.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void f1 (void) {}
 void f2 (void);
 #pragma omp declare target to (f1) device_type (any) to (f2)
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-5.c b/gcc/testsuite/c-c++-common/gomp/declare-target-5.c
index b52c9f207a22..6086891614e8 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-5.c
@@ -1,2 +1,3 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 void foo (void);	/* { dg-error "'#pragma omp declare target' without corresponding '#pragma omp end declare target'" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-7.c b/gcc/testsuite/c-c++-common/gomp/declare-target-7.c
index e37b4652050b..f918df4b9b00 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-7.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-7.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target device_type (any)		/* { dg-error "directive with only 'device_type' or 'indirect' clauses" } */
 
 void f1 (void) {}
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-1.c b/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-1.c
index 0fcbb2d04e4d..4dac1fc0bfae 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern int a, b;
 #define X 1
 #define Y 0
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-2.c b/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-2.c
index 75a205feb957..28def93bfce8 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp begin declare target indirect
 void fn1 (void) { }
 #pragma omp end declare target
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-variant-10.c b/gcc/testsuite/c-c++-common/gomp/declare-variant-10.c
index e77693430d1a..71543dbb5fa7 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-variant-10.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-variant-10.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-foffload=disable -fdump-tree-gimple" } */
 /* { dg-additional-options "-mavx512bw" { target { i?86-*-* x86_64-*-* } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #undef i386
 void f01 (void);
 #pragma omp declare variant (f01) match (device={isa(avx512f,avx512bw)})
diff --git a/gcc/testsuite/c-c++-common/gomp/declare-variant-8.c b/gcc/testsuite/c-c++-common/gomp/declare-variant-8.c
index 9cd706e896f9..01d798a35316 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-variant-8.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-variant-8.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void f01 (void);
 #pragma omp declare variant (f01) match (user={condition(6 == 7)},implementation={vendor(gnu)})
 void f02 (void);
diff --git a/gcc/testsuite/c-c++-common/gomp/defaultmap-2.c b/gcc/testsuite/c-c++-common/gomp/defaultmap-2.c
index 75dca2308624..8cebdec27aba 100644
--- a/gcc/testsuite/c-c++-common/gomp/defaultmap-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/defaultmap-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S { int s; };
 void foo (char *);
 void bar (int, char *, struct S, int *);
diff --git a/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c b/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c
index 8be23fd14735..3330ff4a21c6 100644
--- a/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/defaultmap-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S { int s; };
 void foo (char *);
 void bar (int, char *, struct S, int *);
diff --git a/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c b/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
index fff32a4761fb..df36425d74be 100644
--- a/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int a, b[64];
 struct S { int c; } *d, *e;
 struct T;
diff --git a/gcc/testsuite/c-c++-common/gomp/depobj-1.c b/gcc/testsuite/c-c++-common/gomp/depobj-1.c
index 77fd97159aa6..9c47d5b41306 100644
--- a/gcc/testsuite/c-c++-common/gomp/depobj-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/depobj-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
   char __omp_depend_t__[2 * sizeof (void *)];
 } omp_depend_t;
diff --git a/gcc/testsuite/c-c++-common/gomp/directive-1.c b/gcc/testsuite/c-c++-common/gomp/directive-1.c
index 21ca319b9f90..34194865d10e 100644
--- a/gcc/testsuite/c-c++-common/gomp/directive-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/directive-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int thr;
 #pragma omp threadprivate, (thr)		/* { dg-error "expected '\\\(' before ',' token" } */
 						/* { dg-error "expected end of line before ',' token" "" { target c++ } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/gomp/distribute-1.c b/gcc/testsuite/c-c++-common/gomp/distribute-1.c
index e5e4bc2669d8..2cc4a7db0568 100644
--- a/gcc/testsuite/c-c++-common/gomp/distribute-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/distribute-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int s1, s2, s3, s4, s5, s6, s7, s8;
 #pragma omp declare target (s1, s2, s3, s4, s5, s6, s7, s8)
 
diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-1.c b/gcc/testsuite/c-c++-common/gomp/doacross-1.c
index eacaeaef80a4..92de39e9cf86 100644
--- a/gcc/testsuite/c-c++-common/gomp/doacross-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/doacross-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-2.c b/gcc/testsuite/c-c++-common/gomp/doacross-2.c
index 44c5c212c897..760420a3d857 100644
--- a/gcc/testsuite/c-c++-common/gomp/doacross-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/doacross-2.c
@@ -1,5 +1,5 @@
 /* PR middle-end/87649 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-3.c b/gcc/testsuite/c-c++-common/gomp/doacross-3.c
index 6d7517271f69..107278cae03c 100644
--- a/gcc/testsuite/c-c++-common/gomp/doacross-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/doacross-3.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-4.c b/gcc/testsuite/c-c++-common/gomp/doacross-4.c
index a1182e3ce981..63b569f2a310 100644
--- a/gcc/testsuite/c-c++-common/gomp/doacross-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/doacross-4.c
@@ -1,5 +1,5 @@
 /* PR middle-end/98205 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void baz (int) __attribute__((noreturn));
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-8.c b/gcc/testsuite/c-c++-common/gomp/doacross-8.c
index 6de06341af78..584b3a8183a4 100644
--- a/gcc/testsuite/c-c++-common/gomp/doacross-8.c
+++ b/gcc/testsuite/c-c++-common/gomp/doacross-8.c
@@ -1,6 +1,6 @@
 /* PR middle-end/108685 */
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (int a)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/linear-1.c b/gcc/testsuite/c-c++-common/gomp/linear-1.c
index 4557e22cb4f7..891debf2e178 100644
--- a/gcc/testsuite/c-c++-common/gomp/linear-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/linear-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int i;
 
 #pragma omp declare simd linear (val (x) : 1) linear (y : 2)
diff --git a/gcc/testsuite/c-c++-common/gomp/linear-2.c b/gcc/testsuite/c-c++-common/gomp/linear-2.c
index 545b7e5f01d4..06daa531b5fb 100644
--- a/gcc/testsuite/c-c++-common/gomp/linear-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/linear-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int i;
 
 #pragma omp declare simd linear (x : val, step (1)) linear (y : step (2))
diff --git a/gcc/testsuite/c-c++-common/gomp/linear-3.c b/gcc/testsuite/c-c++-common/gomp/linear-3.c
index 32fa0bc7a922..6b35ba599b01 100644
--- a/gcc/testsuite/c-c++-common/gomp/linear-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/linear-3.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int step (int);
 int val;
 #pragma omp declare simd linear (val (x) : step (1))	/* { dg-error "is neither constant nor a parameter" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/loop-6.c b/gcc/testsuite/c-c++-common/gomp/loop-6.c
index 24383ff04eaa..cb5166fbb795 100644
--- a/gcc/testsuite/c-c++-common/gomp/loop-6.c
+++ b/gcc/testsuite/c-c++-common/gomp/loop-6.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int bar (int);
 int baz (int *);
 
diff --git a/gcc/testsuite/c-c++-common/gomp/map-1.c b/gcc/testsuite/c-c++-common/gomp/map-1.c
index f7003d3384b6..1501bf94ec62 100644
--- a/gcc/testsuite/c-c++-common/gomp/map-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/map-1.c
@@ -3,7 +3,7 @@
 /* See also corresponding OpenMP C++ variant: '../../g++.dg/gomp/map-1.C'.  */
 
 /* See also corresponding OpenACC variant: '../goacc/data-clause-1.c'.  */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern int a[][10], a2[][10];
 int b[10], c[10][2], d[10], e[10], f[10];
 int b2[10], c2[10][2], d2[10], e2[10], f2[10];
diff --git a/gcc/testsuite/c-c++-common/gomp/map-3.c b/gcc/testsuite/c-c++-common/gomp/map-3.c
index 8a14b9c888e8..6d8f45e3d560 100644
--- a/gcc/testsuite/c-c++-common/gomp/map-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/map-3.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S { int i : 1; int j : 4; long long k : 25; };
 void bar (struct S, int);
 #pragma omp declare target to (bar)
diff --git a/gcc/testsuite/c-c++-common/gomp/map-6.c b/gcc/testsuite/c-c++-common/gomp/map-6.c
index d76f9aef5aa9..c1f3d1079b4b 100644
--- a/gcc/testsuite/c-c++-common/gomp/map-6.c
+++ b/gcc/testsuite/c-c++-common/gomp/map-6.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-original" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
@@ -29,13 +29,13 @@ foo (void)
   ; /* { dg-error "'map' clause with map-type modifier other than 'always', 'close', 'iterator', 'mapper' or 'present' before 'a'" "" { target c } .-1 }  */
 
 
-  #pragma omp target map (close a) /* { dg-error "'close' undeclared" "" { target c } } */ 
-  /* { dg-error "'close' was not declared in this scope" "" { target c++ } .-1 } */ 
+  #pragma omp target map (close a) /* { dg-error "'close' undeclared" "" { target c } } */
+  /* { dg-error "'close' was not declared in this scope" "" { target c++ } .-1 } */
   /* { dg-error "expected '\\)' before 'a'" "" { target *-*-* } .-2 } */
   ;
 
   #pragma omp target map (always a) /* { dg-error "'always' undeclared" "" { target c } } */
-  /* { dg-error "'always' was not declared in this scope" "" { target c++ } .-1 } */ 
+  /* { dg-error "'always' was not declared in this scope" "" { target c++ } .-1 } */
   /* { dg-error "expected '\\)' before 'a'" "" { target *-*-* } .-2 } */
   ;
 
@@ -141,10 +141,10 @@ foo (void)
   #pragma omp target exit data map(present,always,close,delete: a) map(close,present,always,release:b) map(always close present,from:b1)
 
   int close = 0;
-  #pragma omp target map (close) 
+  #pragma omp target map (close)
   ;
 
-  #pragma omp target map (close a) /* { dg-error "expected '\\)' before 'a'" } */ 
+  #pragma omp target map (close a) /* { dg-error "expected '\\)' before 'a'" } */
   ;
 
   int always = 0;
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-1.c b/gcc/testsuite/c-c++-common/gomp/metadirective-1.c
index b2bfe950818b..0b0228dd6e2b 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 void
@@ -35,7 +35,7 @@ f (int a[], int b[], int c[])
       otherwise (teams loop) \
       when (device={arch("nvptx")}: parallel loop) /* { dg-error "'otherwise' or 'default' clause must appear last" } */
     for (i = 0; i < N; i++) c[i] = a[i] * b[i];
-    
+
   #pragma omp metadirective \
       when (device={arch("nvptx")} parallel loop) /* { dg-error "expected ':' before 'parallel'" } */ \
       default (teams loop)
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-2.c b/gcc/testsuite/c-c++-common/gomp/metadirective-2.c
index 9f8169a8b02f..2caabf08720c 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 int
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-3.c b/gcc/testsuite/c-c++-common/gomp/metadirective-3.c
index b6c1601f7b10..d8a4d435e4c4 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-fdump-tree-gimple" } */
+/* { dg-additional-options "-fdump-tree-gimple -Wno-deprecated-openmp" } */
 
 #define N 100
 
@@ -8,7 +8,7 @@ f (int x[], int y[], int z[])
 {
   int i;
 
-  #pragma omp target map(to: x, y) map(from: z)  /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } }  */ 
+  #pragma omp target map(to: x, y) map(from: z)  /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } }  */
     #pragma omp metadirective \
 	when (device={arch("nvptx")}: teams loop) \
 	default (parallel loop)
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-4.c b/gcc/testsuite/c-c++-common/gomp/metadirective-4.c
index 5cf3dbd63b71..5ee7d68fbcc7 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-4.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-original" } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 #pragma omp declare target
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-5.c b/gcc/testsuite/c-c++-common/gomp/metadirective-5.c
index 63ce4498cd14..895b00563fff 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-5.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-original" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-8.c b/gcc/testsuite/c-c++-common/gomp/metadirective-8.c
index 0cab9620cd9c..50daec629052 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-8.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-8.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 256
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-construct.c b/gcc/testsuite/c-c++-common/gomp/metadirective-construct.c
index 3103656d71f2..315970418322 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-construct.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-construct.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-foffload=disable -fdump-tree-optimized" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 static void
@@ -27,13 +27,13 @@ static void doit (transform_fn *f, int n, double *a, double s)
   check (n, a, s);
 }
 
-/* Check various combinations for enforcing correct ordering of 
+/* Check various combinations for enforcing correct ordering of
    construct matches.  */
 static void
 f1 (int n, double* a, double s)
 {
 #pragma omp target teams
-#pragma omp parallel  
+#pragma omp parallel
 #pragma omp metadirective					\
   when (construct={target}					\
 	: for)							\
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-device.c b/gcc/testsuite/c-c++-common/gomp/metadirective-device.c
index d7f736d70b3e..7b4083048fea 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-device.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-device.c
@@ -1,7 +1,7 @@
 /* { dg-do compile }  */
 /* { dg-additional-options "-foffload=disable -fdump-tree-optimized" } */
 /* { dg-additional-options "-DDEVICE_ARCH=x86_64 -DDEVICE_ISA=sse -msse" { target { x86 && lp64 } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 static void
@@ -53,7 +53,7 @@ f2 (int n, double* a, double s)
     a[i] = a[i] * s;
 }
 
-/* Check arch.  Either DEVICE_ARCH is defined by command-line option, 
+/* Check arch.  Either DEVICE_ARCH is defined by command-line option,
    or we know it is not x86_64.  */
 #ifdef DEVICE_ARCH
 static void
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-1.c b/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-1.c
index 284f35f6d847..e7e2c82fcd40 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-1.c
@@ -1,7 +1,7 @@
 /* { dg-do compile }  */
 /* { dg-additional-options "-fdump-tree-optimized" } */
 /* { dg-additional-options "-DDEVICE_ARCH=x86_64 -DDEVICE_ISA=mmx -mmmx" { target { x86 && lp64 } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 static void
@@ -53,7 +53,7 @@ f2 (int n, double* a, double s)
     a[i] = a[i] * s;
 }
 
-/* Check arch.  Either DEVICE_ARCH is defined by command-line option, 
+/* Check arch.  Either DEVICE_ARCH is defined by command-line option,
    or we know it is not x86_64.  */
 #ifdef DEVICE_ARCH
 static void
diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c b/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c
index 4de192177f8d..412529795292 100644
--- a/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-optimized" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* In configurations without offloading configured, we can resolve many
    instances of the target_device context selector at gimplification time
    instead of waiting until late resolution.  */
diff --git a/gcc/testsuite/c-c++-common/gomp/order-2.c b/gcc/testsuite/c-c++-common/gomp/order-2.c
index 5e044dc65c60..1b30d7ef9af5 100644
--- a/gcc/testsuite/c-c++-common/gomp/order-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/order-2.c
@@ -1,4 +1,5 @@
-void
+// { dg-additional-options "-Wno-deprecated-openmp" }
+  void
 f1 (int *a)
 {
   int i;
diff --git a/gcc/testsuite/c-c++-common/gomp/ordered-3.c b/gcc/testsuite/c-c++-common/gomp/ordered-3.c
index b007ca7982a3..9d004fe6e10c 100644
--- a/gcc/testsuite/c-c++-common/gomp/ordered-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/ordered-3.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/ordered-5.c b/gcc/testsuite/c-c++-common/gomp/ordered-5.c
index ee798f4dd1b6..9e7e5caf500f 100644
--- a/gcc/testsuite/c-c++-common/gomp/ordered-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/ordered-5.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/pr102640.c b/gcc/testsuite/c-c++-common/gomp/pr102640.c
index 00ebab9c628f..6327c40c8e84 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr102640.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr102640.c
@@ -6,7 +6,7 @@
 /* { dg-final { scan-tree-dump-not "firstprivate\\\(var\[123]\\\)" "gimple" } } */
 /* { dg-final { scan-tree-dump-not ".omp_data_arr.\[0-9]*.var" "omplower" } } */
 /* { dg-final { scan-tree-dump-not ".omp_data_i->var" "omplower" } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/pr106836.c b/gcc/testsuite/c-c++-common/gomp/pr106836.c
index 6df8250f81c3..4e11230684f6 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr106836.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr106836.c
@@ -1,5 +1,5 @@
 /* PR c/106836 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/pr120180-1.c b/gcc/testsuite/c-c++-common/gomp/pr120180-1.c
index b563d5f0ebfd..9b16cc8cffb6 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr120180-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr120180-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* This test case checks that the inner metadirective is accepted as intervening
    code since it resolves to 'omp nothing'.  */
 
diff --git a/gcc/testsuite/c-c++-common/gomp/pr88203-1.c b/gcc/testsuite/c-c++-common/gomp/pr88203-1.c
index 54a686487c98..25220d3d5e1c 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr88203-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr88203-1.c
@@ -2,7 +2,7 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-std=c99" { target c } } */
 /* { dg-additional-options "-std=c++11" { target c++ } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void foo (const char *);
 #pragma omp declare target to (foo)
 
diff --git a/gcc/testsuite/c-c++-common/gomp/pr88203-2.c b/gcc/testsuite/c-c++-common/gomp/pr88203-2.c
index 90c4a720774a..55758b1a0741 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr88203-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr88203-2.c
@@ -2,7 +2,7 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-std=gnu99" { target c } } */
 /* { dg-additional-options "-std=gnu++11" { target c++ } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void foo (const char *, const char *);
 #pragma omp declare target to (foo)
 
diff --git a/gcc/testsuite/c-c++-common/gomp/pr88203-3.c b/gcc/testsuite/c-c++-common/gomp/pr88203-3.c
index 6a9585d32817..d5e248b4f43d 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr88203-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr88203-3.c
@@ -2,7 +2,7 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-std=c99" { target c } } */
 /* { dg-additional-options "-std=c++11" { target c++ } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void foo (const char *);
 #pragma omp declare target to (foo)
 
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91401-2.c b/gcc/testsuite/c-c++-common/gomp/pr91401-2.c
index f537e66e27c5..061882ec9a19 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr91401-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr91401-2.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 void f0 (void);
 
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91987.c b/gcc/testsuite/c-c++-common/gomp/pr91987.c
index 516bb8091fde..46f41f836a0d 100644
--- a/gcc/testsuite/c-c++-common/gomp/pr91987.c
+++ b/gcc/testsuite/c-c++-common/gomp/pr91987.c
@@ -1,5 +1,5 @@
 /* PR c++/91987 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int bar (void);
 void baz (int *);
 #pragma omp declare target to (baz)
diff --git a/gcc/testsuite/c-c++-common/gomp/reverse-offload-1.c b/gcc/testsuite/c-c++-common/gomp/reverse-offload-1.c
index 8d319058ce11..134b85861c3d 100644
--- a/gcc/testsuite/c-c++-common/gomp/reverse-offload-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/reverse-offload-1.c
@@ -5,7 +5,7 @@
 /* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*int called_in_target1" 1 "omplower" } }  */
 /* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*int called_in_target2" 1 "omplower" } }  */
 /* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*void tg_fn" 1 "omplower" } }  */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires reverse_offload
 
 extern int add_3 (int);
diff --git a/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-1.c b/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-1.c
index 82ab25722e74..119980e33c7e 100644
--- a/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/schedule-modifiers-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void
 foo (void)
 {
diff --git a/gcc/testsuite/c-c++-common/gomp/sink-1.c b/gcc/testsuite/c-c++-common/gomp/sink-1.c
index 5ee562bfbf78..8fbe50d4b773 100644
--- a/gcc/testsuite/c-c++-common/gomp/sink-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/sink-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -Wunknown-pragmas -Werror" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void bark (void);
 int i,j,k;
 int array[555];
diff --git a/gcc/testsuite/c-c++-common/gomp/sink-2.c b/gcc/testsuite/c-c++-common/gomp/sink-2.c
index e781a6fd9459..5acd2fd2fe45 100644
--- a/gcc/testsuite/c-c++-common/gomp/sink-2.c
+++ b/gcc/testsuite/c-c++-common/gomp/sink-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void bar (int *);
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/sink-3.c b/gcc/testsuite/c-c++-common/gomp/sink-3.c
index 7cb16ed0f760..d5a055956243 100644
--- a/gcc/testsuite/c-c++-common/gomp/sink-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/sink-3.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that we can handle multiple undeclared sink variables
    gracefully.  */
 
diff --git a/gcc/testsuite/c-c++-common/gomp/sink-4.c b/gcc/testsuite/c-c++-common/gomp/sink-4.c
index 11b6d9973c9d..60f4cd573777 100644
--- a/gcc/testsuite/c-c++-common/gomp/sink-4.c
+++ b/gcc/testsuite/c-c++-common/gomp/sink-4.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -fdump-tree-omplower" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that we adjust pointer offsets for sink variables
    correctly.  */
 
diff --git a/gcc/testsuite/c-c++-common/gomp/sink-5.c b/gcc/testsuite/c-c++-common/gomp/sink-5.c
index 4fbaa8a03cb0..fad40c886306 100644
--- a/gcc/testsuite/c-c++-common/gomp/sink-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/sink-5.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void bar (int);
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/target-teams-1.c b/gcc/testsuite/c-c++-common/gomp/target-teams-1.c
index 74d60e1066e7..ea3985879270 100644
--- a/gcc/testsuite/c-c++-common/gomp/target-teams-1.c
+++ b/gcc/testsuite/c-c++-common/gomp/target-teams-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int v = 6;
 void bar (int);
 void bar2 (int, long *, long *);
diff --git a/gcc/testsuite/g++.dg/gomp/attrs-12.C b/gcc/testsuite/g++.dg/gomp/attrs-12.C
index b613872952e6..a5fdc3e7f3c5 100644
--- a/gcc/testsuite/g++.dg/gomp/attrs-12.C
+++ b/gcc/testsuite/g++.dg/gomp/attrs-12.C
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++11 } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 #pragma omp declare target
 [[omp::directive (declare target)]];
diff --git a/gcc/testsuite/g++.dg/gomp/attrs-5.C b/gcc/testsuite/g++.dg/gomp/attrs-5.C
index f6d24b9540c6..f0d2db6b61d4 100644
--- a/gcc/testsuite/g++.dg/gomp/attrs-5.C
+++ b/gcc/testsuite/g++.dg/gomp/attrs-5.C
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++11 } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
   char __omp_depend_t__[2 * sizeof (void *)];
 } omp_depend_t;
diff --git a/gcc/testsuite/g++.dg/gomp/attrs-9.C b/gcc/testsuite/g++.dg/gomp/attrs-9.C
index cf7cef46b707..1ed1abf0f92a 100644
--- a/gcc/testsuite/g++.dg/gomp/attrs-9.C
+++ b/gcc/testsuite/g++.dg/gomp/attrs-9.C
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++11 } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int n1 = 0, n2 = 42;
 [[omp::sequence (directive (requires, atomic_default_mem_order (seq_cst)))]];
 [[omp::directive (declare reduction (plus: int: omp_out += omp_in) initializer (omp_priv = 0))]];
diff --git a/gcc/testsuite/g++.dg/gomp/clause-3.C b/gcc/testsuite/g++.dg/gomp/clause-3.C
index aad97d6ad62a..74a60f9d9b94 100644
--- a/gcc/testsuite/g++.dg/gomp/clause-3.C
+++ b/gcc/testsuite/g++.dg/gomp/clause-3.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-require-effective-target tls }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define p parallel
 
 extern void bar (void);
diff --git a/gcc/testsuite/g++.dg/gomp/declare-simd-3.C b/gcc/testsuite/g++.dg/gomp/declare-simd-3.C
index d89d9a7cf6b5..9bda32d5ad39 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-simd-3.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-simd-3.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-options "-fopenmp -ffat-lto-objects" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare simd uniform(b) linear(c, d) linear(uval(e)) linear(ref(f))
 int f1 (int a, int b, int c, int &d, int &e, int &f)
 {
diff --git a/gcc/testsuite/g++.dg/gomp/declare-simd-4.C b/gcc/testsuite/g++.dg/gomp/declare-simd-4.C
index 0b76d922f3e1..a61119eaf875 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-simd-4.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-simd-4.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare simd linear(p:1) linear(q:-1) linear(s:-3)
 int
 f1 (int *p, int *q, short *s)
diff --git a/gcc/testsuite/g++.dg/gomp/declare-simd-6.C b/gcc/testsuite/g++.dg/gomp/declare-simd-6.C
index 09137ee5b98f..6a5b272d984a 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-simd-6.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-simd-6.C
@@ -1,7 +1,7 @@
 // PR c++/71257
 // { dg-do compile }
 // { dg-options "-fopenmp-simd" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S { int a; };
 #pragma omp declare simd linear(val(a):2)
 int f1 (int &a);
diff --git a/gcc/testsuite/g++.dg/gomp/declare-simd-7.C b/gcc/testsuite/g++.dg/gomp/declare-simd-7.C
index 52e9f182da35..625333c8dc45 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-simd-7.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-simd-7.C
@@ -1,7 +1,7 @@
 // PR middle-end/78025
 // { dg-do compile }
 // { dg-additional-options "-O2" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S { S (); ~S (); };
 
 int bar1 (int, int, float &, S &, int *, int, int &, int &, int &, int &, int &);
diff --git a/gcc/testsuite/g++.dg/gomp/declare-simd-8.C b/gcc/testsuite/g++.dg/gomp/declare-simd-8.C
index 01c91e890914..5e23f9fafe1a 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-simd-8.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-simd-8.C
@@ -1,5 +1,5 @@
 // PR c++/100872
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 template <int N, typename T>
 struct S {
   #pragma omp declare simd aligned(a : N * 2) aligned(b) linear(ref(b): N)
diff --git a/gcc/testsuite/g++.dg/gomp/declare-target-1.C b/gcc/testsuite/g++.dg/gomp/declare-target-1.C
index 7b270cdddb70..e1f642b88a6b 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-target-1.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-target-1.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 void f1 (int);
 void f1 (double);
diff --git a/gcc/testsuite/g++.dg/gomp/declare-target-2.C b/gcc/testsuite/g++.dg/gomp/declare-target-2.C
index e080ca6bfb5b..d607f8c3697a 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-target-2.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-target-2.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 template <typename T>
 struct S { T a; };
diff --git a/gcc/testsuite/g++.dg/gomp/declare-target-3.C b/gcc/testsuite/g++.dg/gomp/declare-target-3.C
index b0a90d8d31f5..54d60bedb030 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-target-3.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-target-3.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-additional-options "-fdump-tree-gimple" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 // Test implicit marking of declare target to.
 
 int foo () { return 1; }
diff --git a/gcc/testsuite/g++.dg/gomp/declare-target-indirect-1.C b/gcc/testsuite/g++.dg/gomp/declare-target-indirect-1.C
index 1d66ec9f7418..48b7457b7753 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-target-indirect-1.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-target-indirect-1.C
@@ -1,5 +1,5 @@
 // { dg-skip-if "c++98 does not support attributes" { c++98_only } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 [[omp::decl (declare target, indirect(1))]] // { dg-error "directive with only 'device_type' or 'indirect' clause" }
 int f (void) { return 5; }
 
diff --git a/gcc/testsuite/g++.dg/gomp/depend-iterator-2.C b/gcc/testsuite/g++.dg/gomp/depend-iterator-2.C
index a0119ebc6940..bd1470ff1e78 100644
--- a/gcc/testsuite/g++.dg/gomp/depend-iterator-2.C
+++ b/gcc/testsuite/g++.dg/gomp/depend-iterator-2.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int a, b[64];
 struct S { int c; } *d, *e;
 struct T;
diff --git a/gcc/testsuite/g++.dg/gomp/depobj-1.C b/gcc/testsuite/g++.dg/gomp/depobj-1.C
index cb091a1da2cb..7bd6f98b2ea8 100644
--- a/gcc/testsuite/g++.dg/gomp/depobj-1.C
+++ b/gcc/testsuite/g++.dg/gomp/depobj-1.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
   char __omp_depend_t__[2 * sizeof (void *)];
 } omp_depend_t;
diff --git a/gcc/testsuite/g++.dg/gomp/doacross-2.C b/gcc/testsuite/g++.dg/gomp/doacross-2.C
index 1fd63570f4a2..56daccc960b8 100644
--- a/gcc/testsuite/g++.dg/gomp/doacross-2.C
+++ b/gcc/testsuite/g++.dg/gomp/doacross-2.C
@@ -1,6 +1,6 @@
 // PR c++/100957
 // { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S {
   S ()
   {
diff --git a/gcc/testsuite/g++.dg/gomp/linear-1.C b/gcc/testsuite/g++.dg/gomp/linear-1.C
index 68d58fee59f8..9a8f71f5d755 100644
--- a/gcc/testsuite/g++.dg/gomp/linear-1.C
+++ b/gcc/testsuite/g++.dg/gomp/linear-1.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int i;
 
 #pragma omp declare simd linear (ref (x) : 1) linear (uval (y) : 2)
diff --git a/gcc/testsuite/g++.dg/gomp/linear-2.C b/gcc/testsuite/g++.dg/gomp/linear-2.C
index eed982276e7f..4cb5a2e7c9bf 100644
--- a/gcc/testsuite/g++.dg/gomp/linear-2.C
+++ b/gcc/testsuite/g++.dg/gomp/linear-2.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 
 int i, j;
diff --git a/gcc/testsuite/g++.dg/gomp/linear-3.C b/gcc/testsuite/g++.dg/gomp/linear-3.C
index 0936cf89155a..8184633e5298 100644
--- a/gcc/testsuite/g++.dg/gomp/linear-3.C
+++ b/gcc/testsuite/g++.dg/gomp/linear-3.C
@@ -1,6 +1,6 @@
 // { dg-do compile { target c++11 } }
 // { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int i;
 
 #pragma omp declare simd linear (x : ref, step (1)) linear (y : step (2), uval)
diff --git a/gcc/testsuite/g++.dg/gomp/linear-5.C b/gcc/testsuite/g++.dg/gomp/linear-5.C
index fbc193edeb6e..141451d26be9 100644
--- a/gcc/testsuite/g++.dg/gomp/linear-5.C
+++ b/gcc/testsuite/g++.dg/gomp/linear-5.C
@@ -1,6 +1,6 @@
 /* { dg-do compile { target c++11 } } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 constexpr int step (int x) { return x; }
 constexpr int val = 1;
 constexpr int ref = 2;
diff --git a/gcc/testsuite/g++.dg/gomp/map-1.C b/gcc/testsuite/g++.dg/gomp/map-1.C
index 4416ce99cdc1..a2ec9fb849c3 100644
--- a/gcc/testsuite/g++.dg/gomp/map-1.C
+++ b/gcc/testsuite/g++.dg/gomp/map-1.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test 'map' clause diagnostics.  */
 
 /* See also corresponding OpenMP C/C++ variant: '../../c-c++-common/gomp/map-1.c'.  */
diff --git a/gcc/testsuite/g++.dg/gomp/map-csm-dep.C b/gcc/testsuite/g++.dg/gomp/map-csm-dep.C
new file mode 100644
index 000000000000..d40ea8c53876
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/map-csm-dep.C
@@ -0,0 +1,40 @@
+// can't manage to elicit the "illegal comma" but it seems that we're already getting errors for improper syntax.
+// otherwise, though, the deprecation works as intended.
+int
+main()
+  {
+    float B[8];
+    float C[8];
+    // this should be completely fine
+    #pragma omp target teams map(to: B[0:8], C[0:8])
+    {}
+    // this should give us a deprecation warning
+    #pragma omp target teams map(close always present to: B[0:8], C[0:8]) // { dg-warning "'map' clause modifiers without comma separation is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
+    {}
+    // this should be completely fine
+    #pragma omp target teams map(close, always, present, to: B[0:8], C[0:8])
+    {}
+
+    #pragma omp target teams map(close always,, present, to: B[0:8], C[0:8])
+    {}
+    // { dg-error "'close' was not declared in this scope" "" { target *-*-* } 18 }
+    // { dg-error "expected '\\)' before 'always'" "" { target *-*-* } 18 }
+    // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } 18 }
+    // { dg-error "'present' was not declared in this scope" "" { target *-*-* } 18 }
+    // { dg-error "found ':' in nested-name-specifier, expected '::'" "" { target *-*-* } 18 }
+    // { dg-error "'to' has not been declared; did you mean 'auto'?" "" { target *-*-* } 18 }
+
+    #pragma omp target teams map(,close to: B[0:8], C[0:8]) 
+    {}
+    // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } 27 }
+    // { dg-error "'close' was not declared in this scope" "" { target *-*-* } 27 }
+    // { dg-error "expected '\\)' before 'to'" "" { target *-*-* } 27 }
+    
+    #pragma omp target teams map(close,,always to: B[0:8] C[0:8])
+    {}
+    // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } 33 }
+    // { dg-error "'close' was not declared in this scope" "" { target *-*-* } 33 }
+    // { dg-error "'always' was not declared in this scope" "" { target *-*-* } 33 }
+    // { dg-error "expected '\\)' before 'to'" "" { target *-*-* } 33 }
+    return 0;
+  }
diff --git a/gcc/testsuite/g++.dg/gomp/pr118876.C b/gcc/testsuite/g++.dg/gomp/pr118876.C
index 242a396bbb63..406fd40c7784 100644
--- a/gcc/testsuite/g++.dg/gomp/pr118876.C
+++ b/gcc/testsuite/g++.dg/gomp/pr118876.C
@@ -1,6 +1,6 @@
 // PR c++/118876
 // { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 struct A { ~A () {} } a[2];
 #pragma omp end declare target
diff --git a/gcc/testsuite/g++.dg/gomp/pr119370.C b/gcc/testsuite/g++.dg/gomp/pr119370.C
index 9ecc9b73db84..3ec42bf67311 100644
--- a/gcc/testsuite/g++.dg/gomp/pr119370.C
+++ b/gcc/testsuite/g++.dg/gomp/pr119370.C
@@ -1,6 +1,6 @@
 // PR c++/119370
 // { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 struct S {
   int s;
diff --git a/gcc/testsuite/g++.dg/gomp/sink-1.C b/gcc/testsuite/g++.dg/gomp/sink-1.C
index 982d36c7aa06..6533735545e2 100644
--- a/gcc/testsuite/g++.dg/gomp/sink-1.C
+++ b/gcc/testsuite/g++.dg/gomp/sink-1.C
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 void bar (int, int, int);
 
 template<typename T>
diff --git a/gcc/testsuite/g++.dg/gomp/sink-2.C b/gcc/testsuite/g++.dg/gomp/sink-2.C
index 26669ef588e7..489ac07dc1b3 100644
--- a/gcc/testsuite/g++.dg/gomp/sink-2.C
+++ b/gcc/testsuite/g++.dg/gomp/sink-2.C
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Tests iterators are allowed in ordered loops and that we keep track
    of the original iterator DECL for diagnostic purposes.  */
 
diff --git a/gcc/testsuite/g++.dg/gomp/sink-3.C b/gcc/testsuite/g++.dg/gomp/sink-3.C
index 4271d66faefa..48755c7887ca 100644
--- a/gcc/testsuite/g++.dg/gomp/sink-3.C
+++ b/gcc/testsuite/g++.dg/gomp/sink-3.C
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that we adjust pointer offsets for sink variables
    correctly.  */
 
diff --git a/gcc/testsuite/g++.dg/gomp/target-simd-clone-1.C b/gcc/testsuite/g++.dg/gomp/target-simd-clone-1.C
index b96473642bbe..3c09e809a4bb 100644
--- a/gcc/testsuite/g++.dg/gomp/target-simd-clone-1.C
+++ b/gcc/testsuite/g++.dg/gomp/target-simd-clone-1.C
@@ -1,6 +1,6 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details -fdump-ipa-cgraph" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that simd clones are generated for functions with "declare target".  */
 
 #pragma omp declare target
diff --git a/gcc/testsuite/g++.dg/gomp/target-simd-clone-2.C b/gcc/testsuite/g++.dg/gomp/target-simd-clone-2.C
index 08c0539dc638..85d72ddd1b7f 100644
--- a/gcc/testsuite/g++.dg/gomp/target-simd-clone-2.C
+++ b/gcc/testsuite/g++.dg/gomp/target-simd-clone-2.C
@@ -1,6 +1,6 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that simd clones are not generated for "declare target"
    functions that throw.  */
 
diff --git a/gcc/testsuite/g++.dg/gomp/target-teams-1.C b/gcc/testsuite/g++.dg/gomp/target-teams-1.C
index 29e55970e452..db22e04e1c64 100644
--- a/gcc/testsuite/g++.dg/gomp/target-teams-1.C
+++ b/gcc/testsuite/g++.dg/gomp/target-teams-1.C
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-additional-options "-fdump-tree-gimple" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int v = 6;
 void bar (int);
 void bar2 (int, long *, long *);
diff --git a/gcc/testsuite/g++.dg/gomp/udr-5.C b/gcc/testsuite/g++.dg/gomp/udr-5.C
index e20afd6f8100..096219323a83 100644
--- a/gcc/testsuite/g++.dg/gomp/udr-5.C
+++ b/gcc/testsuite/g++.dg/gomp/udr-5.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S
 {
   int s;
diff --git a/gcc/testsuite/gcc.dg/gomp/attrs-12.c b/gcc/testsuite/gcc.dg/gomp/attrs-12.c
index ed4c0416d9ba..1a593f9678a0 100644
--- a/gcc/testsuite/gcc.dg/gomp/attrs-12.c
+++ b/gcc/testsuite/gcc.dg/gomp/attrs-12.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -std=c23" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 #pragma omp declare target
 [[omp::directive (declare target)]];
diff --git a/gcc/testsuite/gcc.dg/gomp/attrs-5.c b/gcc/testsuite/gcc.dg/gomp/attrs-5.c
index bbf91f6d171d..4e67783562e1 100644
--- a/gcc/testsuite/gcc.dg/gomp/attrs-5.c
+++ b/gcc/testsuite/gcc.dg/gomp/attrs-5.c
@@ -1,4 +1,4 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -std=c23" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "../../g++.dg/gomp/attrs-5.C"
diff --git a/gcc/testsuite/gcc.dg/gomp/attrs-9.c b/gcc/testsuite/gcc.dg/gomp/attrs-9.c
index 1d2207e6a761..2e0f6f59a64c 100644
--- a/gcc/testsuite/gcc.dg/gomp/attrs-9.c
+++ b/gcc/testsuite/gcc.dg/gomp/attrs-9.c
@@ -1,4 +1,4 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -std=c23" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "../../g++.dg/gomp/attrs-9.C"
diff --git a/gcc/testsuite/gcc.dg/gomp/clause-1.c b/gcc/testsuite/gcc.dg/gomp/clause-1.c
index 8e7cc950d22a..3770fbf6a87d 100644
--- a/gcc/testsuite/gcc.dg/gomp/clause-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/clause-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target tls } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define p parallel
 
 extern void bar (void);
diff --git a/gcc/testsuite/gcc.dg/gomp/declare-simd-3.c b/gcc/testsuite/gcc.dg/gomp/declare-simd-3.c
index ba8e71008b5b..09e5e8d03f94 100644
--- a/gcc/testsuite/gcc.dg/gomp/declare-simd-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/declare-simd-3.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare simd linear(p:1) linear(val(q):-1) linear(s:-3)
 int
 f1 (int *p, int *q, short *s)
diff --git a/gcc/testsuite/gcc.dg/gomp/linear-1.c b/gcc/testsuite/gcc.dg/gomp/linear-1.c
index f906e3991bb6..8b0a4f3385fd 100644
--- a/gcc/testsuite/gcc.dg/gomp/linear-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/linear-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int i, j;
 
 void
diff --git a/gcc/testsuite/gcc.dg/gomp/map-csm-dep.c b/gcc/testsuite/gcc.dg/gomp/map-csm-dep.c
new file mode 100644
index 000000000000..16f36529aff9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/map-csm-dep.c
@@ -0,0 +1,30 @@
+// can't manage to elicit the "illegal comma" but it seems that we're already getting errors for improper syntax.
+// otherwise, though, the deprecation works as intended.
+int
+main()
+  {
+    float B[8];
+    float C[8];
+    // this should be completely fine
+    #pragma omp target teams map(to: B[0:8], C[0:8])
+    {}
+    // this should give us a deprecation warning
+    #pragma omp target teams map(close always present to: B[0:8], C[0:8]) // { dg-warning "'map' clause modifiers without comma separation is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
+    {}
+    // this should be completely fine
+    #pragma omp target teams map(close, always, present, to: B[0:8], C[0:8])
+    {}
+    // this should be raising illegal comma.
+    // { dg-error "'close' undeclared" "" { target *-*-* } 19 }
+    #pragma omp target teams map(close always,, present, to: B[0:8], C[0:8])
+    {}
+    // { dg-error "expected '\\)' before 'always'" "" { target *-*-* } 19 }
+
+
+    #pragma omp target teams map(,close to: B[0:8], C[0:8]) // { dg-error "expected expression before ',' token" }
+    {}
+    // { dg-error "'always' undeclared" "" { target *-*-* } 27 }
+    #pragma omp target teams map(close,,always to: B[0:8] C[0:8]) // { dg-error "expected expression before ',' token" }
+    {}
+    return 0;
+  }
diff --git a/gcc/testsuite/gcc.dg/gomp/metadirective-1.c b/gcc/testsuite/gcc.dg/gomp/metadirective-1.c
index 2ac81bfde753..8d354e4037da 100644
--- a/gcc/testsuite/gcc.dg/gomp/metadirective-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/metadirective-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int main (void)
 {
   int x, y;
diff --git a/gcc/testsuite/gcc.dg/gomp/pr104757.c b/gcc/testsuite/gcc.dg/gomp/pr104757.c
index 738396523af7..f8672cad28c4 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr104757.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr104757.c
@@ -1,7 +1,7 @@
 /* PR middle-end/104757 */
 /* { dg-do compile } */
 /* { dg-options "-O2 -fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 void
 foo (int x, int y, int *z)
diff --git a/gcc/testsuite/gcc.dg/gomp/sink-fold-1.c b/gcc/testsuite/gcc.dg/gomp/sink-fold-1.c
index d166dac950b2..56498066679a 100644
--- a/gcc/testsuite/gcc.dg/gomp/sink-fold-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/sink-fold-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -fdump-tree-omplower" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test depend(sink) clause folding.  */
 
 int i,j,k, N;
diff --git a/gcc/testsuite/gcc.dg/gomp/sink-fold-2.c b/gcc/testsuite/gcc.dg/gomp/sink-fold-2.c
index f3cdaee19008..d2b15f3f2e2a 100644
--- a/gcc/testsuite/gcc.dg/gomp/sink-fold-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/sink-fold-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int i,j, N;
 
 extern void bar();
diff --git a/gcc/testsuite/gcc.dg/gomp/sink-fold-3.c b/gcc/testsuite/gcc.dg/gomp/sink-fold-3.c
index d3af18e17e7f..2b93c77ce917 100644
--- a/gcc/testsuite/gcc.dg/gomp/sink-fold-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/sink-fold-3.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp -fdump-tree-omplower" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that we fold sink offsets correctly while taking into account
    pointer sizes.  */
 
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-1.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-1.c
index 0d74aa971f93..48acde09b2f5 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-1.c
@@ -1,6 +1,6 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details -fdump-ipa-cgraph" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that simd clones are generated for functions with "declare target".  */
 
 #pragma omp declare target
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-2.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-2.c
index acdc241db46c..16928afc9451 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-2.c
@@ -1,7 +1,7 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fdump-ipa-simdclone-details" } */
-
-/* Test that host simd clones are not generated for functions with 
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that host simd clones are not generated for functions with
    "declare target" by default at -O2.  */
 
 #pragma omp declare target
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-3.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-3.c
index e90d49ce7f2c..e5db3b4c3811 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-3.c
@@ -1,6 +1,6 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Test that host simd clones are not generated for functions with the nohost
    "declare target" clause.  */
 
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-4.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-4.c
index 141097bdce8f..f115c97765e3 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-4.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-4.c
@@ -1,7 +1,7 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with 
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
    "declare target" but that write memory in the body.  */
 
 extern int save;
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-5.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-5.c
index 93f9774f8319..5355cc99c1d7 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-5.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-5.c
@@ -1,14 +1,14 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
 
-/* Test that simd clones are not generated for functions with 
+/* Test that simd clones are not generated for functions with
    "declare target" but unsuitable arguments.  */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct s {
   int a;
   int b;
 };
-  
+
 #pragma omp declare target
 __attribute__ ((__noinline__)) int addit (struct s x)
 {
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-6.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-6.c
index 4c34967af95f..f2cf513492d6 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-6.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-6.c
@@ -1,8 +1,8 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with 
-   "declare target" but that call possibly side-effecting functions 
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
+   "declare target" but that call possibly side-effecting functions
    in the body.  */
 
 extern int f (int);
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-7.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-7.c
index 78c60f9f6bcd..3631145904fd 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-7.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-7.c
@@ -1,7 +1,7 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with 
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
    "declare target" that have no callers in the same compilation unit.  */
 
 #pragma omp declare target
diff --git a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-8.c b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-8.c
index 561766cb128d..d06b640ae5ff 100644
--- a/gcc/testsuite/gcc.dg/gomp/target-simd-clone-8.c
+++ b/gcc/testsuite/gcc.dg/gomp/target-simd-clone-8.c
@@ -1,7 +1,7 @@
 /* { dg-options "-fopenmp -O2" } */
 /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with 
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
    "declare target" but that read volatile memory in the body.  */
 
 extern volatile int save;
diff --git a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-55.c b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-55.c
index 6b9a7ecd5a14..ca865d07f81c 100644
--- a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-55.c
+++ b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-55.c
@@ -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/gcc.dg/gomp/workshare-reduction-56.c b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-56.c
index 955c6d4eef88..c894edabf872 100644
--- a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-56.c
+++ b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-56.c
@@ -7,7 +7,7 @@
 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_static_next " 1 "optimized" } } */
 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_workshare_task_reduction_unregister \\(0\\)" 1 "optimized" } } */
 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel " 1 "optimized" } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 unsigned long long int j;
 void bar (unsigned long long int *);
 
diff --git a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-57.c b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-57.c
index 9019886665a3..274ed3701554 100644
--- a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-57.c
+++ b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-57.c
@@ -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/gcc.dg/gomp/workshare-reduction-58.c b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-58.c
index 7907aba5ee0c..d0bbd5930f56 100644
--- a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-58.c
+++ b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-58.c
@@ -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.c++/declare_target-1.C b/libgomp/testsuite/libgomp.c++/declare_target-1.C
index 4394bb1405df..2c6a2de49f3b 100644
--- a/libgomp/testsuite/libgomp.c++/declare_target-1.C
+++ b/libgomp/testsuite/libgomp.c++/declare_target-1.C
@@ -1,6 +1,7 @@
 // { dg-do run }
 // { dg-require-effective-target offload_device_shared_as }
-
+// { dg-additional-options "-Wno-deprecated-declarations" }
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 struct typeX
diff --git a/libgomp/testsuite/libgomp.c++/depobj-1.C b/libgomp/testsuite/libgomp.c++/depobj-1.C
index 91edf8cc34b1..6fd00df272eb 100644
--- a/libgomp/testsuite/libgomp.c++/depobj-1.C
+++ b/libgomp/testsuite/libgomp.c++/depobj-1.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <omp.h>
 
diff --git a/libgomp/testsuite/libgomp.c++/doacross-1.C b/libgomp/testsuite/libgomp.c++/doacross-1.C
index bc53ee6e8a2b..dbed10459150 100644
--- a/libgomp/testsuite/libgomp.c++/doacross-1.C
+++ b/libgomp/testsuite/libgomp.c++/doacross-1.C
@@ -1,5 +1,5 @@
 // { dg-do run }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 extern "C" void abort ();
 
diff --git a/libgomp/testsuite/libgomp.c++/for-15.C b/libgomp/testsuite/libgomp.c++/for-15.C
index ddb9ce629dd8..9aaf6c29fb44 100644
--- a/libgomp/testsuite/libgomp.c++/for-15.C
+++ b/libgomp/testsuite/libgomp.c++/for-15.C
@@ -1,7 +1,7 @@
 // PR c++/86443
 // { dg-do run }
 // { dg-additional-options "-std=c++17" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 extern "C" void abort ();
 
diff --git a/libgomp/testsuite/libgomp.c++/for-24.C b/libgomp/testsuite/libgomp.c++/for-24.C
index 99f74e469114..0a5d8baa2544 100644
--- a/libgomp/testsuite/libgomp.c++/for-24.C
+++ b/libgomp/testsuite/libgomp.c++/for-24.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options "-std=c++17" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 extern "C" void abort ();
 
diff --git a/libgomp/testsuite/libgomp.c++/pr101544-1-O0.C b/libgomp/testsuite/libgomp.c++/pr101544-1-O0.C
index c8a73dcfa19f..314f4a6a0f58 100644
--- a/libgomp/testsuite/libgomp.c++/pr101544-1-O0.C
+++ b/libgomp/testsuite/libgomp.c++/pr101544-1-O0.C
@@ -1,3 +1,3 @@
 // { dg-additional-options -O0 }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "pr101544-1.C"
diff --git a/libgomp/testsuite/libgomp.c++/pr101544-1.C b/libgomp/testsuite/libgomp.c++/pr101544-1.C
index 22c81aa5f860..ae25ca39a6cf 100644
--- a/libgomp/testsuite/libgomp.c++/pr101544-1.C
+++ b/libgomp/testsuite/libgomp.c++/pr101544-1.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 // See also '../libgomp.oacc-c++/pr101544-1.C'.
 #ifndef ALWAYS_INLINE
 # define ALWAYS_INLINE
diff --git a/libgomp/testsuite/libgomp.c++/pr96835-1-O0.C b/libgomp/testsuite/libgomp.c++/pr96835-1-O0.C
index 85e42909e29f..3a8dd39d10e2 100644
--- a/libgomp/testsuite/libgomp.c++/pr96835-1-O0.C
+++ b/libgomp/testsuite/libgomp.c++/pr96835-1-O0.C
@@ -1,3 +1,3 @@
 // { dg-additional-options -O0 }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "pr96835-1.C"
diff --git a/libgomp/testsuite/libgomp.c++/pr96835-1.C b/libgomp/testsuite/libgomp.c++/pr96835-1.C
index c9f6475eeb91..863ff7b8b0bb 100644
--- a/libgomp/testsuite/libgomp.c++/pr96835-1.C
+++ b/libgomp/testsuite/libgomp.c++/pr96835-1.C
@@ -1,4 +1,5 @@
 // See also '../libgomp.oacc-c++/pr96835-1.C'.
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #ifndef ALWAYS_INLINE
 # define ALWAYS_INLINE
 #endif
diff --git a/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C b/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C
index a704e39411da..2da754879f02 100644
--- a/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C
+++ b/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C
@@ -26,7 +26,7 @@
 // { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_amdgcn } } }
 // { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-not "omp_initial_device;" "optimized" { target offload_target_nvptx } } }
 // { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_nvptx } } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <cassert>
 #include <omp.h>
 
diff --git a/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C b/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C
index de481aadd34e..1aab931920f2 100644
--- a/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C
+++ b/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C
@@ -27,7 +27,7 @@
 // { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_amdgcn } } }
 // { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-not "omp_initial_device;" "optimized" { target offload_target_nvptx } } }
 // { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_nvptx } } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 
 #include <cassert>
 
diff --git a/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-3.C b/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-3.C
index 8d4aff21cd79..51e14211392b 100644
--- a/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-3.C
+++ b/libgomp/testsuite/libgomp.c++/static-aggr-constructor-destructor-3.C
@@ -1,5 +1,5 @@
 // { dg-do run }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <cassert>
 
 #pragma omp declare target
diff --git a/libgomp/testsuite/libgomp.c++/target-13.C b/libgomp/testsuite/libgomp.c++/target-13.C
index 5279ac026840..536fe4d0dde9 100644
--- a/libgomp/testsuite/libgomp.c++/target-13.C
+++ b/libgomp/testsuite/libgomp.c++/target-13.C
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern "C" void abort (void);
 
 int g;
diff --git a/libgomp/testsuite/libgomp.c++/target-cdtor-1.C b/libgomp/testsuite/libgomp.c++/target-cdtor-1.C
index 7e8cc582e94e..a6be4a046018 100644
--- a/libgomp/testsuite/libgomp.c++/target-cdtor-1.C
+++ b/libgomp/testsuite/libgomp.c++/target-cdtor-1.C
@@ -2,7 +2,7 @@
 
 /* { dg-additional-options -fdump-tree-optimized-raw-asmname }
    { dg-additional-options -foffload-options=-fdump-tree-optimized-raw-asmname } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 #include <vector>
 
diff --git a/libgomp/testsuite/libgomp.c++/target-cdtor-2.C b/libgomp/testsuite/libgomp.c++/target-cdtor-2.C
index 9c8512245b13..a673ddb6898c 100644
--- a/libgomp/testsuite/libgomp.c++/target-cdtor-2.C
+++ b/libgomp/testsuite/libgomp.c++/target-cdtor-2.C
@@ -4,7 +4,7 @@
 
 /* { dg-additional-options -fdump-tree-optimized-raw-asmname }
    { dg-additional-options -foffload-options=-fdump-tree-optimized-raw-asmname } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 #include <vector>
 
diff --git a/libgomp/testsuite/libgomp.c++/target-std__array-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__array-concurrent-usm.C
index aa36f7109e93..c98d8559b977 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__array-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__array-concurrent-usm.C
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__array-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__array-concurrent.C
index ee5e094c6943..d40fe1044ffa 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__array-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__array-concurrent.C
@@ -1,5 +1,6 @@
 // { dg-do run }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
+// { dg-additional-options "-Wno-deprecated-openmp" }
 
 #include <stdlib.h>
 #include <time.h>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__cmath.C b/libgomp/testsuite/libgomp.c++/target-std__cmath.C
index aaf715237a40..73f50bbcf2e4 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__cmath.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__cmath.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options "-std=c++20" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <cmath>
 #include <numbers>
 
diff --git a/libgomp/testsuite/libgomp.c++/target-std__complex.C b/libgomp/testsuite/libgomp.c++/target-std__complex.C
index e392d17a3039..db6c66b70e24 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__complex.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__complex.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options "-std=c++20" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <cmath>
 #include <complex>
 #include <numbers>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent-usm.C
index b30ade4f0865..aaa6acc63128 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent-usm.C
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent.C
index d8c929997a54..e89c2557c917 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__deque-concurrent.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <time.h>
 #include <deque>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C
index 65004b25510b..2c28ed815805 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent.C
index 4a98e4734fbb..93f914767128 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__forward_list-concurrent.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <time.h>
 #include <omp.h>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__list-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__list-concurrent-usm.C
index 3cdd44db4277..dec92d2639d2 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__list-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__list-concurrent-usm.C
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__list-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__list-concurrent.C
index bede83920350..6b3f8c512314 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__list-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__list-concurrent.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <time.h>
 #include <omp.h>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__numbers.C b/libgomp/testsuite/libgomp.c++/target-std__numbers.C
index a6b3665663b2..8ce0c251dbde 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__numbers.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__numbers.C
@@ -1,5 +1,6 @@
 // { dg-do run }
 // { dg-additional-options "-std=c++20" }
+// { dg-additional-options "-Wno-deprecated-openmp" }
 
 #include <cmath>
 #include <numbers>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__span-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__span-concurrent-usm.C
index 09f98790b3cb..09af5c2dd214 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__span-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__span-concurrent-usm.C
@@ -1,6 +1,6 @@
 // { dg-additional-options "-std=c++20" }
 /* { dg-require-effective-target omp_usm } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__span-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__span-concurrent.C
index d6186f76ac57..761abc357e70 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__span-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__span-concurrent.C
@@ -1,7 +1,7 @@
 // { dg-do run }
 // { dg-additional-options "-std=c++20" }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <time.h>
 #include <span>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__valarray-1.C b/libgomp/testsuite/libgomp.c++/target-std__valarray-1.C
index 9a77fb256bf4..f15ba7ec005b 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__valarray-1.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__valarray-1.C
@@ -1,6 +1,6 @@
 // { dg-additional-options -std=c++20 }
 // { dg-output-file target-std__valarray-1.output }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <valarray>
 #include <ostream>
 #include <sstream>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C
index 828b67c39306..9a0485ce77a4 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent.C
index 81eebe83e037..15ca0f999b4e 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__valarray-concurrent.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <time.h>
 #include <valarray>
diff --git a/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent-usm.C b/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent-usm.C
index 835f6d5287eb..c9f428383275 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent-usm.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent-usm.C
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp requires unified_shared_memory self_maps
 
 #define MEM_SHARED
diff --git a/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent.C b/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent.C
index d728194eb68a..ae2696301076 100644
--- a/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent.C
+++ b/libgomp/testsuite/libgomp.c++/target-std__vector-concurrent.C
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <time.h>
 #include <vector>
diff --git a/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c b/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c
index c5670dfb7db7..bd57477e9599 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c
@@ -1,6 +1,5 @@
 /* PR c++/99509  */
-
-#pragma omp declare target
+#pragma omp declare target // { dg-warning "use of 'omp declare target' as a synonym for 'omp begin declare target' has been deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
 int data[] = {5};
 #pragma omp end declare target
 
diff --git a/libgomp/testsuite/libgomp.c-c++-common/depend-2.c b/libgomp/testsuite/libgomp.c-c++-common/depend-2.c
index 2fe867e2c83f..7b793123e8ab 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/depend-2.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/depend-2.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -7,7 +8,7 @@ test (int ifval)
 {
   int a[8], b[8], i;
   omp_depend_t d1, d2;
-  #pragma omp depobj (d1) depend(inout: omp_all_memory) 
+  #pragma omp depobj (d1) depend(inout: omp_all_memory)
   #pragma omp depobj (d2) depend(out: omp_all_memory)
   for (i = 0; i < 8; i++)
     {
@@ -99,7 +100,7 @@ test (int ifval)
       b[0] = 6 * i + 57;
       for (i = 1; i < 8; ++i)
 	{
-	  if (b[i] != 4 * i - 7) 
+	  if (b[i] != 4 * i - 7)
 	    abort ();
 	  b[i] = 6 * i + 57;
 	}
diff --git a/libgomp/testsuite/libgomp.c-c++-common/depobj-1.c b/libgomp/testsuite/libgomp.c-c++-common/depobj-1.c
index a07a0c889c11..744c7da57b29 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/depobj-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/depobj-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <omp.h>
 
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-11.c b/libgomp/testsuite/libgomp.c-c++-common/for-11.c
index e46b4dd04c17..35acbc2ca255 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-11.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-11.c
@@ -1,4 +1,4 @@
 /* { dg-additional-options "-std=gnu99" {target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define CONDNE
 #include "for-5.c"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-12.c b/libgomp/testsuite/libgomp.c-c++-common/for-12.c
index e28ba93f8fe6..6d6f3c0f3b9d 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-12.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-12.c
@@ -1,4 +1,4 @@
 /* { dg-additional-options "-std=gnu99" {target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define CONDNE
 #include "for-6.c"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-16.c b/libgomp/testsuite/libgomp.c-c++-common/for-16.c
index 5649ba9ee874..daa996eaf89a 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-16.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-16.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-3.c b/libgomp/testsuite/libgomp.c-c++-common/for-3.c
index 285f8e9bd4de..eb09039ec18e 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-3.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-3.c
@@ -1,5 +1,5 @@
 /* { dg-additional-options "-std=gnu99" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-5.c b/libgomp/testsuite/libgomp.c-c++-common/for-5.c
index edfbe13ecdaf..79c9d399f62c 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-5.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-5.c
@@ -1,5 +1,5 @@
 /* { dg-additional-options "-std=gnu99" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-6.c b/libgomp/testsuite/libgomp.c-c++-common/for-6.c
index 64a754e51b88..4a40f018e7b3 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-6.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-6.c
@@ -1,5 +1,5 @@
 /* { dg-additional-options "-std=gnu99" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-9.c b/libgomp/testsuite/libgomp.c-c++-common/for-9.c
index dfd674fee56d..059a2778787d 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/for-9.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/for-9.c
@@ -1,4 +1,4 @@
 /* { dg-additional-options "-std=gnu99" {target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define CONDNE
 #include "for-3.c"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c b/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c
index bc1ae68941a0..072b83d5061e 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c
@@ -1,7 +1,7 @@
 /* { dg-do link } */
 /* { dg-excess-errors "unresolved symbol foo, lto1, mkoffload and lto-wrapper fatal errors" { target { offload_target_nvptx || offload_target_amdgcn } } } */
 /* { dg-additional-sources "function-not-offloaded-aux.c" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int var;
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/metadirective-1.c b/libgomp/testsuite/libgomp.c-c++-common/metadirective-1.c
index fbe4ac3a954e..e77fb0579ba0 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/metadirective-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/metadirective-1.c
@@ -1,6 +1,6 @@
 /* { dg-do run { target { ! offload_target_nvptx } } } */
 /* { dg-do compile { target offload_target_nvptx } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 void
diff --git a/libgomp/testsuite/libgomp.c-c++-common/metadirective-2.c b/libgomp/testsuite/libgomp.c-c++-common/metadirective-2.c
index 9b5e5cf5d9cb..5714a0a3daf4 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/metadirective-2.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/metadirective-2.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <math.h>
 
 #define N 100
diff --git a/libgomp/testsuite/libgomp.c-c++-common/metadirective-3.c b/libgomp/testsuite/libgomp.c-c++-common/metadirective-3.c
index b6879c924408..a91ec7814851 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/metadirective-3.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/metadirective-3.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 int
diff --git a/libgomp/testsuite/libgomp.c-c++-common/metadirective-5.c b/libgomp/testsuite/libgomp.c-c++-common/metadirective-5.c
index e869932de6db..f5040eb78e54 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/metadirective-5.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/metadirective-5.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 100
 
 #include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.c-c++-common/monotonic-1.c b/libgomp/testsuite/libgomp.c-c++-common/monotonic-1.c
index c3c0100f052d..0e5af829cc99 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/monotonic-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/monotonic-1.c
@@ -226,14 +226,14 @@ main ()
 	    n = 1;
 	    c++;
 	  }
-	#pragma omp ordered depend(source)
+	#pragma omp ordered depend(source) // { dg-warning "'source' modifier with 'depend' clause deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" }
 	if (MONOTONIC_UNDEF > 0)
 	  {
-	    #pragma omp ordered depend(sink: i)
+	    #pragma omp ordered depend(sink: i) // { dg-warning "'sink' modifier with 'depend' clause deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" }
 	  }
 	else
 	  {
-	    #pragma omp ordered depend(sink: i - 1)
+	    #pragma omp ordered depend(sink: i - 1) // { dg-warning "'sink' modifier with 'depend' clause deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" }
 	  }
 	l = i;
       }
diff --git a/libgomp/testsuite/libgomp.c-c++-common/monotonic-2.c b/libgomp/testsuite/libgomp.c-c++-common/monotonic-2.c
index b886a24c99ad..815bb892a6dd 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/monotonic-2.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/monotonic-2.c
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 
 #include <omp.h>
 #include <stdlib.h>
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c b/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c
index af12295541a2..60dad90decab 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c
@@ -1,5 +1,5 @@
 /* Based on sollve_vv's tests/5.0/declare_target/test_nested_declare_target.c.  */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 1024
 int a[N], b[N], c[N];  
 int i = 0;
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-2.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-2.c
index 2fc9eec529a0..2a21441f800c 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-2.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-2.c
@@ -1,6 +1,6 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-4.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-4.c
index d6d13676f549..28c6f8c4e415 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-4.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-4.c
@@ -1,7 +1,7 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
 /* { dg-options "-O2" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-5.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-5.c
index 7ade43c4c9f1..16f41d0c0fcb 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-5.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-5.c
@@ -1,6 +1,6 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-6.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-6.c
index 86467d7c726a..5ecabb643ea4 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-6.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-6.c
@@ -1,7 +1,7 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
 /* { dg-options "-O2" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-7.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-7.c
index 752367e3ac5d..d4822a6edc64 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-7.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-7.c
@@ -1,6 +1,6 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-8.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-8.c
index 102af0691ec8..79e766f5f77d 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-8.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-8.c
@@ -1,6 +1,6 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr66199-9.c b/libgomp/testsuite/libgomp.c-c++-common/pr66199-9.c
index 554a4765b4e3..0dfc9eec7f48 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr66199-9.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr66199-9.c
@@ -1,6 +1,6 @@
 /* PR middle-end/66199 */
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 int u[1024], v[1024], w[1024];
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/ptr-attach-1.c b/libgomp/testsuite/libgomp.c-c++-common/ptr-attach-1.c
index 849dd97e231b..05b712b87519 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/ptr-attach-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/ptr-attach-1.c
@@ -8,7 +8,7 @@ struct S
 };
 typedef struct S S;
 
-#pragma omp declare target
+#pragma omp declare target // { dg-warning "use of 'omp declare target' as a synonym for 'omp begin declare target' has been deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
 int *gp;
 #pragma omp end declare target
 
diff --git a/libgomp/testsuite/libgomp.c-c++-common/reverse-offload-1.c b/libgomp/testsuite/libgomp.c-c++-common/reverse-offload-1.c
index 52d828caf1cf..986658fc068e 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/reverse-offload-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/reverse-offload-1.c
@@ -1,7 +1,7 @@
 /* { dg-do run }  */
 /* { dg-additional-options "-foffload-options=nvptx-none=-misa=sm_35" { target { offload_target_nvptx } } } */
 /* { dg-additional-sources reverse-offload-1-aux.c } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* Check that reverse offload works in particular:
    - no code is generated on the device side (i.e. no
      implicit declare target of called functions and no
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-1.c b/libgomp/testsuite/libgomp.c-c++-common/target-1.c
index c7abb008182a..d558ddaadbf3 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-10.c b/libgomp/testsuite/libgomp.c-c++-common/target-10.c
index bc66880b6afc..4ad707c56581 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-10.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-10.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #pragma omp declare target
 extern int v;
 #pragma omp end declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-40.c b/libgomp/testsuite/libgomp.c-c++-common/target-40.c
index 554860ab088c..7fe189a4022f 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-40.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-40.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O0" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1-O0.c b/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1-O0.c
index 9bf949a1f066..1e0f2a7de770 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1-O0.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1-O0.c
@@ -1,3 +1,3 @@
 /* { dg-additional-options -O0 } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "target-abi-struct-1.c"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1.c b/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1.c
index d9268af55cfe..475ce653023a 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-abi-struct-1.c
@@ -1 +1,2 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "../libgomp.oacc-c-c++-common/abi-struct-1.c"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-cdtor-1.c b/libgomp/testsuite/libgomp.c-c++-common/target-cdtor-1.c
index e6099cf23b88..2b2097607b78 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-cdtor-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-cdtor-1.c
@@ -1,5 +1,5 @@
 /* Offloaded 'constructor' and 'destructor' functions.  */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 
 #pragma omp declare target
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-same-name-1.c b/libgomp/testsuite/libgomp.c-c++-common/target-same-name-1.c
index b35d8c96ae26..2fbe41ac6e1a 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-same-name-1.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-same-name-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* { dg-additional-sources "target-same-name-1-a.c target-same-name-1-b.c" } */
 /* PR middle-end/104285 */
 
diff --git a/libgomp/testsuite/libgomp.c-c++-common/task-reduction-14.c b/libgomp/testsuite/libgomp.c-c++-common/task-reduction-14.c
index 37c00d4394aa..5f61b89f25ee 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/task-reduction-14.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/task-reduction-14.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern
 #ifdef __cplusplus
 "C"
diff --git a/libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c b/libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c
index fe2a8b262427..fdfa59cf9d84 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c
@@ -1,6 +1,6 @@
 /* { dg-do link } */
 /* { dg-excess-errors "lto1, mkoffload and lto-wrapper fatal errors" { target { offload_target_nvptx || offload_target_amdgcn } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 int var; /* { dg-error "variable 'var' has been referenced in offloaded code but hasn't been marked to be included in the offloaded code" "" { target { offload_target_nvptx || offload_target_amdgcn } } } */
 
 #pragma omp declare target
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3.c b/libgomp/testsuite/libgomp.c/declare-variant-3.c
index 62c1fa766ba3..8eb7b7b5765a 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3.c
@@ -1,6 +1,6 @@
 /* { dg-additional-options -DOFFLOAD_DEVICE_NVPTX { target offload_device_nvptx } } */
 /* { dg-additional-options {-fdump-tree-optimized -foffload-options=-fdump-tree-optimized} } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "declare-variant-3.h"
 
 /* { dg-final { scan-tree-dump "= f \\(\\);" "optimized" } }
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4.c b/libgomp/testsuite/libgomp.c/declare-variant-4.c
index 3c8802a6081f..609328d3ee20 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4.c
@@ -1,6 +1,6 @@
 /* { dg-additional-options -DOFFLOAD_DEVICE_GCN { target offload_device_gcn } } */
 /* { dg-additional-options {-fdump-tree-optimized -foffload-options=-fdump-tree-optimized} } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include "declare-variant-4.h"
 
 /* { dg-final { scan-tree-dump "= f \\(\\);" "optimized" } }
diff --git a/libgomp/testsuite/libgomp.c/doacross-1.c b/libgomp/testsuite/libgomp.c/doacross-1.c
index 3d12f1cfc02b..b77ab24fc81b 100644
--- a/libgomp/testsuite/libgomp.c/doacross-1.c
+++ b/libgomp/testsuite/libgomp.c/doacross-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 
 #define N 256
diff --git a/libgomp/testsuite/libgomp.c/doacross-2.c b/libgomp/testsuite/libgomp.c/doacross-2.c
index 0911dd207d93..8c8cddc62f0b 100644
--- a/libgomp/testsuite/libgomp.c/doacross-2.c
+++ b/libgomp/testsuite/libgomp.c/doacross-2.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 
 #define N 256
diff --git a/libgomp/testsuite/libgomp.c/doacross-3.c b/libgomp/testsuite/libgomp.c/doacross-3.c
index 9a70b1087724..012853c748b1 100644
--- a/libgomp/testsuite/libgomp.c/doacross-3.c
+++ b/libgomp/testsuite/libgomp.c/doacross-3.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 
 #define N 256
diff --git a/libgomp/testsuite/libgomp.c/examples-4/async_target-1.c b/libgomp/testsuite/libgomp.c/examples-4/async_target-1.c
index b2e1f1feef81..9c59b29726e8 100644
--- a/libgomp/testsuite/libgomp.c/examples-4/async_target-1.c
+++ b/libgomp/testsuite/libgomp.c/examples-4/async_target-1.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-additional-options "-DCHUNKSZ=5000" { target { ! run_expensive_tests } } } */
 /* { dg-additional-options "-DCHUNKSZ=1000" { target run_expensive_tests } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 #define EPS 0.00001
diff --git a/libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c
index 6d4bc4fac12b..51deb4769988 100644
--- a/libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c
+++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 
 #include <stdlib.h>
 
diff --git a/libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c
index 8025335722a2..e61eae43eb8d 100644
--- a/libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c
+++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 #define EPS 0.000001
diff --git a/libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c
index f24143669517..57ce99d530e4 100644
--- a/libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c
+++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-additional-options "-DTESTITERS=20" { target { ! run_expensive_tests } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 #define EPS 0.00001
diff --git a/libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c
index 33d6137afd52..09c47bac95fc 100644
--- a/libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c
+++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c
@@ -1,7 +1,7 @@
 /* { dg-do run { target vect_simd_clones } } */
 /* { dg-additional-options "-msse2" { target sse2_runtime } } */
 /* { dg-additional-options "-mavx" { target avx_runtime } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 #define EPS 0.00001
diff --git a/libgomp/testsuite/libgomp.c/max_vf-1.c b/libgomp/testsuite/libgomp.c/max_vf-1.c
index 70f6b86c614c..e18424dece0a 100644
--- a/libgomp/testsuite/libgomp.c/max_vf-1.c
+++ b/libgomp/testsuite/libgomp.c/max_vf-1.c
@@ -8,7 +8,7 @@
 
 /* Fix a max_vf size so we can scan for it.
 { dg-additional-options "-msse2 -mno-avx" { target { x86_64-*-* i?86-*-* } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define N 1024
 int a[N], b[N], c[N];
 
diff --git a/libgomp/testsuite/libgomp.c/pr81778.c b/libgomp/testsuite/libgomp.c/pr81778.c
index 571668eb36a9..101e7bf5bf60 100644
--- a/libgomp/testsuite/libgomp.c/pr81778.c
+++ b/libgomp/testsuite/libgomp.c/pr81778.c
@@ -1,5 +1,5 @@
 /* Minimized from for-5.c.  */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdio.h>
 #include <stdlib.h>
 
diff --git a/libgomp/testsuite/libgomp.c/pr86660.c b/libgomp/testsuite/libgomp.c/pr86660.c
index bea6b15270bd..274dee2b337f 100644
--- a/libgomp/testsuite/libgomp.c/pr86660.c
+++ b/libgomp/testsuite/libgomp.c/pr86660.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 /* PR middle-end/86660 */
 
 #pragma omp declare target
diff --git a/libgomp/testsuite/libgomp.c/reduction-4.c b/libgomp/testsuite/libgomp.c/reduction-4.c
index 23e9d6d5bda8..e0d913504f4b 100644
--- a/libgomp/testsuite/libgomp.c/reduction-4.c
+++ b/libgomp/testsuite/libgomp.c/reduction-4.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 #include <stdlib.h>
 
@@ -11,7 +12,7 @@ main (void)
     if (i != 0 || k != 0 || l != 0)
 #pragma omp atomic
       j |= 1;
-  
+
     if (omp_get_num_threads () != 4)
 #pragma omp atomic
       j |= 2;
diff --git a/libgomp/testsuite/libgomp.c/switch-conversion.c b/libgomp/testsuite/libgomp.c/switch-conversion.c
index 835f54e17acb..d307b4e7197b 100644
--- a/libgomp/testsuite/libgomp.c/switch-conversion.c
+++ b/libgomp/testsuite/libgomp.c/switch-conversion.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/85063 */
 /* { dg-additional-options "-ftree-switch-conversion" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 #pragma omp declare target
diff --git a/libgomp/testsuite/libgomp.c/target-26.c b/libgomp/testsuite/libgomp.c/target-26.c
index fa6b52598da9..bc338dff749a 100644
--- a/libgomp/testsuite/libgomp.c/target-26.c
+++ b/libgomp/testsuite/libgomp.c/target-26.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 #pragma omp declare target
 int a[4] = { 2, 3, 4, 5 }, *b;
diff --git a/libgomp/testsuite/libgomp.c/target-28.c b/libgomp/testsuite/libgomp.c/target-28.c
index 96e9e058a214..5a7991a8b7e0 100644
--- a/libgomp/testsuite/libgomp.c/target-28.c
+++ b/libgomp/testsuite/libgomp.c/target-28.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 
 int g;
diff --git a/libgomp/testsuite/libgomp.c/target-30.c b/libgomp/testsuite/libgomp.c/target-30.c
index a309f7d1a21b..f1a94e001b0f 100644
--- a/libgomp/testsuite/libgomp.c/target-30.c
+++ b/libgomp/testsuite/libgomp.c/target-30.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 
 #pragma omp declare target
diff --git a/libgomp/testsuite/libgomp.c/target-32.c b/libgomp/testsuite/libgomp.c/target-32.c
index 1444523615ea..5cfd8320db8c 100644
--- a/libgomp/testsuite/libgomp.c/target-32.c
+++ b/libgomp/testsuite/libgomp.c/target-32.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <unistd.h>
 #include "usleep.h"
diff --git a/libgomp/testsuite/libgomp.c/target-35.c b/libgomp/testsuite/libgomp.c/target-35.c
index 6da8b2b9a546..7cb0b7564c91 100644
--- a/libgomp/testsuite/libgomp.c/target-35.c
+++ b/libgomp/testsuite/libgomp.c/target-35.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 #include <stdlib.h>
 
diff --git a/libgomp/testsuite/libgomp.c/target-38.c b/libgomp/testsuite/libgomp.c/target-38.c
index 816997205267..ea1ad74d4ee6 100644
--- a/libgomp/testsuite/libgomp.c/target-38.c
+++ b/libgomp/testsuite/libgomp.c/target-38.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #define A(n) n##0, n##1, n##2, n##3, n##4, n##5, n##6, n##7, n##8, n##9
 #define B(n) A(n##0), A(n##1), A(n##2), A(n##3), A(n##4), A(n##5), A(n##6), A(n##7), A(n##8), A(n##9)
 
diff --git a/libgomp/testsuite/libgomp.c/target-39.c b/libgomp/testsuite/libgomp.c/target-39.c
index 4442f43c8efe..8de98b682d8d 100644
--- a/libgomp/testsuite/libgomp.c/target-39.c
+++ b/libgomp/testsuite/libgomp.c/target-39.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O0" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 extern void abort (void);
 volatile int v;
 #pragma omp declare target to (v)
diff --git a/libgomp/testsuite/libgomp.c/target-9.c b/libgomp/testsuite/libgomp.c/target-9.c
index 4f3c812afd0d..66ae8495552f 100644
--- a/libgomp/testsuite/libgomp.c/target-9.c
+++ b/libgomp/testsuite/libgomp.c/target-9.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O1 -ftree-parallelize-loops=0" } */
 /* { dg-additional-options "-flto" { target lto } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 
 #define N 123456
diff --git a/libgomp/testsuite/libgomp.c/target-link-1.c b/libgomp/testsuite/libgomp.c/target-link-1.c
index 681677cc2aa9..96b5122e3f72 100644
--- a/libgomp/testsuite/libgomp.c/target-link-1.c
+++ b/libgomp/testsuite/libgomp.c/target-link-1.c
@@ -1,3 +1,4 @@
+// { dg-additional-options "-Wno-deprecated-openmp" }
 struct S { int s, t; };
 
 int a = 1, b = 1;
diff --git a/libgomp/testsuite/libgomp.c/target-teams-1.c b/libgomp/testsuite/libgomp.c/target-teams-1.c
index adbabef82b39..86e428e7ad77 100644
--- a/libgomp/testsuite/libgomp.c/target-teams-1.c
+++ b/libgomp/testsuite/libgomp.c/target-teams-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <omp.h>
 #include <stdlib.h>
 
diff --git a/libgomp/testsuite/libgomp.c/thread-limit-2.c b/libgomp/testsuite/libgomp.c/thread-limit-2.c
index 7997a70adc35..76450138598a 100644
--- a/libgomp/testsuite/libgomp.c/thread-limit-2.c
+++ b/libgomp/testsuite/libgomp.c/thread-limit-2.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-set-target-env-var OMP_THREAD_LIMIT "9" } */
 /* { dg-additional-options "-Wno-deprecated-declarations" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
 #include <stdlib.h>
 #include <unistd.h>
 #include <omp.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c
index 84e6d51670bb..b8e44a72d5b9 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c
@@ -3,6 +3,7 @@
 /* { dg-additional-options "-DEXPENSIVE" { target run_expensive_tests } } */
 
 /* { dg-additional-options -Wuninitialized } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
 
 #include <assert.h>


More information about the Gcc-cvs mailing list