https://gcc.gnu.org/g:3c601e482c713b4dcd0096a611b9aeaa27564cad

commit 3c601e482c713b4dcd0096a611b9aeaa27564cad
Author: Thomas Schwinge <tschwi...@baylibre.com>
Date:   Tue Nov 12 08:31:53 2024 +0100

    nvptx: Support '-march=sm_37'
    
            gcc/
            * config/nvptx/nvptx-sm.def: Add '37'.
            * config/nvptx/nvptx-gen.h: Regenerate.
            * config/nvptx/nvptx-gen.opt: Likewise.
            * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
            * config/nvptx/nvptx.opt (-march-map=sm_37, -march-map=sm_50):
            Likewise.
            * config.gcc: Likewise.
            * doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_37'.
            * config/nvptx/gen-multilib-matches-tests: Extend.
            gcc/testsuite/
            * gcc.target/nvptx/march-map=sm_37.c: Adjust.
            * gcc.target/nvptx/march-map=sm_50.c: Likewise.
            * gcc.target/nvptx/march-map=sm_52.c: Likewise.
            * gcc.target/nvptx/march=sm_37.c: New.
            libgomp/
            * testsuite/libgomp.c/declare-variant-3-sm37.c: New.
            * testsuite/libgomp.c/declare-variant-3.h: Adjust.
    
    (cherry picked from commit 7151d885c47ec93ba06f52a4be2a19a706f0750e)

Diff:
---
 gcc/ChangeLog.omp                                  | 13 ++++++
 gcc/config.gcc                                     |  2 +-
 gcc/config/nvptx/gen-multilib-matches-tests        | 50 +++++++++++++++++++---
 gcc/config/nvptx/nvptx-gen.h                       |  1 +
 gcc/config/nvptx/nvptx-gen.opt                     |  3 ++
 gcc/config/nvptx/nvptx-sm.def                      |  1 +
 gcc/config/nvptx/nvptx.cc                          |  2 +
 gcc/config/nvptx/nvptx.opt                         |  6 +--
 gcc/doc/invoke.texi                                |  2 +-
 gcc/testsuite/ChangeLog.omp                        |  8 ++++
 gcc/testsuite/gcc.target/nvptx/march-map=sm_37.c   |  4 +-
 gcc/testsuite/gcc.target/nvptx/march-map=sm_50.c   |  4 +-
 gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c   |  4 +-
 gcc/testsuite/gcc.target/nvptx/march=sm_37.c       | 19 ++++++++
 libgomp/ChangeLog.omp                              |  6 +++
 .../testsuite/libgomp.c/declare-variant-3-sm37.c   |  8 ++++
 libgomp/testsuite/libgomp.c/declare-variant-3.h    |  8 ++++
 17 files changed, 124 insertions(+), 17 deletions(-)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index c85aa341f54f..8b1c23b4f8a7 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -3,6 +3,19 @@
        Backported from trunk:
        2024-12-06  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       * config/nvptx/nvptx-sm.def: Add '37'.
+       * config/nvptx/nvptx-gen.h: Regenerate.
+       * config/nvptx/nvptx-gen.opt: Likewise.
+       * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
+       * config/nvptx/nvptx.opt (-march-map=sm_37, -march-map=sm_50):
+       Likewise.
+       * config.gcc: Likewise.
+       * doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_37'.
+       * config/nvptx/gen-multilib-matches-tests: Extend.
+
+       Backported from trunk:
+       2024-12-06  Thomas Schwinge  <tschwi...@baylibre.com>
+
        * config/nvptx/nvptx-opts.h (enum ptx_version): Add
        'PTX_VERSION_4_1'.
        * config/nvptx/nvptx.cc (ptx_version_to_string)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index e9f776e5cc79..e06c72149c40 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -5608,7 +5608,7 @@ case "${target}" in
                for nvptx_multilib in $nvptx_multilibs; do
                        case $nvptx_multilib in
                        #TODO 'sm_[...]' list per 'nvptx-sm.def'.
-                       sm_30 | sm_35 \
+                       sm_30 | sm_35 | sm_37 \
                        | sm_53 \
                        | sm_70 | sm_75 \
                        | sm_80 )
diff --git a/gcc/config/nvptx/gen-multilib-matches-tests 
b/gcc/config/nvptx/gen-multilib-matches-tests
index b93369149465..87045040b11a 100644
--- a/gcc/config/nvptx/gen-multilib-matches-tests
+++ b/gcc/config/nvptx/gen-multilib-matches-tests
@@ -15,6 +15,7 @@ SMOID sm_30
 SMOIL sm_30
 AEMM .=misa?sm_30
 AEMM .=misa?sm_35
+AEMM .=misa?sm_37
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
@@ -26,14 +27,15 @@ SMOID sm_30
 SMOIL sm_30 sm_80
 AEMM .=misa?sm_30
 AEMM .=misa?sm_35
+AEMM .=misa?sm_37
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 CMMC
 
-BEGIN '--with-arch=sm_30', 
'--with-multilib-list=sm_30,sm_35,sm_53,sm_70,sm_75,sm_80'
+BEGIN '--with-arch=sm_30', 
'--with-multilib-list=sm_30,sm_35,sm_37,sm_53,sm_70,sm_75,sm_80'
 SMOID sm_30
-SMOIL sm_30 sm_35 sm_53 sm_70 sm_75 sm_80
+SMOIL sm_30 sm_35 sm_37 sm_53 sm_70 sm_75 sm_80
 AEMM .=misa?sm_30
 CMMC
 
@@ -43,6 +45,7 @@ SMOID sm_35
 SMOIL sm_35
 AEMM .=misa?sm_30
 AEMM .=misa?sm_35
+AEMM .=misa?sm_37
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
@@ -53,6 +56,19 @@ BEGIN '--with-arch=sm_35', '--with-multilib-list=sm_35,sm_30'
 SMOID sm_35
 SMOIL sm_35 sm_30
 AEMM .=misa?sm_35
+AEMM .=misa?sm_37
+AEMM .=misa?sm_53
+AEMM .=misa?sm_70
+AEMM .=misa?sm_75
+AEMM .=misa?sm_80
+CMMC
+
+
+BEGIN '--with-arch=sm_37', '--with-multilib-list=sm_37,sm_30'
+SMOID sm_37
+SMOIL sm_37 sm_30
+AEMM misa?sm_30=misa?sm_35
+AEMM .=misa?sm_37
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
@@ -64,15 +80,27 @@ BEGIN '--with-arch=sm_53', 
'--with-multilib-list=sm_53,sm_30'
 SMOID sm_53
 SMOIL sm_53 sm_30
 AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
+AEMM .=misa?sm_53
+AEMM .=misa?sm_70
+AEMM .=misa?sm_75
+AEMM .=misa?sm_80
+CMMC
+
+BEGIN '--with-arch=sm_53', '--with-multilib-list=sm_53,sm_37'
+SMOID sm_53
+SMOIL sm_53 sm_37
+AEMM misa?sm_37=misa?sm_30
+AEMM misa?sm_37=misa?sm_35
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
 CMMC
 
-BEGIN '--with-arch=sm_53', 
'--with-multilib-list=sm_53,sm_30,sm_35,sm_70,sm_75,sm_80'
+BEGIN '--with-arch=sm_53', 
'--with-multilib-list=sm_53,sm_30,sm_35,sm_37,sm_70,sm_75,sm_80'
 SMOID sm_53
-SMOIL sm_53 sm_30 sm_35 sm_70 sm_75 sm_80
+SMOIL sm_53 sm_30 sm_35 sm_37 sm_70 sm_75 sm_80
 AEMM .=misa?sm_53
 CMMC
 
@@ -82,6 +110,7 @@ SMOID sm_70
 SMOIL sm_70
 AEMM .=misa?sm_30
 AEMM .=misa?sm_35
+AEMM .=misa?sm_37
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
@@ -92,6 +121,7 @@ BEGIN '--with-arch=sm_70', '--with-multilib-list=sm_70,sm_30'
 SMOID sm_70
 SMOIL sm_70 sm_30
 AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
@@ -103,6 +133,7 @@ SMOID sm_70
 SMOIL sm_70 sm_53
 AEMM misa?sm_53=misa?sm_30
 AEMM misa?sm_53=misa?sm_35
+AEMM misa?sm_53=misa?sm_37
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -112,6 +143,7 @@ BEGIN '--with-arch=sm_70', 
'--with-multilib-list=sm_70,sm_53,sm_30'
 SMOID sm_70
 SMOIL sm_70 sm_53 sm_30
 AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -122,6 +154,7 @@ BEGIN '--with-arch=sm_75', 
'--with-multilib-list=sm_75,sm_30'
 SMOID sm_75
 SMOIL sm_75 sm_30
 AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_53
 AEMM misa?sm_30=misa?sm_70
 AEMM .=misa?sm_75
@@ -133,6 +166,7 @@ SMOID sm_75
 SMOIL sm_75 sm_53
 AEMM misa?sm_53=misa?sm_30
 AEMM misa?sm_53=misa?sm_35
+AEMM misa?sm_53=misa?sm_37
 AEMM misa?sm_53=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -142,6 +176,7 @@ BEGIN '--with-arch=sm_75', 
'--with-multilib-list=sm_75,sm_30,sm_53'
 SMOID sm_75
 SMOIL sm_75 sm_30 sm_53
 AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_53=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -153,6 +188,7 @@ SMOID sm_80
 SMOIL sm_80
 AEMM .=misa?sm_30
 AEMM .=misa?sm_35
+AEMM .=misa?sm_37
 AEMM .=misa?sm_53
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
@@ -163,6 +199,7 @@ BEGIN '--with-arch=sm_80', 
'--with-multilib-list=sm_80,sm_30'
 SMOID sm_80
 SMOIL sm_80 sm_30
 AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_53
 AEMM misa?sm_30=misa?sm_70
 AEMM misa?sm_30=misa?sm_75
@@ -174,13 +211,14 @@ SMOID sm_80
 SMOIL sm_80 sm_75
 AEMM misa?sm_75=misa?sm_30
 AEMM misa?sm_75=misa?sm_35
+AEMM misa?sm_75=misa?sm_37
 AEMM misa?sm_75=misa?sm_53
 AEMM misa?sm_75=misa?sm_70
 AEMM .=misa?sm_80
 CMMC
 
-BEGIN '--with-arch=sm_80', 
'--with-multilib-list=sm_80,sm_30,sm_35,sm_53,sm_70,sm_75'
+BEGIN '--with-arch=sm_80', 
'--with-multilib-list=sm_80,sm_30,sm_35,sm_37,sm_53,sm_70,sm_75'
 SMOID sm_80
-SMOIL sm_80 sm_30 sm_35 sm_53 sm_70 sm_75
+SMOIL sm_80 sm_30 sm_35 sm_37 sm_53 sm_70 sm_75
 AEMM .=misa?sm_80
 CMMC
diff --git a/gcc/config/nvptx/nvptx-gen.h b/gcc/config/nvptx/nvptx-gen.h
index b2441586afc3..7f9b620ea778 100644
--- a/gcc/config/nvptx/nvptx-gen.h
+++ b/gcc/config/nvptx/nvptx-gen.h
@@ -23,6 +23,7 @@
 
 #define TARGET_SM30 (ptx_isa_option >= PTX_ISA_SM30)
 #define TARGET_SM35 (ptx_isa_option >= PTX_ISA_SM35)
+#define TARGET_SM37 (ptx_isa_option >= PTX_ISA_SM37)
 #define TARGET_SM53 (ptx_isa_option >= PTX_ISA_SM53)
 #define TARGET_SM70 (ptx_isa_option >= PTX_ISA_SM70)
 #define TARGET_SM75 (ptx_isa_option >= PTX_ISA_SM75)
diff --git a/gcc/config/nvptx/nvptx-gen.opt b/gcc/config/nvptx/nvptx-gen.opt
index 84b70d6734c3..9124bd128967 100644
--- a/gcc/config/nvptx/nvptx-gen.opt
+++ b/gcc/config/nvptx/nvptx-gen.opt
@@ -29,6 +29,9 @@ Enum(ptx_isa) String(sm_30) Value(PTX_ISA_SM30)
 EnumValue
 Enum(ptx_isa) String(sm_35) Value(PTX_ISA_SM35)
 
+EnumValue
+Enum(ptx_isa) String(sm_37) Value(PTX_ISA_SM37)
+
 EnumValue
 Enum(ptx_isa) String(sm_53) Value(PTX_ISA_SM53)
 
diff --git a/gcc/config/nvptx/nvptx-sm.def b/gcc/config/nvptx/nvptx-sm.def
index 2f71777c8c11..625007dd0b58 100644
--- a/gcc/config/nvptx/nvptx-sm.def
+++ b/gcc/config/nvptx/nvptx-sm.def
@@ -22,6 +22,7 @@
 
 NVPTX_SM (30, NVPTX_SM_SEP)
 NVPTX_SM (35, NVPTX_SM_SEP)
+NVPTX_SM (37, NVPTX_SM_SEP)
 NVPTX_SM (53, NVPTX_SM_SEP)
 NVPTX_SM (70, NVPTX_SM_SEP)
 NVPTX_SM (75, NVPTX_SM_SEP)
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 81c959437cda..29660c458ceb 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -221,6 +221,8 @@ first_ptx_version_supporting_sm (enum ptx_isa sm)
       return /* PTX_VERSION_3_0 not defined */ PTX_VERSION_3_1;
     case PTX_ISA_SM35:
       return PTX_VERSION_3_1;
+    case PTX_ISA_SM37:
+      return PTX_VERSION_4_1;
     case PTX_ISA_SM53:
       return PTX_VERSION_4_2;
     case PTX_ISA_SM70:
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 12f96d0885b6..e02a845c0093 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -73,13 +73,13 @@ march-map=sm_35
 Target RejectNegative Alias(misa=,sm_35)
 
 march-map=sm_37
-Target RejectNegative Alias(misa=,sm_35)
+Target RejectNegative Alias(misa=,sm_37)
 
 march-map=sm_50
-Target RejectNegative Alias(misa=,sm_35)
+Target RejectNegative Alias(misa=,sm_37)
 
 march-map=sm_52
-Target RejectNegative Alias(misa=,sm_35)
+Target RejectNegative Alias(misa=,sm_37)
 
 march-map=sm_53
 Target RejectNegative Alias(misa=,sm_53)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 6ba199d23d7e..aea1d271f233 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -30026,7 +30026,7 @@ supported.
 @item -march=@var{architecture-string}
 Generate code for the specified PTX ISA target architecture.
 Valid architecture strings are
-@samp{sm_30}, @samp{sm_35},
+@samp{sm_30}, @samp{sm_35}, @samp{sm_37},
 @samp{sm_53},
 @samp{sm_70}, @samp{sm_75},
 and @samp{sm_80}.
diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index 65257663146c..b7cd8b3810aa 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -3,6 +3,14 @@
        Backported from trunk:
        2024-12-06  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       * gcc.target/nvptx/march-map=sm_37.c: Adjust.
+       * gcc.target/nvptx/march-map=sm_50.c: Likewise.
+       * gcc.target/nvptx/march-map=sm_52.c: Likewise.
+       * gcc.target/nvptx/march=sm_37.c: New.
+
+       Backported from trunk:
+       2024-12-06  Thomas Schwinge  <tschwi...@baylibre.com>
+
        * gcc.target/nvptx/mptx=4.1.c: New.
 
        Backported from trunk:
diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_37.c 
b/gcc/testsuite/gcc.target/nvptx/march-map=sm_37.c
index 6e3928e55317..5b7f31c32305 100644
--- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_37.c
+++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_37.c
@@ -2,7 +2,7 @@
 /* { dg-options {-march-map=sm_37 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
 /* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
-/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_35$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_37$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 6
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
@@ -12,7 +12,7 @@
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
-#if __PTX_SM__ != 350
+#if __PTX_SM__ != 370
 #error wrong value for __PTX_SM__
 #endif
 
diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_50.c 
b/gcc/testsuite/gcc.target/nvptx/march-map=sm_50.c
index 2e843afb3b5e..934dd535cf37 100644
--- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_50.c
+++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_50.c
@@ -2,7 +2,7 @@
 /* { dg-options {-march-map=sm_50 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
 /* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
-/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_35$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_37$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 6
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
@@ -12,7 +12,7 @@
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
-#if __PTX_SM__ != 350
+#if __PTX_SM__ != 370
 #error wrong value for __PTX_SM__
 #endif
 
diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c 
b/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c
index e6c6eac5231a..6dd8605721fa 100644
--- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c
+++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c
@@ -2,7 +2,7 @@
 /* { dg-options {-march-map=sm_52 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
 /* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
-/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_35$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_37$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 6
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
@@ -12,7 +12,7 @@
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
-#if __PTX_SM__ != 350
+#if __PTX_SM__ != 370
 #error wrong value for __PTX_SM__
 #endif
 
diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_37.c 
b/gcc/testsuite/gcc.target/nvptx/march=sm_37.c
new file mode 100644
index 000000000000..d1094d0b9179
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/march=sm_37.c
@@ -0,0 +1,19 @@
+/* { dg-do assemble } */
+/* { dg-options {-march=sm_37 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_37$} 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__ != 370
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index b3db799956fe..2214bdd01072 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,5 +1,11 @@
 2024-12-18  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       Backported from trunk:
+       2024-12-06  Thomas Schwinge  <tschwi...@baylibre.com>
+
+       * testsuite/libgomp.c/declare-variant-3-sm37.c: New.
+       * testsuite/libgomp.c/declare-variant-3.h: Adjust.
+
        Backported from trunk:
        2024-12-10  Tobias Burnus  <tbur...@baylibre.com>
 
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm37.c 
b/libgomp/testsuite/libgomp.c/declare-variant-3-sm37.c
new file mode 100644
index 000000000000..d12abab098f1
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm37.c
@@ -0,0 +1,8 @@
+/* { dg-do link { target { offload_target_nvptx } } } */
+/* { dg-additional-options -foffload=nvptx-none } */
+/* { dg-additional-options "-foffload=-misa=sm_37 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-3.h"
+
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= 
f37 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3.h 
b/libgomp/testsuite/libgomp.c/declare-variant-3.h
index 38ee257e42da..58ec06bf9dfb 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3.h
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3.h
@@ -14,6 +14,13 @@ f35 (void)
   return 35;
 }
 
+__attribute__ ((noipa))
+int
+f37 (void)
+{
+  return 37;
+}
+
 __attribute__ ((noipa))
 int
 f53 (void)
@@ -44,6 +51,7 @@ f80 (void)
 
 #pragma omp declare variant (f30) match (device={isa("sm_30")})
 #pragma omp declare variant (f35) match (device={isa("sm_35")})
+#pragma omp declare variant (f37) match (device={isa("sm_37")})
 #pragma omp declare variant (f53) match (device={isa("sm_53")})
 #pragma omp declare variant (f70) match (device={isa("sm_70")})
 #pragma omp declare variant (f75) match (device={isa("sm_75")})

Reply via email to