| 1 |
! This test checks bind(c) procs inside BLOCK construct. |
| 2 |
|
| 3 |
!RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s |
| 4 |
|
| 5 |
module m |
| 6 |
interface |
| 7 |
subroutine test_proc() bind(C) |
| 8 |
end subroutine test_proc |
| 9 |
end interface |
| 10 |
end module m |
| 11 |
!CHECK-DAG: %[[S0:.*]] = fir.call @llvm.stacksave.p0() fastmath<contract> : () -> !fir.ref<i8> |
| 12 |
!CHECK-DAG: fir.call @test_proc() fastmath<contract> {is_bind_c} : () -> () |
| 13 |
!CHECK-DAG: fir.call @llvm.stackrestore.p0(%[[S0]]) fastmath<contract> : (!fir.ref<i8>) -> () |
| 14 |
!CHECK-DAG: func.func private @test_proc() attributes {fir.bindc_name = "test_proc"} |
| 15 |
subroutine test |
| 16 |
BLOCK |
| 17 |
use m |
| 18 |
call test_proc |
| 19 |
END BLOCK |
| 20 |
end subroutine test |