diff mbox series

[comitted] libgomp/testsuite: ignore blank-line output for function-not-offloaded.c

Message ID 906d7437-154f-1db7-a59a-11916154b9a5@codesourcery.com
State New
Headers show
Series [comitted] libgomp/testsuite: ignore blank-line output for function-not-offloaded.c | expand

Commit Message

Tobias Burnus March 19, 2020, 11:47 a.m. UTC
The libgomp.c-c++-common/function-not-offloaded.c is supposed
to fail on "target offload_device_nonshared_as";
producing "unresolved symbol foo" and tons of additional
(fatal) errors by collect, ld, lto1, mkoffload, lto-wrapper etc.

On NVidia, the existing "dg-excess-errors" works, but
with AMDGCN this is insufficient as one still gets a FAIL
"1 blank line(s) in output"

That's solved by adding "dg-allow-blank-lines-in-output 1".
(I think the argument – or at least its value – is ignored
but "1" is used everywhere.)

This error only appears for C++ as the reason seems to be that
there are two unresolved symbols: "foo" and "__gxx_personality_v0".
Those error messages are separated by an empty line.

Hence, this change could be undone as soon as cc1plus and a minimal
libstdc++ (libsupc++) is available for AMDGCN; however, for the
purpose of the test, the "dg-allow-blank-lines-in-output" can
remain even after __gxx_personality_v0 is available.(*)

Committed as r10-7275-gbb83e069ebadf0a724298f80a65b1775eff9cfab

Cheers,

Tobias
(*) The lack of __gxx_personality_v0 shows also up in the following
tests, i.e. that issue is already covered:
libgomp.c++/for-15.C
libgomp.c++/for-24.C
libgomp.oacc-c++/../libgomp.oacc-c-c++-common/routine-1.c
libgomp.oacc-c++/pr71959.C
libgomp.oacc-c++/routine-1-auto.C
libgomp.oacc-c++/routine-1-template-auto.C
libgomp.oacc-c++/routine-1-template-trailing-return-type.C
libgomp.oacc-c++/routine-1-template.C
libgomp.oacc-c++/routine-1-trailing-return-type.C

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

Comments

Andrew Stubbs March 19, 2020, 11:58 a.m. UTC | #1
On 19/03/2020 11:47, Tobias Burnus wrote:
> This error only appears for C++ as the reason seems to be that
> there are two unresolved symbols: "foo" and "__gxx_personality_v0".
> Those error messages are separated by an empty line.

The blank lines are a feature of using the LLVM linker.  GNU bintils 
doesn't emit blank lines, but LLD does.

The GCC testsuite has a test that turns off blank line checking for 
specific targets (i.e. amdgcn). That test handles both regular and 
offload configurations.

https://gcc.gnu.org/pipermail/gcc-patches/2018-September/506073.html

Possibly libgomp could use the same, but if this is the only case then 
perhaps not.

Andrew
diff mbox series

Patch

commit bb83e069ebadf0a724298f80a65b1775eff9cfab
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Thu Mar 19 11:42:49 2020 +0100

    libgomp/testsuite: ignore blank-line output for function-not-offloaded.c
    
            * testsuite/libgomp.c-c++-common/function-not-offloaded.c: Add
            dg-allow-blank-lines-in-output.

diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 9a1065fef4e..4d3a4f32ece 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@ 
+2020-03-19  Tobias Burnus  <tobias@codesourcery.com>
+
+	* testsuite/libgomp.c-c++-common/function-not-offloaded.c: Add
+	dg-allow-blank-lines-in-output.
+
 2020-03-18  Julian Brown <julian@codesourcery.com>
 	    Tobias Burnus  <tobias@codesourcery.com>
 
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 9e59ef8864e..f01a64e72c0 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c
@@ -1,5 +1,6 @@ 
 /* { dg-do link } */
 /* { dg-excess-errors "unresolved symbol foo, lto1, mkoffload and lto-wrapper fatal errors" { target offload_device_nonshared_as } } */
+/* { dg-allow-blank-lines-in-output 1 } */
 /* { dg-additional-sources "function-not-offloaded-aux.c" } */
 
 #pragma omp declare target