57 lines · plain
1! RUN: bbc -emit-fir %s -o - | FileCheck %s2 3! CHECK-DAG: func.func private @proc1() attributes {fir.bindc_name = "proc1", fir.proc_attrs = #fir.proc_attrs<bind_c>}4module decl15 interface6 subroutine proc_iface() bind(C)7 end subroutine proc_iface8 end interface9 procedure (proc_iface) PrOc110end module decl111subroutine test1(x)12 use decl113 call PrOc114end subroutine test115 16! CHECK-DAG: func.func private @proc2() attributes {fir.bindc_name = "proc2", fir.proc_attrs = #fir.proc_attrs<bind_c>}17module decl218 interface19 subroutine proc_iface() bind(C)20 end subroutine proc_iface21 end interface22end module decl223subroutine test2(x)24 use decl225 procedure (proc_iface) PrOc226 call PrOc227end subroutine test228 29! CHECK-DAG: func.func private @func3() -> f32 attributes {fir.bindc_name = "func3", fir.proc_attrs = #fir.proc_attrs<bind_c>}30module decl331 interface32 real function func_iface() bind(C)33 end function func_iface34 end interface35 procedure (func_iface) FuNc336end module decl337subroutine test3(x)38 use decl339 real :: x40 x = FuNc3()41end subroutine test342 43! CHECK-DAG: func.func private @func4() -> f32 attributes {fir.bindc_name = "func4", fir.proc_attrs = #fir.proc_attrs<bind_c>}44module decl445 interface46 real function func_iface() bind(C)47 end function func_iface48 end interface49end module decl450subroutine test4(x)51 use decl452 procedure (func_iface) FuNc453 real :: x54 x = FuNc4()55end subroutine test456 57