https://gcc.gnu.org/g:77654b0513b21d21b9305d9ce0135d4c3dff4aca

commit 77654b0513b21d21b9305d9ce0135d4c3dff4aca
Author: Thomas Schwinge <tschwi...@baylibre.com>
Date:   Sun Nov 10 20:01:58 2024 +0100

    nvptx: Enhance '-mptx=[...]' test cases
    
    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.
    
    (cherry picked from commit b7abc7cabdbcc889a74cde1cdc1ffb27cf965128)

Diff:
---
 gcc/testsuite/ChangeLog.omp               | 13 +++++++++++++
 gcc/testsuite/gcc.target/nvptx/mptx=3.1.c | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/nvptx/mptx=6.0.c | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/nvptx/mptx=6.3.c | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/nvptx/mptx=7.0.c | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/nvptx/mptx=_.c   | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/nvptx/ptx31.c    | 10 ----------
 gcc/testsuite/gcc.target/nvptx/ptx60.c    | 10 ----------
 gcc/testsuite/gcc.target/nvptx/ptx63.c    | 10 ----------
 gcc/testsuite/gcc.target/nvptx/ptx70.c    | 10 ----------
 10 files changed, 108 insertions(+), 40 deletions(-)

diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index 3430e6d3a8c1..aa20fdd51f14 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -1,5 +1,18 @@
 2024-12-18  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       Backported from trunk:
+       2024-12-06  Thomas Schwinge  <tschwi...@baylibre.com>
+
+       * 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.
+
        Backported from trunk:
        2024-09-05  Thomas Schwinge  <tschwi...@baylibre.com>
 
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
index 000000000000..30e244761ac7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mptx=3.1.c
@@ -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
index 000000000000..6877438fe653
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mptx=6.0.c
@@ -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
index 000000000000..e997840eabd0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mptx=6.3.c
@@ -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
index 000000000000..c14c03e21866
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mptx=7.0.c
@@ -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
index 000000000000..dcff462ba0cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/mptx=_.c
@@ -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
index 46b5e1ba4054..000000000000
--- a/gcc/testsuite/gcc.target/nvptx/ptx31.c
+++ /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
index 267a9c64f1e9..000000000000
--- a/gcc/testsuite/gcc.target/nvptx/ptx60.c
+++ /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
index 13d02e132aea..000000000000
--- a/gcc/testsuite/gcc.target/nvptx/ptx63.c
+++ /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
index 15df13604bd6..000000000000
--- a/gcc/testsuite/gcc.target/nvptx/ptx70.c
+++ /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

Reply via email to