| 1 |
! Test that lowering makes a difference between NAME="" and no NAME |
| 2 |
! in BIND(C). See Fortran 2018 standard 18.10.2 point 2. |
| 3 |
! BIND(C, NAME="") implies there is no binding label, meaning that |
| 4 |
! the Fortran mangled name has to be used. |
| 5 |
! RUN: bbc -emit-hlfir %s -o - | FileCheck %s |
| 6 |
|
| 7 |
!CHECK: func.func @_QPfoo(%{{.*}}: !fir.ref<i16> |
| 8 |
subroutine foo(x) bind(c, name="") |
| 9 |
integer(2) :: x |
| 10 |
end subroutine |
| 11 |
|
| 12 |
!CHECK: func.func @bar(%{{.*}}: !fir.ref<i32> |
| 13 |
subroutine foo(x) bind(c, name="bar") |
| 14 |
integer(4) :: x |
| 15 |
end subroutine |
| 16 |
|
| 17 |
!CHECK: func.func @_QMinamodule1Pfoo(%{{.*}}: !fir.ref<i64> |
| 18 |
module inamodule1 |
| 19 |
contains |
| 20 |
subroutine foo(x) bind(c, name="") |
| 21 |
integer(8) :: x |
| 22 |
end subroutine |
| 23 |
end module |