annotate gcc/testsuite/gfortran.dg/contained_module_proc_1.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! Tests the check for PR31292, in which the module procedure
kono
parents:
diff changeset
3 ! statement would put the symbol for assign_t in the wrong
kono
parents:
diff changeset
4 ! namespace and this caused the interface checking to fail.
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
kono
parents:
diff changeset
7 !
kono
parents:
diff changeset
8 module chk_gfortran
kono
parents:
diff changeset
9 implicit none
kono
parents:
diff changeset
10 type t
kono
parents:
diff changeset
11 integer x
kono
parents:
diff changeset
12 end type t
kono
parents:
diff changeset
13 contains
kono
parents:
diff changeset
14 function is_gfortran()
kono
parents:
diff changeset
15 logical is_gfortran
kono
parents:
diff changeset
16 interface assignment(=)
kono
parents:
diff changeset
17 module procedure assign_t
kono
parents:
diff changeset
18 end interface assignment(=)
kono
parents:
diff changeset
19 type(t) y(3)
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 y%x = (/1,2,3/)
kono
parents:
diff changeset
22 y = y((/2,3,1/))
kono
parents:
diff changeset
23 is_gfortran = y(3)%x == 1
kono
parents:
diff changeset
24 end function is_gfortran
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 elemental subroutine assign_t(lhs,rhs)
kono
parents:
diff changeset
27 type(t), intent(in) :: rhs
kono
parents:
diff changeset
28 type(t), intent(out) :: lhs
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 lhs%x = rhs%x
kono
parents:
diff changeset
31 end subroutine assign_t
kono
parents:
diff changeset
32 end module chk_gfortran
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 program fire
kono
parents:
diff changeset
35 use chk_gfortran
kono
parents:
diff changeset
36 implicit none
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
37 if(.not. is_gfortran()) STOP 1
111
kono
parents:
diff changeset
38 end program fire