public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Kwok Yeung <kcy@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-4485] openmp: Add additional tests for declare variant in Fortran
Date: Mon, 18 Oct 2021 21:19:51 +0000 (GMT)	[thread overview]
Message-ID: <20211018211951.0D7293858C27@sourceware.org> (raw)

https://gcc.gnu.org/g:38733234024697d2144613c4a992e970f40afad8

commit r12-4485-g38733234024697d2144613c4a992e970f40afad8
Author: Kwok Cheung Yeung <kcy@codesourcery.com>
Date:   Mon Oct 18 13:56:59 2021 -0700

    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.

Diff:
---
 gcc/testsuite/gfortran.dg/gomp/declare-variant-15.f90 | 13 +++++++++++++
 gcc/testsuite/gfortran.dg/gomp/declare-variant-16.f90 | 14 +++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

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


                 reply	other threads:[~2021-10-18 21:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018211951.0D7293858C27@sourceware.org \
    --to=kcy@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).