2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / invalid_interface_assignment.f90
blob4fd747616a47f03123b771d70aacec40d385e29f
1 ! { dg-do compile }
2 ! { dg-options "-std=gnu" }
4 ! Tests the fix for PR25102, which did not diagnose the aberrant interface
5 ! assignement below.
7 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
9 MODULE TT
10 TYPE data_type
11 INTEGER :: I
12 END TYPE data_type
13 INTERFACE ASSIGNMENT (=)
14 MODULE PROCEDURE set
15 END INTERFACE
16 CONTAINS
17 PURE SUBROUTINE set(x1,*) ! { dg-error "Alternate return cannot appear" }
18 TYPE(data_type), INTENT(OUT) :: x1
19 x1%i=0
20 END SUBROUTINE set
21 END MODULE