OSDN Git Service

* obj-c++.dg/comp-types-10.mm: XFAIL for ICE.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / used_dummy_types_8.f90
1 ! { dg-do compile }
2 ! Tests the fix for PR30880, in which the variable d1
3 ! in module m1 would cause an error in the main program
4 ! because it has an initializer and is a dummy.  This
5 ! came about because the function with multiple entries
6 ! assigns the initializer earlier than for other cases.
7 !
8 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk> 
9 !
10 MODULE M1
11   TYPE T1
12   INTEGER :: i=7
13   END TYPE T1
14 CONTAINS
15   FUNCTION F1(d1) RESULT(res)
16     INTEGER :: res
17     TYPE(T1), INTENT(OUT) :: d1
18     TYPE(T1), INTENT(INOUT) :: d2
19     res=d1%i
20     d1%i=0
21     RETURN
22   ENTRY E1(d2) RESULT(res)
23     res=d2%i
24     d2%i=0
25   END FUNCTION F1
26 END MODULE M1
27
28   USE M1
29   TYPE(T1) :: D1
30   D1=T1(3)
31   write(6,*) F1(D1)
32   D1=T1(3)
33   write(6,*) E1(D1)
34 END
35 ! { dg-final { cleanup-modules "m1" } }