aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr85877.f90
blob: d8f08cbd21004650413549c1c1a8f83137c545de (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
! { dg-do compile }
! PR fortran/85877
! A procedure with the bind(c) attribute shall have an explicit interface
! Contributed by G. Steinmetz

function f() bind(c)
  f = 42.
end

subroutine p
  bind(c) f     ! { dg-error "must be explicit" }
  x = f()
end

function g() bind(c)
  g = 42.
end

subroutine s
  interface
     function g() bind(c)
     end function g
  end interface
  x = g()
end