30 lines · plain
1! Test that logicals are lowered to Fortran logical types where it matters2! RUN: bbc %s -emit-fir -o - | FileCheck %s3 4! Logicals should be lowered to Fortran logical types in memory/function5! interfaces.6 7 8! CHECK-LABEL: _QPtest_value_arguments9subroutine test_value_arguments()10interface11subroutine foo2(l)12 logical(2) :: l13end subroutine14subroutine foo4(l)15 logical(4) :: l16end subroutine17end interface18 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>>) -> ()22call 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>>) -> ()27call foo4(.true.)28 29end subroutine30