PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / constructor_3.f90
bloba0d726adc183b08d077873fb4053d03d4cfb87a6
1 ! { dg-do run }
3 ! PR fortran/39427
5 ! Check constructor functionality.
8 module m
9 interface cons
10 procedure cons42
11 end interface cons
12 contains
13 integer function cons42()
14 cons42 = 42
15 end function cons42
16 end module m
19 module m2
20 type cons
21 integer :: j = -1
22 end type cons
23 interface cons
24 procedure consT
25 end interface cons
26 contains
27 type(cons) function consT(k)
28 integer :: k
29 consT%j = k**2
30 end function consT
31 end module m2
34 use m
35 use m2, only: cons
36 implicit none
37 type(cons) :: x
38 integer :: k
39 x = cons(3)
40 k = cons()
41 if (x%j /= 9) STOP 1
42 if (k /= 42) STOP 2
43 !print *, x%j
44 !print *, k
45 end