[nvptx, testsuite] Add gcc.target/nvptx/sm*.c

Add a few test-cases that test passing each -misa=sm_xx version and verify that
the proper __PTX_SM__ is defined.

Tested on nvptx.

gcc/testsuite/ChangeLog:

2022-02-25  Tom de Vries  <tdevries@suse.de>

	* gcc.target/nvptx/sm30.c: New test.
	* gcc.target/nvptx/sm35.c: New test.
	* gcc.target/nvptx/sm53.c: New test.
	* gcc.target/nvptx/sm70.c: New test.
	* gcc.target/nvptx/sm75.c: New test.
	* gcc.target/nvptx/sm80.c: New test.
This commit is contained in:
Tom de Vries 2022-02-25 11:43:55 +01:00
parent 2240ebd8e4
commit 4706670cd3
6 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-misa=sm_30" } */
#if __PTX_SM__ != 300
#error wrong value for __PTX_SM__
#endif

View file

@ -0,0 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-misa=sm_35" } */
#if __PTX_SM__ != 350
#error wrong value for __PTX_SM__
#endif

View file

@ -0,0 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-misa=sm_53" } */
#if __PTX_SM__ != 530
#error wrong value for __PTX_SM__
#endif

View file

@ -0,0 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-misa=sm_70" } */
#if __PTX_SM__ != 700
#error wrong value for __PTX_SM__
#endif

View file

@ -0,0 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-misa=sm_75" } */
#if __PTX_SM__ != 750
#error wrong value for __PTX_SM__
#endif

View file

@ -0,0 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-misa=sm_80" } */
#if __PTX_SM__ != 800
#error wrong value for __PTX_SM__
#endif