From: Patrick O'Neill <patrick@rivosinc.com>
To: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches@gcc.gnu.org
Cc: gnu-toolchain@rivosinc.com
Subject: Re: [PATCH] g++: Add require-effective-target to multi-input file testcase pr95401.cc
Date: Fri, 10 Nov 2023 10:00:15 -0800 [thread overview]
Message-ID: <7e78cd70-70c9-41b1-8a98-6977a103429e@rivosinc.com> (raw)
In-Reply-To: <b7a727e4-be87-4b4f-91da-80ee3801b95c@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]
On 11/9/23 17:34, Jeff Law wrote:
>
>
> On 11/3/23 00:18, Patrick O'Neill wrote:
>> On non-vector targets dejagnu attempts dg-do compile for pr95401.cc.
>> This produces a command like this:
>> g++ pr95401.cc pr95401a.cc -S -o pr95401.s
>>
>> which isn't valid (gcc does not accept multiple input files when using
>> -S with -o).
>>
>> This patch adds require-effective-target vect_int to avoid the case
>> where the testcase is invoked with dg-do compile.
>>
>> gcc/testsuite/ChangeLog:
>>
>> * g++.dg/vect/pr95401.cc: Add require-effective-target vect_int.
> Sorry, I must be missing something here. I fail to see how adding an
> effective target check would/should impact the problem you've
> described above with the dg-additional-sources interaction with -S.
It's not intuitive (& probably not the cleanest way of solving it).
pr95401.cc is an invalid testcase when run with dg-do compile (for the
reasons above).
pr95401.cc
<https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/g%2B%2B.dg/vect/pr95401.cc;h=6a56dab095722b01d912416352df17f0d91dfd27;hb=HEAD>
does not define a dg-do, which means it uses the testcase uses
dg-do-what-default
<https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/g%2B%2B.dg/vect/vect.exp;h=fc77120a83173c65ad147e8bb7c29ac82f06bb6d;hb=HEAD#l30>
to determine what to do.
dg-do-what-default is set by target-supports.exp
<https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/lib/target-supports.exp;h=1a7bea96c1e4ccb8ef30ac7012c04e8d44c5ad01;hb=HEAD#l11532>.
The two options here are set dg-do-what-default run or compile.
On non-vector targets the pr95401 is set to compile (which is invalid).
Ideally we would say if dg-do-what-default == compile don't run, but
AFAIK that isn't possible.
I didn't want to duplicate the check_vect_support_and_set_flags logic to
return true/false since that'll probably get out of sync.
I used require-effective-target vect_int as a proxy for
check_vect_support_and_set_flags (also since the testcase only contains
integer arrays).
That way we do this now:
dg-do-what-default run -> run
dg-do-what-default compile -> skip test
If there's a cleaner/better approach I'm happy to revise.
Patrick
>
> Jeff
>>
next prev parent reply other threads:[~2023-11-10 18:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 6:18 Patrick O'Neill
2023-11-10 1:34 ` Jeff Law
2023-11-10 18:00 ` Patrick O'Neill [this message]
2023-11-19 4:08 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e78cd70-70c9-41b1-8a98-6977a103429e@rivosinc.com \
--to=patrick@rivosinc.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gnu-toolchain@rivosinc.com \
--cc=jeffreyalaw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).