PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / impure_assignment_1.f90
blob103244cefa7ffdcd7944d05e157d1b29726a3407
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