DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases
Thomas Schwinge
thomas@codesourcery.com
Wed Sep 28 13:50:00 GMT 2022
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
More information about the Gcc
mailing list