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