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.
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
!$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
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