From 9ef714539cb7cc1cd746312fd5dcc987bf167471 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 5 Jul 2022 12:21:33 +0200 Subject: Fix Intel MIC 'mkoffload' for OpenMP 'requires' Similar to how the other 'mkoffload's got changed in recent commit 683f11843974f0bdf42f79cdcbb0c2b43c7b81b0 "OpenMP: Move omp requires checks to libgomp". This also means finally switching Intel MIC 'mkoffload' to 'GOMP_offload_register_ver', 'GOMP_offload_unregister_ver', making 'GOMP_offload_register', 'GOMP_offload_unregister' legacy entry points. gcc/ * config/i386/intelmic-mkoffload.cc (generate_host_descr_file) (prepare_target_image, main): Handle OpenMP 'requires'. (generate_host_descr_file): Switch to 'GOMP_offload_register_ver', 'GOMP_offload_unregister_ver'. libgomp/ * target.c (GOMP_offload_register, GOMP_offload_unregister): Denote as legacy entry points. * testsuite/lib/libgomp.exp (check_effective_target_offload_target_any): New proc. * testsuite/libgomp.c-c++-common/requires-1.c: Enable for 'offload_target_any'. * testsuite/libgomp.c-c++-common/requires-3.c: Likewise. * testsuite/libgomp.c-c++-common/requires-7.c: Likewise. * testsuite/libgomp.fortran/requires-1.f90: Likewise. --- libgomp/target.c | 4 ++++ libgomp/testsuite/lib/libgomp.exp | 5 +++++ libgomp/testsuite/libgomp.c-c++-common/requires-1.c | 2 +- libgomp/testsuite/libgomp.c-c++-common/requires-3.c | 2 +- libgomp/testsuite/libgomp.c-c++-common/requires-7.c | 2 +- libgomp/testsuite/libgomp.fortran/requires-1.f90 | 2 +- 6 files changed, 13 insertions(+), 4 deletions(-) (limited to 'libgomp') diff --git a/libgomp/target.c b/libgomp/target.c index c66c61b..86f9d30 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -2410,6 +2410,8 @@ GOMP_offload_register_ver (unsigned version, const void *host_table, gomp_mutex_unlock (®ister_lock); } +/* Legacy entry point. */ + void GOMP_offload_register (const void *host_table, int target_type, const void *target_data) @@ -2462,6 +2464,8 @@ GOMP_offload_unregister_ver (unsigned version, const void *host_table, gomp_mutex_unlock (®ister_lock); } +/* Legacy entry point. */ + void GOMP_offload_unregister (const void *host_table, int target_type, const void *target_data) diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 891f909..107a3c2 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -348,6 +348,11 @@ proc libgomp_check_effective_target_offload_target { target_name } { return 0 } +# Return 1 if compiling for any offload target. +proc check_effective_target_offload_target_any { } { + return [libgomp_check_effective_target_offload_target ""] +} + # Return 1 if compiling for offload target nvptx. proc check_effective_target_offload_target_nvptx { } { return [libgomp_check_effective_target_offload_target "nvptx"] diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-1.c b/libgomp/testsuite/libgomp.c-c++-common/requires-1.c index fedf977..ab9a8dd 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-1.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-1.c @@ -1,4 +1,4 @@ -/* { dg-do link { target { offload_target_nvptx || offload_target_amdgcn } } } */ +/* { dg-do link { target offload_target_any } } */ /* { dg-additional-sources requires-1-aux.c } */ /* Check diagnostic by device-compiler's lto1. diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-3.c b/libgomp/testsuite/libgomp.c-c++-common/requires-3.c index 7091f40..1c204c8a 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-3.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-3.c @@ -1,4 +1,4 @@ -/* { dg-do link { target { offload_target_nvptx || offload_target_amdgcn } } } */ +/* { dg-do link { target offload_target_any } } */ /* { dg-additional-sources requires-3-aux.c } */ /* Check diagnostic by device-compiler's lto1. diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-7.c b/libgomp/testsuite/libgomp.c-c++-common/requires-7.c index c94a4c1..7473aa6 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-7.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-7.c @@ -1,4 +1,4 @@ -/* { dg-do link { target { offload_target_nvptx || offload_target_amdgcn } } } */ +/* { dg-do link { target offload_target_any } } */ /* { dg-additional-sources requires-7-aux.c } */ /* Check diagnostic by device-compiler's lto1. diff --git a/libgomp/testsuite/libgomp.fortran/requires-1.f90 b/libgomp/testsuite/libgomp.fortran/requires-1.f90 index 33741af..e957b1b 100644 --- a/libgomp/testsuite/libgomp.fortran/requires-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/requires-1.f90 @@ -1,4 +1,4 @@ -! { dg-do link { target { offload_target_nvptx || offload_target_amdgcn } } } +! { dg-do link { target offload_target_any } } ! { dg-additional-sources requires-1-aux.f90 } ! Check diagnostic by device-compiler's lto1. -- cgit v1.1