2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / impure_assignment_1.f90
blob6a1660c38e986e358e1a269e5f8a12eccfd9ca8f
1 ! { dg-do compile }
2 ! Tests fix for PR25059, which gave and ICE after error message
3 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
4 MODULE M1
5 TYPE T1
6 INTEGER :: I
7 END TYPE T1
8 INTERFACE ASSIGNMENT(=)
9 MODULE PROCEDURE S1
10 END INTERFACE
11 CONTAINS
12 SUBROUTINE S1(I,J)
13 TYPE(T1), INTENT(OUT):: I
14 TYPE(T1), INTENT(IN) :: J
15 I%I=J%I**2
16 END SUBROUTINE S1
17 END MODULE M1
19 USE M1
20 CONTAINS
21 PURE SUBROUTINE S2(I,J)
22 TYPE(T1), INTENT(OUT):: I
23 TYPE(T1), INTENT(IN) :: J
24 I=J ! { dg-error "is not PURE" }
25 END SUBROUTINE S2
26 END
27 ! { dg-final { cleanup-modules "M1" } }