nvptx: Enhance '-mptx=[...]' test cases

This expands upon the test cases added in
commit a2eacdbd4c
"[nvptx] Add __PTX_ISA_VERSION_{MAJOR,MINOR}__".

	gcc/testsuite/
	* gcc.target/nvptx/ptx31.c: Remove; expanded into...
	* gcc.target/nvptx/mptx=3.1.c: ... this.
	* gcc.target/nvptx/ptx60.c: Remove; expanded into...
	* gcc.target/nvptx/mptx=6.0.c: ... this.
	* gcc.target/nvptx/ptx63.c: Remove; expanded into...
	* gcc.target/nvptx/mptx=6.3.c: ... this.
	* gcc.target/nvptx/ptx70.c: Remove; expanded into...
	* gcc.target/nvptx/mptx=7.0.c: ... this.
	* gcc.target/nvptx/mptx=_.c: New.
This commit is contained in:
Thomas Schwinge 2024-11-10 20:01:58 +01:00
parent ecfc0e0737
commit b7abc7cabd
9 changed files with 95 additions and 40 deletions

View file

@ -0,0 +1,19 @@
/* { dg-do assemble } */
/* { dg-options {-march=sm_30 -mptx=3.1} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 3\.1$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 3
#error wrong value for __PTX_ISA_VERSION_MAJOR__
#endif
#if __PTX_ISA_VERSION_MINOR__ != 1
#error wrong value for __PTX_ISA_VERSION_MINOR__
#endif
#if __PTX_SM__ != 300
#error wrong value for __PTX_SM__
#endif
int dummy;

View file

@ -0,0 +1,19 @@
/* { dg-do assemble } */
/* { dg-options {-march=sm_30 -mptx=6.0} } */
/* { 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;

View file

@ -0,0 +1,19 @@
/* { dg-do assemble } */
/* { dg-options {-march=sm_30 -mptx=6.3} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 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__ != 3
#error wrong value for __PTX_ISA_VERSION_MINOR__
#endif
#if __PTX_SM__ != 300
#error wrong value for __PTX_SM__
#endif
int dummy;

View file

@ -0,0 +1,19 @@
/* { dg-do assemble } */
/* { dg-options {-march=sm_30 -mptx=7.0} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 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__ != 300
#error wrong value for __PTX_SM__
#endif
int dummy;

View file

@ -0,0 +1,19 @@
/* { dg-do assemble } */
/* { dg-options {-mptx=3.1 -march=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;

View file

@ -1,10 +0,0 @@
/* { dg-do compile } */
/* { dg-options "-march=sm_30 -mptx=3.1" } */
#if __PTX_ISA_VERSION_MAJOR__ != 3
#error wrong value for __PTX_ISA_VERSION_MAJOR__
#endif
#if __PTX_ISA_VERSION_MINOR__ != 1
#error wrong value for __PTX_ISA_VERSION_MINOR__
#endif

View file

@ -1,10 +0,0 @@
/* { dg-do compile } */
/* { dg-options "-march=sm_30 -mptx=6.0" } */
#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

View file

@ -1,10 +0,0 @@
/* { dg-do compile } */
/* { dg-options "-march=sm_30 -mptx=6.3" } */
#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

View file

@ -1,10 +0,0 @@
/* { dg-do compile } */
/* { dg-options "-march=sm_30 -mptx=7.0" } */
#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