public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Tom de Vries <tdevries@suse.de>, <gcc@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	Peter Bergner <bergner@linux.ibm.com>,
	Kewen Lin <linkw@linux.ibm.com>
Subject: DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases
Date: Wed, 28 Sep 2022 15:50:00 +0200	[thread overview]
Message-ID: <871qrvlibb.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <cc77f4ed-fdb6-7536-a0ba-8802eb231bcc@suse.de>

Hi!

On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc <gcc@gcc.gnu.org> wrote:
> On 2/4/22 08:21, Thomas Schwinge wrote:
>> On 2022-02-03T13:35:55+0000, "vries at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> wrote:
>>> while iterating over dimensions { -mptx=3.1 , -mptx=6.3 } x { GOMP_NVPTX_JIT=-O0, <default> }.
>>
>> Do you use separate (nvptx-none offload target only?) builds for
>> different '-mptx' variants (likewise: '-misa'), or have you hacked up the
>> multilib configuration?
>
> Neither, I'm using --target_board=unix/foffload= for that.

OK, so that's for libgomp nvptx offloading testing.

What about nvptx target testing:
'gcc/testsuite/gcc.target/nvptx/nvptx.exp'.

We have a DejaGnu board file, say 'BOARD', invoking the nvptx-tools
'nvptx-none-run' launcher
(<https://github.com/MentorEmbedded/nvptx-tools/>):

    $ make check RUNTESTFLAGS='--target_board=BOARD'

That generally works as expected.

But now suppose that 'BOARD' needs '-mptx=3.1', because old CUDA, for
example.  Running the obvious '--target_board=BOARD/-mptx=3.1' FAILs in a
number of 'gcc.target/nvptx/nvptx.exp' test cases, for example:

    FAIL: gcc.target/nvptx/alias-1.c (test for excess errors)
    Excess errors:
    [...]/gcc.target/nvptx/alias-1.c:13:6: error: alias definitions not supported in this configuration

That's because we then invoke GCC as follows:

    [GCC] [...]/gcc.target/nvptx/alias-1.c [...] -malias -mptx=6.3 [...] -mptx=3.1 -o ./alias-1.exe

Here, '-malias -mptx=6.3' are due to 'dg-add-options ptx_alias' in the
test case, but our '-mptx=3.1' overrides that, thus FAIL.  I think these
would work if the '-mptx=3.1' came first?

Do we need something like this:

    gcc/config/rs6000/rs6000.h:/* Only for use in the testsuite: -mdejagnu-cpu=<value> filters out all
    gcc/config/rs6000/rs6000.h-   -mcpu= as well as -mtune= options then simply adds -mcpu=<value>,
    gcc/config/rs6000/rs6000.h:   while -mdejagnu-tune=<value> filters out all -mtune= options then
    gcc/config/rs6000/rs6000.h-   simply adds -mtune=<value>.
    gcc/config/rs6000/rs6000.h-   With older versions of Dejagnu the command line arguments you set in
    gcc/config/rs6000/rs6000.h-   RUNTESTFLAGS override those set in the testcases; with these options,
    gcc/config/rs6000/rs6000.h-   the testcase will always win.  */
    gcc/config/rs6000/rs6000.h-#define DRIVER_SELF_SPECS \
    gcc/config/rs6000/rs6000.h:  "%{mdejagnu-cpu=*: %<mcpu=* %<mtune=* -mcpu=%*}", \
    gcc/config/rs6000/rs6000.h:  "%{mdejagnu-tune=*: %<mtune=* -mtune=%*}", \
    gcc/config/rs6000/rs6000.h:  "%{mdejagnu-*: %<mdejagnu-*}", \
    gcc/config/rs6000/rs6000.h-   SUBTARGET_DRIVER_SELF_SPECS

History:

  - commit 75e2b35dd0456a148805eae3e7c0e55c6336c263 "rs6000: Add -mdejagnu-cpu="
  - commit 98ae96d2ade339df1a2d3a46e6a7faa60aece139 "re PR target/91050 (-mdejagnu-cpu=<cpu> does not affect the -m<cpu> assembler option)"
  - commit 75d20d6c84c12bedd65a904e462f02f0b9eb3f77 "rs6000: Adjust -mdejagnu-cpu to filter out -mtune [PR106345]"

(For example, we'd then use '-mdejagnu-ptx=[...]' in the test case (here, via
'dg-add-options ptx_alias'), overriding the '-mptx=3.1' of 'RUNTESTFLAGS'.)


Grüße
 Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  parent reply	other threads:[~2022-09-28 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-104364-4@http.gcc.gnu.org/bugzilla/>
     [not found] ` <bug-104364-4-ILKfZXTaRC@http.gcc.gnu.org/bugzilla/>
2022-02-04  7:21   ` nvptx multilib setup (was: [Bug target/104364] [12 Regression] OpenMP/nvptx regressions after "[nvptx] Add some support for .local atomics") Thomas Schwinge
2022-02-04 12:09     ` Tom de Vries
2022-05-13 14:20       ` nvptx multilib setup Thomas Schwinge
2022-09-28 13:50       ` Thomas Schwinge [this message]
2022-09-28 14:12         ` DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases Jonathan Wakely
2022-09-28 15:39           ` Segher Boessenkool
2022-09-29  8:18             ` Thomas Schwinge

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=871qrvlibb.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=bergner@linux.ibm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=segher@kernel.crashing.org \
    --cc=tdevries@suse.de \
    /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).