From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id C4E423858283 for ; Wed, 28 Sep 2022 13:50:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C4E423858283 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,352,1654588800"; d="scan'208";a="83771301" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 28 Sep 2022 05:50:10 -0800 IronPort-SDR: KX3WKJ452lzvPgp+Gc4JukMe/ee1U/rVti/FdBSMXGXy1XQF6P89TL+mu0bdmt7tJ/J6mBuqQh uC9cO+Smd9MBM6DiUiy/2WmnD6BuszirxKt2kbxtzRSZ42TSeQGB8SmxFhLdL7FlMfOXmZT7Rg dbq0NO9qavB9xwQhFG3gpdJvgRGE+vSW8zGwT8BNqjTFQ6CLMePAKRxl+2YYtsVyUl0NVFTroS gsb8RQoyXQNErUi0j9un+blbUNWI33plTbEVf2hWc4vlGxWLYqW62goE7dhsdQXcNAmXPbTaCy xqo= From: Thomas Schwinge To: Tom de Vries , CC: Segher Boessenkool , Peter Bergner , Kewen Lin Subject: DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases In-Reply-To: References: <87r18jt7uu.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Wed, 28 Sep 2022 15:50:00 +0200 Message-ID: <871qrvlibb.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc 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" wrote: >>> while iterating over dimensions { -mptx=3D3.1 , -mptx=3D6.3 } x { GOMP_= NVPTX_JIT=3D-O0, }. >> >> Do you use separate (nvptx-none offload target only?) builds for >> different '-mptx' variants (likewise: '-misa'), or have you hacked up th= e >> multilib configuration? > > Neither, I'm using --target_board=3Dunix/foffload=3D 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 (): $ make check RUNTESTFLAGS=3D'--target_board=3DBOARD' That generally works as expected. But now suppose that 'BOARD' needs '-mptx=3D3.1', because old CUDA, for example. Running the obvious '--target_board=3DBOARD/-mptx=3D3.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 sup= ported in this configuration That's because we then invoke GCC as follows: [GCC] [...]/gcc.target/nvptx/alias-1.c [...] -malias -mptx=3D6.3 [...] = -mptx=3D3.1 -o ./alias-1.exe Here, '-malias -mptx=3D6.3' are due to 'dg-add-options ptx_alias' in the test case, but our '-mptx=3D3.1' overrides that, thus FAIL. I think these would work if the '-mptx=3D3.1' came first? Do we need something like this: gcc/config/rs6000/rs6000.h:/* Only for use in the testsuite: -mdejagnu-= cpu=3D filters out all gcc/config/rs6000/rs6000.h- -mcpu=3D as well as -mtune=3D options the= n simply adds -mcpu=3D, gcc/config/rs6000/rs6000.h: while -mdejagnu-tune=3D filters ou= t all -mtune=3D options then gcc/config/rs6000/rs6000.h- simply adds -mtune=3D. gcc/config/rs6000/rs6000.h- With older versions of Dejagnu the comman= d line arguments you set in gcc/config/rs6000/rs6000.h- RUNTESTFLAGS override those set in the te= stcases; 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=3D*: % does not affect the -m assembler option)" - commit 75d20d6c84c12bedd65a904e462f02f0b9eb3f77 "rs6000: Adjust -mdejag= nu-cpu to filter out -mtune [PR106345]" (For example, we'd then use '-mdejagnu-ptx=3D[...]' in the test case (here,= via 'dg-add-options ptx_alias'), overriding the '-mptx=3D3.1' of 'RUNTESTFLAGS'= .) Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955