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.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-misa=sm_30" } */
+
+#if __PTX_SM__ != 300
+#error wrong value for __PTX_SM__
+#endif
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-misa=sm_35" } */
+
+#if __PTX_SM__ != 350
+#error wrong value for __PTX_SM__
+#endif
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-misa=sm_53" } */
+
+#if __PTX_SM__ != 530
+#error wrong value for __PTX_SM__
+#endif
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-misa=sm_70" } */
+
+#if __PTX_SM__ != 700
+#error wrong value for __PTX_SM__
+#endif
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-misa=sm_75" } */
+
+#if __PTX_SM__ != 750
+#error wrong value for __PTX_SM__
+#endif
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-misa=sm_80" } */
+
+#if __PTX_SM__ != 800
+#error wrong value for __PTX_SM__
+#endif