gcc/libgomp/testsuite/libgomp.c-c++-common
Jakub Jelinek 0ccba4ed85 openmp: Add support for enter clause on declare target
OpenMP 5.1 and earlier had 2 different uses of to clause, one for target
update construct with one semantics, and one for declare target directive
with a different semantics.
Under the hood we were using OMP_CLAUSE_TO_DECLARE to represent the latter.
OpenMP 5.2 renamed the declare target clause to to enter, the old one is
kept as a deprecated alias.

As we are far from having full OpenMP 5.2 support, this patch adds support
for the enter clause (and renames OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER
with a flag to tell the spelling of the clause for better diagnostics),
but doesn't deprecate the to clause on declare target just yet (that
should be done as one of the last steps in 5.2 support).

2022-05-27  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* tree-core.h (enum omp_clause_code): Rename OMP_CLAUSE_TO_DECLARE
	to OMP_CLAUSE_ENTER.
	* tree.h (OMP_CLAUSE_ENTER_TO): Define.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Rename
	OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER.
	* tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_ENTER
	instead of OMP_CLAUSE_TO_DECLARE, if OMP_CLAUSE_ENTER_TO, print
	"to" instead of "enter".
	* tree-nested.cc (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_ENTER instead of
	OMP_CLAUSE_TO_DECLARE.
gcc/c-family/
	* c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ENTER.
gcc/c/
	* c-parser.cc (c_parser_omp_clause_name): Parse enter clause.
	(c_parser_omp_all_clauses): For to clause on declare target, use
	OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
	OMP_CLAUSE_TO_DECLARE clause.  Handle PRAGMA_OMP_CLAUSE_ENTER.
	(OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
	(c_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
	OMP_CLAUSE_TO_DECLARE.
	* c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
	of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
	name in diagnostics instead of
	omp_clause_code_name[OMP_CLAUSE_CODE (c)].
gcc/cp/
	* parser.cc (cp_parser_omp_clause_name): Parse enter clause.
	(cp_parser_omp_all_clauses): For to clause on declare target, use
	OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
	OMP_CLAUSE_TO_DECLARE clause.  Handle PRAGMA_OMP_CLAUSE_ENTER.
	(OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
	(cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
	OMP_CLAUSE_TO_DECLARE.
	* semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
	of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
	name in diagnostics instead of
	omp_clause_code_name[OMP_CLAUSE_CODE (c)].
gcc/testsuite/
	* c-c++-common/gomp/clauses-3.c: Add tests with enter clause instead
	of to or modify some existing to clauses to enter.
	* c-c++-common/gomp/declare-target-1.c: Likewise.
	* c-c++-common/gomp/declare-target-2.c: Likewise.
	* c-c++-common/gomp/declare-target-3.c: Likewise.
	* g++.dg/gomp/attrs-9.C: Likewise.
	* g++.dg/gomp/declare-target-1.C: Likewise.
libgomp/
	* testsuite/libgomp.c-c++-common/target-40.c: Modify some existing to
	clauses to enter.
	* testsuite/libgomp.c/target-41.c: Likewise.
2022-05-27 12:48:48 +02:00
..
alloc-1.c
alloc-2.c
alloc-3.c
alloc-4.c openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
alloc-5.c openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
alloc-6.c openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
alloc-7.c openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
alloc-8.c openmp: Add omp_aligned_{,c}alloc and omp_{c,re}alloc 2021-09-30 09:30:18 +02:00
alloc-9.c libgomp: alloc* test fixes [PR102628, PR102668] 2021-10-12 09:30:41 +02:00
alloc-10.c libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
allocate-1.c
allocate-2.c openmp: Add support for allocator and align modifiers on allocate clauses 2021-09-22 09:29:13 +02:00
allocate-3.c openmp: Add support for allocator and align modifiers on allocate clauses 2021-09-22 09:29:13 +02:00
atomic-18.c
atomic-19.c
atomic-20.c
atomic-21.c
cancel-parallel-1.c
cancel-taskgroup-1.c
cancel-taskgroup-2.c
cancel-taskgroup-3.c
cancel-taskgroup-4.c
critical-hint-1.c
critical-hint-2.c
declare_target-1.c
default-1.c
depend-1.c openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
depend-2.c openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
depend-3.c openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
depend-inoutset-1.c openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
depend-iterator-1.c
depend-iterator-2.c
depend-mutexinout-1.c
depend-mutexinout-2.c
depobj-1.c
display-affinity-1.c
error-1.c
for-1.c
for-1.h
for-2.c
for-2.h
for-3.c
for-4.c
for-5.c
for-6.c
for-7.c
for-8.c
for-9.c
for-10.c
for-11.c
for-12.c
for-13.c
for-14.c
for-15.c
for-16.c
function-not-offloaded-aux.c
function-not-offloaded.c
get-mapped-ptr-1.c OpenMP, libgomp: Add new runtime routine omp_get_mapped_ptr. 2022-05-02 23:56:44 -07:00
get-mapped-ptr-2.c OpenMP, libgomp: Add new runtime routine omp_get_mapped_ptr. 2022-05-02 23:56:44 -07:00
get-mapped-ptr-3.c OpenMP, libgomp: Add new runtime routine omp_get_mapped_ptr. 2022-05-02 23:56:44 -07:00
get-mapped-ptr-4.c OpenMP, libgomp: Add new runtime routine omp_get_mapped_ptr. 2022-05-02 23:56:44 -07:00
icv-3.c OpenMP: Add strictly nested API call check [PR102972] 2021-10-30 23:45:32 +02:00
icv-4.c OpenMP: Add strictly nested API call check [PR102972] 2021-10-30 23:45:32 +02:00
lastprivate-conditional-1.c
lastprivate-conditional-2.c
lastprivate-conditional-3.c
lastprivate-conditional-4.c
lastprivate-conditional-5.c
lastprivate-conditional-6.c
lastprivate-conditional-7.c Adjust more testcases for O2 vectorization enabling. 2021-10-09 16:28:11 +08:00
lastprivate-conditional-8.c Adjust more testcases for O2 vectorization enabling. 2021-10-09 16:28:11 +08:00
lastprivate-conditional-9.c
lastprivate-conditional-10.c
loop-1.c
loop-13.c
loop-14.c
loop-15.c
masked-1.c
master-combined-1.c
monotonic-1.c
monotonic-2.c
nested-parallel-unbalanced.c
nonmonotonic-1.c
nonmonotonic-2.c
nothing-1.c
on_device_arch.h Improve Intel MIC offloading XFAILing for 'omp_get_device_num' 2022-01-13 13:09:36 +01:00
order-reproducible-1.c openmp: Differentiate between order(concurrent) and order(reproducible:concurrent) 2021-10-01 10:45:48 +02:00
order-reproducible-2.c openmp: Differentiate between order(concurrent) and order(reproducible:concurrent) 2021-10-01 10:45:48 +02:00
ordered-4.c
pause-1.c
pause-2.c
pr45784.c
pr64824.c
pr64868.c
pr66199-1.c
pr66199-2.c
pr66199-3.c
pr66199-4.c
pr66199-5.c
pr66199-6.c
pr66199-7.c
pr66199-8.c
pr66199-9.c
pr66199-10.c
pr66199-11.c
pr66199-12.c
pr66199-13.c
pr66199-14.c
pr69389.c
pr81875.c
pr83046.c
pr93515.c
pr94366.c
pr96390.c [libgomp, testsuite, nvptx] Fix pr96390.c without CUDA 2022-02-22 10:23:20 +01:00
ptr-attach-1.c
reduction-1.c
reduction-2.c
reduction-3.c
reduction-4.c
reduction-5.c
reduction-6.c
reduction-16.c
reduction-17.c
refcount-1.c
scope-1.c
simd-1.c
simd-14.c
simd-15.c
simd-16.c
simd-17.c
struct-elem-1.c
struct-elem-2.c
struct-elem-3.c
struct-elem-4.c
struct-elem-5.c
target-1.c
target-2.c
target-10.c
target-13.c
target-40.c openmp: Add support for enter clause on declare target 2022-05-27 12:48:48 +02:00
target-41.c
target-42.c
target-45.c Improve Intel MIC offloading XFAILing for 'omp_get_device_num' 2022-01-13 13:09:36 +01:00
target-has-device-addr-1.c C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct. 2022-02-09 23:47:12 -08:00
target-implicit-map-1.c openmp: Relax handling of implicit map vs. existing device mappings 2021-11-12 20:29:48 +08:00
target-implicit-map-2.c OpenMP 5.0: Remove array section base-pointer mapping semantics and other front-end adjustments 2021-12-09 00:01:10 +08:00
target-in-reduction-1.c
target-in-reduction-2.c
target-is-accessible-1.c OpenMP, libgomp: Add new runtime routine omp_target_is_accessible. 2022-05-06 07:28:26 -07:00
target-memcpy-async-1.c libgomp: Add new runtime routines omp_target_memcpy_async and omp_target_memcpy_rect_async 2022-05-20 02:29:32 -07:00
target-memcpy-async-2.c libgomp: Add new runtime routines omp_target_memcpy_async and omp_target_memcpy_rect_async 2022-05-20 02:29:32 -07:00
target-memcpy-rect-async-1.c libgomp: Add new runtime routines omp_target_memcpy_async and omp_target_memcpy_rect_async 2022-05-20 02:29:32 -07:00
target-memcpy-rect-async-2.c libgomp: Add new runtime routines omp_target_memcpy_async and omp_target_memcpy_rect_async 2022-05-20 02:29:32 -07:00
target-same-name-1-a.c LTO: Fixes for renaming issues with offload/OpenMP [PR104285] 2022-03-23 09:44:39 +01:00
target-same-name-1-b.c LTO: Fixes for renaming issues with offload/OpenMP [PR104285] 2022-03-23 09:44:39 +01:00
target-same-name-1.c LTO: Fixes for renaming issues with offload/OpenMP [PR104285] 2022-03-23 09:44:39 +01:00
task-detach-1.c
task-detach-2.c
task-detach-3.c
task-detach-4.c
task-detach-5.c
task-detach-6.c [libgomp, nvptx] Fix hang in gomp_team_barrier_wait_end 2022-02-22 15:48:03 +01:00
task-detach-7.c
task-detach-8.c
task-detach-9.c
task-detach-10.c
task-detach-11.c
task-detach-12.c
task-detach-13.c
task-reduction-1.c
task-reduction-2.c
task-reduction-3.c
task-reduction-4.c
task-reduction-5.c
task-reduction-6.c
task-reduction-7.c
task-reduction-8.c
task-reduction-9.c
task-reduction-11.c
task-reduction-12.c
task-reduction-13.c
task-reduction-14.c
task-reduction-15.c
task-reduction-16.c
taskgroup-1.c
taskloop-1.c
taskloop-2.c
taskloop-3.c
taskloop-4.c
taskloop-5.c
taskloop-reduction-1.c
taskloop-reduction-2.c
taskloop-reduction-3.c
taskloop-reduction-4.c
taskwait-depend-1.c
taskwait-depend-nowait-1.c openmp: Add taskwait nowait depend support [PR105378] 2022-05-24 09:12:44 +02:00
taskwait-depend-nowait-2.c libgomp: Fix occassional hangs with taskwait nowait depend 2022-05-25 11:10:41 +02:00
teams-1.c openmp: Add support for 2 argument num_teams clause 2021-11-11 09:42:47 +01:00
teams-2.c openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
thread-limit-1.c openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
udr-1.c
unmap-infinity-2.c
variable-not-offloaded.c