This expands upon the one test case added in
commit
de0ef04419e90eacf0d1ddb265552a1b08c18d4b "[nvptx] Add march-map".
gcc/testsuite/
* gcc.target/nvptx/march-map.c: Remove; expanded into...
* gcc.target/nvptx/march-map=sm_50.c: ... this.
* gcc.target/nvptx/march-map=sm_30.c: New.
* gcc.target/nvptx/march-map=sm_32.c: Likewise.
* gcc.target/nvptx/march-map=sm_35.c: Likewise.
* gcc.target/nvptx/march-map=sm_37.c: Likewise.
* gcc.target/nvptx/march-map=sm_52.c: Likewise.
* gcc.target/nvptx/march-map=sm_53.c: Likewise.
* gcc.target/nvptx/march-map=sm_60.c: Likewise.
* gcc.target/nvptx/march-map=sm_61.c: Likewise.
* gcc.target/nvptx/march-map=sm_62.c: Likewise.
* gcc.target/nvptx/march-map=sm_70.c: Likewise.
* gcc.target/nvptx/march-map=sm_72.c: Likewise.
* gcc.target/nvptx/march-map=sm_75.c: Likewise.
* gcc.target/nvptx/march-map=sm_80.c: Likewise.
* gcc.target/nvptx/march-map=sm_86.c: Likewise.
* gcc.target/nvptx/march-map=sm_87.c: Likewise.
* gcc.target/nvptx/march-map=sm_89.c: Likewise.
* gcc.target/nvptx/march-map=sm_90.c: Likewise.
* gcc.target/nvptx/march-map=sm_90a.c: Likewise.
* gcc.target/nvptx/main.c: Remove.
+++ /dev/null
-/* { dg-do link } */
-
-int
-main (void)
-{
- return 0;
-}
+++ /dev/null
-/* { dg-options "-march-map=sm_50" } */
-
-#include "main.c"
-
-/* { dg-final { scan-assembler-times "\\.target\tsm_35" 1 } } */
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_30 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 300
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_32 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 300
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_35 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_35$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 350
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_37 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_35$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 350
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_50 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_35$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 350
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_52 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_35$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 350
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_53 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_53$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 530
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_60 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_53$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 530
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_61 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_53$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 530
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_62 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_53$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 530
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_70 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_70$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 700
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_72 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_70$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 700
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_75 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_75$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 6
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 3
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 750
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_80 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_80$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_86 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_80$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_87 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_80$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_89 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_80$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_90 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_80$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march-map=sm_90a -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_80$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 0
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;