OpenMP: Handle 'device_type(host)' on 'target'

When 'device_type(host)' is specified on a target region, no offload code
is generated for the outlined region. Additionally, it is honored for
implicit 'declare target'.

The code is executed as if 'device(omp_initial_device)' were present
(i.e. also no issus with OMP_TARGET_OFFLOAD=mandatory).

gcc/ChangeLog:

	* omp-expand.cc (expand_omp_target): For 'device_type(host)',
	invoke with device(omp_initial_device)'.
	* omp-low.cc (create_omp_child_function): Take host_only
	argument to prevent generating offload code.
	(scan_omp_parallel, scan_omp_task, scan_omp_target, scan_omp_teams,
	lower_omp_target): Update call.
	* omp-offload.cc (omp_discover_declare_target_tgt_fn_r,
	omp_discover_declare_target_fn_r): Do not add implicit 'declare
	target' to target regions with 'device_type(host)'.

libgomp/ChangeLog:

	* libgomp.texi (Implementations status): Mark 'device_type'
	clause on target as implemented.
	* testsuite/libgomp.c/target-device-type-3.c: New test.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/target-device-type-1.c: Remove dg-sorry.
	* gfortran.dg/gomp/target-device-type-1.f90: Likewise.
7 files changed