aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/interface_23.f90
blob: b2e7a697fd227ebf79a87ef0519621151a8b4bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
! { dg-do compile }
!
! This tests the fix for PR36325, which corrected for the fact that a
! specific or generic INTERFACE statement implies the EXTERNAL attibute.
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

module a
  interface
    subroutine foo
    end subroutine
  end interface
  external foo  ! { dg-error "Duplicate EXTERNAL attribute" }
end module

module b
  interface
    function sin (x)
      real :: sin, x
    end function
  end interface
  intrinsic sin  ! { dg-error "EXTERNAL attribute conflicts with INTRINSIC attribute" }
end module

! argument checking was not done for external procedures with explicit interface
program c
  interface
    subroutine bar(x)
      real :: x
    end subroutine
  end interface
  call bar()  ! { dg-error "Missing actual argument" }
end program