aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2020-08-05 20:53:44 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 15:07:40 -0300
commit5ffb37792f1f40986f8b41b8de9e841b8fb16511 (patch)
treea41f2b891a202275218b5200467035681647b9dd /gcc
parentfbb422414ece6e9d7d11bb92aa1a16e293ac0620 (diff)
downloadgcc-5ffb37792f1f40986f8b41b8de9e841b8fb16511.zip
gcc-5ffb37792f1f40986f8b41b8de9e841b8fb16511.tar.gz
gcc-5ffb37792f1f40986f8b41b8de9e841b8fb16511.tar.bz2
Added test case to make sure that legal cases still pass.
gcc/testsuite/ChangeLog: PR fortran/96469 * gfortran.dg/do_check_14.f90: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_14.f9056
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/do_check_14.f90 b/gcc/testsuite/gfortran.dg/do_check_14.f90
new file mode 100644
index 0000000..43425f1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_14.f90
@@ -0,0 +1,56 @@
+! { dg-do compile }
+! PR fortran/96469 - make sure that all legal variants pass.
+
+module x
+ implicit none
+contains
+ subroutine sub_intent_in(i)
+ integer, intent(in) :: i
+ end subroutine sub_intent_in
+ subroutine sub_intent_unspec(i)
+ integer :: i
+ end subroutine sub_intent_unspec
+ integer function fcn_intent_in(i)
+ integer, intent(in) :: i
+ fcn_intent_in = i + 42
+ end function fcn_intent_in
+ integer function fcn_intent_unspec (i)
+ integer :: i
+ fcn_intent_unspec = i + 42
+ end function fcn_intent_unspec
+end module x
+
+program main
+ use x
+ implicit none
+ integer :: i1, i2, i3, i4
+ integer :: k, l
+ do i1=1,10
+ call sub1
+ end do
+ do i2=1,10
+ call sub2
+ end do
+ do i3 = 1,10
+ k = fcn3()
+ end do
+ do i4=1,10
+ l = fcn4()
+ end do
+contains
+ subroutine sub1
+ call sub_intent_in (i1)
+ end subroutine sub1
+ subroutine sub2
+ integer :: m
+ m = fcn_intent_in (i2)
+ print *,m
+ end subroutine sub2
+ integer function fcn3()
+ call sub_intent_unspec (i3)
+ fcn3 = 42
+ end function fcn3
+ integer function fcn4()
+ fcn4 = fcn_intent_unspec (i4)
+ end function fcn4
+end program main