public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-11] openmp: Add additional tests for declare variant in Fortran
@ 2021-10-19 13:39 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-10-19 13:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7f413e93f487fc1703f3ceecbda35e653543b3ab

commit 7f413e93f487fc1703f3ceecbda35e653543b3ab
Author: Kwok Cheung Yeung <kcy@codesourcery.com>
Date:   Tue Oct 19 08:32:30 2021 +0200

    openmp: Add additional tests for declare variant in Fortran
    
    Add tests to check that explicitly specifying the containing procedure as the
    base name for declare variant works.
    
    2021-10-18  Kwok Cheung Yeung  <kcy@codesourcery.com>
    
    gcc/testsuite/
    
            * gfortran.dg/gomp/declare-variant-15.f90 (variant2, base2, test2):
            Add tests.
            * gfortran.dg/gomp/declare-variant-16.f90 (base2, variant2, test2):
            Add tests.
    
    (cherry picked from commit 38733234024697d2144613c4a992e970f40afad8)

Diff:
---
 gcc/testsuite/ChangeLog.omp                           | 10 ++++++++++
 gcc/testsuite/gfortran.dg/gomp/declare-variant-15.f90 | 13 +++++++++++++
 gcc/testsuite/gfortran.dg/gomp/declare-variant-16.f90 | 14 +++++++++++++-
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index e716eef151d..90c7d502223 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -1,3 +1,13 @@
+2021-10-18  Tobias Burnus  <tobias@codesourcery.com>
+
+	Backported from master:
+	2021-10-18  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+	* gfortran.dg/gomp/declare-variant-15.f90 (variant2, base2, test2):
+	Add tests.
+	* gfortran.dg/gomp/declare-variant-16.f90 (base2, variant2, test2):
+	Add tests.
+
 2021-10-15  Tobias Burnus  <tobias@codesourcery.com>
 
 	Backported from master:
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-15.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-variant-15.f90
index b2ad96a8998..4a88e3e46c7 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-15.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-variant-15.f90
@@ -14,6 +14,13 @@ contains
   subroutine base ()
   end subroutine
 
+  subroutine variant2 ()
+  end subroutine
+
+  subroutine base2 ()
+    !$omp declare variant (base2: variant2) match (construct={parallel})
+  end subroutine
+
   subroutine test1 ()
     !$omp target
       !$omp parallel
@@ -21,4 +28,10 @@ contains
       !$omp end parallel
     !$omp end target
   end subroutine
+
+  subroutine test2 ()
+    !$omp parallel
+	call base2 ()	! { dg-final { scan-tree-dump-times "variant2 \\\(\\\);" 1 "gimple" } }
+    !$omp end parallel
+  end subroutine
 end module
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-16.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-variant-16.f90
index fc97322e667..5e34d474da4 100644
--- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-16.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/declare-variant-16.f90
@@ -10,15 +10,27 @@ module main
     subroutine base ()
       !$omp declare variant (variant) match (construct={parallel})
     end subroutine
+    
+    subroutine base2 ()
+      !$omp declare variant (base2: variant2) match (construct={target})
+    end subroutine
   end interface
-
 contains
   subroutine variant ()
   end subroutine
 
+  subroutine variant2 ()
+  end subroutine
+
   subroutine test ()
     !$omp parallel
       call base ()  ! { dg-final { scan-tree-dump-times "variant \\\(\\\);" 1 "gimple" } }
     !$omp end parallel
   end subroutine
+
+  subroutine test2 ()
+    !$omp target
+      call base2 ()  ! { dg-final { scan-tree-dump-times "variant2 \\\(\\\);" 1 "gimple" } }
+    !$omp end target
+  end subroutine
 end module


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-19 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 13:39 [gcc/devel/omp/gcc-11] openmp: Add additional tests for declare variant in Fortran Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).