From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1147) id 3E984385841A; Fri, 16 Feb 2024 08:48:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E984385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708073295; bh=T3v/WTD4YEa8lPbzxVk+zqDEFGP1MR+uvxaHPNUnPsA=; h=From:To:Subject:Date:From; b=kbH4m6v0aF9ldRFgdic+VmplveVGzWCSX+7jF9RFaNQRyw+wZ98DOpJiNWbtzYWL6 5kzBr8DFCTOfonZcvzylRGr/fcxuC1rAud5DjjlqLroBCiaqM6MJ9ghwJMohjk8ydD Ql8K78Q9BnfZRybuf5z4R3yQeaCzGlqxxIhXdfsE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Rainer Orth To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-9024] testsuite: Require lto-plugin support in gcc.dg/lto/modref-3 etc. [PR98237] X-Act-Checkin: gcc X-Git-Author: Rainer Orth X-Git-Refname: refs/heads/master X-Git-Oldrev: 7af0f1e107a480fbfe882cb985603960114aefb5 X-Git-Newrev: de658585d6dcc89f1cba71ef5f8f5b55719a7054 Message-Id: <20240216084815.3E984385841A@sourceware.org> Date: Fri, 16 Feb 2024 08:48:15 +0000 (GMT) List-Id: https://gcc.gnu.org/g:de658585d6dcc89f1cba71ef5f8f5b55719a7054 commit r14-9024-gde658585d6dcc89f1cba71ef5f8f5b55719a7054 Author: Rainer Orth Date: Fri Feb 16 09:47:35 2024 +0100 testsuite: Require lto-plugin support in gcc.dg/lto/modref-3 etc. [PR98237] gcc.dg/lto/modref-3 etc. FAIL on Solaris with the native linker: FAIL: gcc-dg-lto-modref-3-01.exe scan-wpa-ipa-dump modref "parm 1 flags: no_direct_clobber no_direct_escape" FAIL: gcc-dg-lto-modref-4-01.exe scan-wpa-ipa-dump modref "parm 1 flags: no_direct_clobber no_direct_escape" FAIL: gcc.dg/lto/modref-3 c_lto_modref-3_0.o-c_lto_modref-3_1.o execute -O2 -flto-partition=max -fdump-ipa-modref -fno-ipa-sra -fno-ipa-cp -flto FAIL: gcc.dg/lto/modref-4 c_lto_modref-4_0.o-c_lto_modref-4_1.o execute -O2 -flto-partition=max -fdump-ipa-modref -fno-ipa-sra -flto The issue is that the tests require the linker plugin, which isn't available with Solaris ld. Thus, it also FAILs when gcc is configured with --disable-lto-plugin. This patch thus declares the requirement. As it turns out, there's an undocumented dg-require-linker-plugin already, but I introduce and use the corresponding effective-target keyword and document both. Given that the effective-target form is more flexible, I'm tempted to remove dg-require-* with an empty arg as already mentioned in sourcebuild.texi. That is not this patch, however. Tested on i386-pc-solaris2.11 with ld and gld. 2024-02-14 Rainer Orth gcc/testsuite: PR ipa/98237 * lib/target-supports.exp (is-effective-target): Handle linker_plugin. * gcc.dg/lto/modref-3_0.c: Require linker_plugin support. * gcc.dg/lto/modref-4_0.c: Likewise. gcc: * doc/sourcebuild.texi (Effective-Target Keywords, Other attribugs): Document linker_plugin. (Require Support): Document dg-require-linker-plugin. Diff: --- gcc/doc/sourcebuild.texi | 7 +++++++ gcc/testsuite/gcc.dg/lto/modref-3_0.c | 1 + gcc/testsuite/gcc.dg/lto/modref-4_0.c | 1 + gcc/testsuite/lib/target-supports.exp | 1 + 4 files changed, 10 insertions(+) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 193be19767fe..c431956a5933 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -3009,6 +3009,9 @@ Target supports @option{-mpe-aligned-commons}. @item pie Target supports @option{-pie}, @option{-fpie} and @option{-fPIE}. +@item linker_plugin +Target supports the linker plugin. + @item rdynamic Target supports @option{-rdynamic}. @@ -3337,6 +3340,10 @@ system. Some tests are incompatible with DejaGnu's handling of remote hosts, which involves copying the source file to the host and compiling it with a relative path and "@code{-o a.out}". +@item dg-require-linker-plugin "" +Skip the test is the target does not support the linker plugin. +This is equivalent to @code{dg-require-effective-target linker_plugin}. + @item dg-require-mkfifo "" Skip the test if the target does not support @code{mkfifo}. diff --git a/gcc/testsuite/gcc.dg/lto/modref-3_0.c b/gcc/testsuite/gcc.dg/lto/modref-3_0.c index 0210d1151114..3f5354aaa48a 100644 --- a/gcc/testsuite/gcc.dg/lto/modref-3_0.c +++ b/gcc/testsuite/gcc.dg/lto/modref-3_0.c @@ -1,5 +1,6 @@ /* { dg-lto-do run } */ /* { dg-lto-options { {-O2 -flto-partition=max -fdump-ipa-modref -fno-ipa-sra -fno-ipa-cp -flto} } } */ +/* { dg-require-effective-target linker_plugin } */ extern void copy (int *a, int *b); extern void barrier (); extern int *ptr; diff --git a/gcc/testsuite/gcc.dg/lto/modref-4_0.c b/gcc/testsuite/gcc.dg/lto/modref-4_0.c index 943758511462..3e837b66ce05 100644 --- a/gcc/testsuite/gcc.dg/lto/modref-4_0.c +++ b/gcc/testsuite/gcc.dg/lto/modref-4_0.c @@ -1,5 +1,6 @@ /* { dg-lto-do run } */ /* { dg-lto-options { {-O2 -flto-partition=max -fdump-ipa-modref -fno-ipa-sra -flto} } } */ +/* { dg-require-effective-target linker_plugin } */ extern void copy (int *a, int *b); extern void barrier (); extern int *ptr; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 645759496b7b..82c73faf7d89 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -9914,6 +9914,7 @@ proc is-effective-target { arg } { "htm_hw" { set selected [check_htm_hw_available] } "named_sections" { set selected [check_named_sections_available] } "gc_sections" { set selected [check_gc_sections_available] } + "linker_plugin" { set selected [check_linker_plugin_available] } "cxa_atexit" { set selected [check_cxa_atexit_available] } default { error "unknown effective target keyword `$arg'" } }