With target board nvptx-none-run/-mptx=3.1 we run into:
...
cc1: error: PTX version (-mptx) needs to be at least 4.2 to support \
selected -misa (sm_53)^M
compiler exited with status 1
FAIL: gcc.target/nvptx/sm53.c (test for excess errors)
...
Fix this by adding -mptx=_ in sm53.c and similar.
Tested on nvptx.
gcc/testsuite/ChangeLog:
2022-03-03 Tom de Vries <tdevries@suse.de>
* gcc.target/nvptx/sm53.c: Add -mptx=_.
* gcc.target/nvptx/sm70.c: Same.
* gcc.target/nvptx/sm75.c: Same.
* gcc.target/nvptx/sm80.c: Same.
/* { dg-do compile } */
-/* { dg-options "-misa=sm_53" } */
+/* { dg-options "-misa=sm_53 -mptx=_" } */
#if __PTX_SM__ != 530
#error wrong value for __PTX_SM__
/* { dg-do compile } */
-/* { dg-options "-misa=sm_70" } */
+/* { dg-options "-misa=sm_70 -mptx=_" } */
#if __PTX_SM__ != 700
#error wrong value for __PTX_SM__
/* { dg-do compile } */
-/* { dg-options "-misa=sm_75" } */
+/* { dg-options "-misa=sm_75 -mptx=_" } */
#if __PTX_SM__ != 750
#error wrong value for __PTX_SM__
/* { dg-do compile } */
-/* { dg-options "-misa=sm_80" } */
+/* { dg-options "-misa=sm_80 -mptx=_" } */
#if __PTX_SM__ != 800
#error wrong value for __PTX_SM__