As Fortran 2018 C1521, in procedure declaration statement, if proc-language-binding-spec (bind(c)) is specified, the proc-interface shall appear, it shall be an interface-name, and interface-name shall be declared with a proc-language-binding-spec. Reviewed By: klausler, Jean Perier Differential Revision: https://reviews.llvm.org/D127121
26 lines
562 B
Fortran
26 lines
562 B
Fortran
! RUN: %python %S/test_modfile.py %s %flang_fc1
|
|
module m
|
|
character(2), parameter :: prefix = 'c_'
|
|
integer, bind(c, name='c_a') :: a
|
|
procedure(sub), bind(c, name=prefix//'b'), pointer :: b
|
|
type, bind(c) :: t
|
|
real :: c
|
|
end type
|
|
contains
|
|
subroutine sub() bind(c, name='sub')
|
|
end
|
|
end
|
|
|
|
!Expect: m.mod
|
|
!module m
|
|
! character(2_4,1),parameter::prefix="c_"
|
|
! integer(4),bind(c, name="c_a")::a
|
|
! procedure(sub),bind(c, name="c_b"),pointer::b
|
|
! type,bind(c)::t
|
|
! real(4)::c
|
|
! end type
|
|
!contains
|
|
! subroutine sub() bind(c, name="sub")
|
|
! end
|
|
!end
|