diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2022-07-07 15:11:03 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2022-07-08 08:53:58 +0200 |
commit | faa0c328ee65f0d6d65d6e20181d26e336071919 (patch) | |
tree | 7a3b18b3b057863c05ee37c215abb14fd3d302db /libgomp | |
parent | 13f44099bcc64ddb50a6dbd462bf79b258dfd02c (diff) | |
download | gcc-faa0c328ee65f0d6d65d6e20181d26e336071919.zip gcc-faa0c328ee65f0d6d65d6e20181d26e336071919.tar.gz gcc-faa0c328ee65f0d6d65d6e20181d26e336071919.tar.bz2 |
Fix one issue in OpenMP 'requires' directive diagnostics
Fix-up for recent commit 683f11843974f0bdf42f79cdcbb0c2b43c7b81b0
"OpenMP: Move omp requires checks to libgomp".
gcc/
* lto-cgraph.cc (input_offload_tables) <LTO_symtab_edge>: Correct
'fn2' computation.
libgomp/
* testsuite/libgomp.c-c++-common/requires-1.c: Add 'dg-note's.
* testsuite/libgomp.c-c++-common/requires-2.c: Likewise.
* 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.
Diffstat (limited to 'libgomp')
5 files changed, 26 insertions, 4 deletions
diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-1.c b/libgomp/testsuite/libgomp.c-c++-common/requires-1.c index ab9a8dd..31996f1 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-1.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-1.c @@ -20,5 +20,7 @@ main (void) return 0; } -/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } */ +/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } + { dg-note {requires-1\.c' has 'unified_shared_memory'} {} { target *-*-* } 0 } + { dg-note {requires-1-aux\.c' has 'unified_address'} {} { target *-*-* } 0 } */ /* { dg-excess-errors "Ignore messages like: errors during merging of translation units|mkoffload returned 1 exit status" } */ diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-2.c b/libgomp/testsuite/libgomp.c-c++-common/requires-2.c index be1830d..b20e154 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-2.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-2.c @@ -21,5 +21,7 @@ main (void) return 0; } -/* { dg-error "OpenMP 'requires' directive with 'unified_shared_memory' specified only in some compilation units" "" { target *-*-* } 0 } */ +/* { dg-error "OpenMP 'requires' directive with 'unified_shared_memory' specified only in some compilation units" "" { target *-*-* } 0 } + { dg-note {requires-2\.c' has 'unified_shared_memory'} {} { target *-*-* } 0 } + { dg-note {but '[^']*requires-2-aux\.c' has not} {} { target *-*-* } 0 } */ /* { dg-excess-errors "Ignore messages like: errors during merging of translation units|mkoffload returned 1 exit status" } */ diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-3.c b/libgomp/testsuite/libgomp.c-c++-common/requires-3.c index 1c204c8a..a549a19 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-3.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-3.c @@ -20,5 +20,7 @@ main (void) return 0; } -/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_address, unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } */ +/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_address, unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } + { dg-note {requires-3\.c' has 'unified_address, unified_shared_memory'} {} { target *-*-* } 0 } + { dg-note {requires-3-aux\.c' has 'unified_address'} {} { target *-*-* } 0 } */ /* { dg-excess-errors "Ignore messages like: errors during merging of translation units|mkoffload returned 1 exit status" } */ diff --git a/libgomp/testsuite/libgomp.c-c++-common/requires-7.c b/libgomp/testsuite/libgomp.c-c++-common/requires-7.c index 7473aa6..63afcc9 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/requires-7.c +++ b/libgomp/testsuite/libgomp.c-c++-common/requires-7.c @@ -20,5 +20,13 @@ main (void) return 0; } -/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } */ +/* { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } + { dg-note {requires-7\.c' has 'unified_shared_memory'} {} { target *-*-* } 0 } + TODO We're currently not streaming location information for the OpenMP + directives used in 'requires-7-aux.c', so we're not seeing the source file + name here (but a temporary '*.o' instead; for details, see + <https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598011.html>): + { dg-note {requires-7-aux\.c' has 'unified_address'} {} { xfail *-*-* } 0 } + ..., but we may still verify that the rest of the diagnostic is correct: + { dg-note {' has 'unified_address'} {} { target *-*-* } 0 } */ /* { dg-excess-errors "Ignore messages like: errors during merging of translation units|mkoffload returned 1 exit status" } */ diff --git a/libgomp/testsuite/libgomp.fortran/requires-1.f90 b/libgomp/testsuite/libgomp.fortran/requires-1.f90 index e957b1b..9a0c334 100644 --- a/libgomp/testsuite/libgomp.fortran/requires-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/requires-1.f90 @@ -23,4 +23,12 @@ program main end ! { dg-error "OpenMP 'requires' directive with non-identical clauses in multiple compilation units: 'unified_shared_memory' vs. 'unified_address'" "" { target *-*-* } 0 } +! { dg-note {requires-1\.f90' has 'unified_shared_memory'} {} { target *-*-* } 0 } +! TODO We're currently not streaming location information for the OpenMP +! directives used in 'requires-7-aux.c', so we're not seeing the source file +! name here (but a temporary '*.o' instead; for details, see +! <https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598011.html>): +! { dg-note {requires-1-aux\.f90' has 'unified_address'} {} { xfail *-*-* } 0 } +! ..., but we may still verify that the rest of the diagnostic is correct: +! { dg-note {' has 'unified_address'} {} { target *-*-* } 0 } ! { dg-excess-errors "Ignore messages like: errors during merging of translation units|mkoffload returned 1 exit status" } |