]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Enhance '-mptx=[...]' test cases
authorThomas Schwinge <tschwinge@baylibre.com>
Sun, 10 Nov 2024 19:01:58 +0000 (20:01 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Fri, 6 Dec 2024 10:32:00 +0000 (11:32 +0100)
This expands upon the test cases added in
commit a2eacdbd4c4a698b3b6f27ef5e1f8dd3d836b2e5
"[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.

gcc/testsuite/gcc.target/nvptx/mptx=3.1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/mptx=6.0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/mptx=6.3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/mptx=7.0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/mptx=_.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/ptx31.c [deleted file]
gcc/testsuite/gcc.target/nvptx/ptx60.c [deleted file]
gcc/testsuite/gcc.target/nvptx/ptx63.c [deleted file]
gcc/testsuite/gcc.target/nvptx/ptx70.c [deleted file]

diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=3.1.c b/gcc/testsuite/gcc.target/nvptx/mptx=3.1.c
new file mode 100644 (file)
index 0000000..30e2447
--- /dev/null
@@ -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;
diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=6.0.c b/gcc/testsuite/gcc.target/nvptx/mptx=6.0.c
new file mode 100644 (file)
index 0000000..6877438
--- /dev/null
@@ -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;
diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=6.3.c b/gcc/testsuite/gcc.target/nvptx/mptx=6.3.c
new file mode 100644 (file)
index 0000000..e997840
--- /dev/null
@@ -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;
diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=7.0.c b/gcc/testsuite/gcc.target/nvptx/mptx=7.0.c
new file mode 100644 (file)
index 0000000..c14c03e
--- /dev/null
@@ -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;
diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=_.c b/gcc/testsuite/gcc.target/nvptx/mptx=_.c
new file mode 100644 (file)
index 0000000..dcff462
--- /dev/null
@@ -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;
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx31.c b/gcc/testsuite/gcc.target/nvptx/ptx31.c
deleted file mode 100644 (file)
index 46b5e1b..0000000
+++ /dev/null
@@ -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
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx60.c b/gcc/testsuite/gcc.target/nvptx/ptx60.c
deleted file mode 100644 (file)
index 267a9c6..0000000
+++ /dev/null
@@ -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
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx63.c b/gcc/testsuite/gcc.target/nvptx/ptx63.c
deleted file mode 100644 (file)
index 13d02e1..0000000
+++ /dev/null
@@ -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
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx70.c b/gcc/testsuite/gcc.target/nvptx/ptx70.c
deleted file mode 100644 (file)
index 15df136..0000000
+++ /dev/null
@@ -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