| 1 |
! Test that logicals are lowered to Fortran logical types where it matters |
| 2 |
! RUN: bbc %s -emit-fir -o - | FileCheck %s |
| 3 |
|
| 4 |
! Logicals should be lowered to Fortran logical types in memory/function |
| 5 |
! interfaces. |
| 6 |
|
| 7 |
|
| 8 |
! CHECK-LABEL: _QPtest_value_arguments |
| 9 |
subroutine test_value_arguments() |
| 10 |
interface |
| 11 |
subroutine foo2(l) |
| 12 |
logical(2) :: l |
| 13 |
end subroutine |
| 14 |
subroutine foo4(l) |
| 15 |
logical(4) :: l |
| 16 |
end subroutine |
| 17 |
end interface |
| 18 |
|
| 19 |
! CHECK: %[[true2:.*]] = fir.convert %true{{.*}} : (i1) -> !fir.logical<2> |
| 20 |
! CHECK: fir.store %[[true2]] to %[[mem2:.*]] : !fir.ref<!fir.logical<2>> |
| 21 |
! CHECK: fir.call @_QPfoo2(%[[mem2]]) {{.*}}: (!fir.ref<!fir.logical<2>>) -> () |
| 22 |
call foo2(.true._2) |
| 23 |
|
| 24 |
! CHECK: %[[true4:.*]] = fir.convert %true{{.*}} : (i1) -> !fir.logical<4> |
| 25 |
! CHECK: fir.store %[[true4]] to %[[mem4:.*]] : !fir.ref<!fir.logical<4>> |
| 26 |
! CHECK: fir.call @_QPfoo4(%[[mem4]]) {{.*}}: (!fir.ref<!fir.logical<4>>) -> () |
| 27 |
call foo4(.true.) |
| 28 |
|
| 29 |
end subroutine |