Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / func_assign.f90
blob7ecf32941ca737eca0c58988bc3438fac2f9d7bf
1 ! { dg-do compile }
3 ! PR fortran/31559
4 ! Do not allow assigning to external functions
6 ! Contributed by Steve Kargl <sgk@troutmask.apl.washington.edu>
8 module mod
9 implicit none
10 contains
11 integer function bar()
12 bar = 4
13 end function bar
15 subroutine a()
16 implicit none
17 real :: fun
18 external fun
19 interface
20 function funget(a)
21 integer :: a
22 end function
23 subroutine sub()
24 end subroutine sub
25 end interface
26 sub = 'a' ! { dg-error "is not a variable" }
27 fun = 4.4 ! { dg-error "is not a variable" }
28 funget = 4 ! { dg-error "is not a variable" }
29 bar = 5 ! { dg-error "is not a variable" }
30 end subroutine a
31 end module mod
33 end