Patch 2/3 of the transition step 1 described in https://discourse.llvm.org/t/rfc-enabling-the-hlfir-lowering-by-default/72778/7. All the modified tests are still here since coverage for the direct lowering to FIR was still needed while it was default. Some already have an HLFIR version, some have not and will need to be ported in step 2 described in the RFC. Note that another 147 lit tests use -emit-fir/-emit-llvm outputs but do not need a flag since the HLFIR/no HLFIR output is the same for what is being tested.
24 lines
1.3 KiB
Fortran
24 lines
1.3 KiB
Fortran
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck --check-prefixes=CHECK,CHECK-32 -DDEFAULT_INTEGER_SIZE=32 %s
|
|
! bbc doesn't have a way to set the default kinds so we use flang-new driver
|
|
! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 -DDEFAULT_INTEGER_SIZE=64 %s
|
|
|
|
! CHECK-LABEL: func @_QPexit_test1() {
|
|
subroutine exit_test1
|
|
call exit()
|
|
! CHECK: %[[status:.*]] = arith.constant 0 : i[[DEFAULT_INTEGER_SIZE]]
|
|
! CHECK-64: %[[statusConvert:.*]] = fir.convert %[[status]] : (i64) -> i32
|
|
! CHECK-32: %{{[0-9]+}} = fir.call @_FortranAExit(%[[status]]) {{.*}}: (i32) -> none
|
|
! CHECK-64: %{{[0-9]+}} = fir.call @_FortranAExit(%[[statusConvert]]) {{.*}}: (i32) -> none
|
|
end subroutine exit_test1
|
|
|
|
! CHECK-LABEL: func @_QPexit_test2(
|
|
! CHECK-SAME: %[[statusArg:.*]]: !fir.ref<i[[DEFAULT_INTEGER_SIZE]]>{{.*}}) {
|
|
subroutine exit_test2(status)
|
|
integer :: status
|
|
call exit(status)
|
|
! CHECK: %[[status:.*]] = fir.load %[[statusArg]] : !fir.ref<i[[DEFAULT_INTEGER_SIZE]]>
|
|
! CHECK-64: %[[statusConv:.*]] = fir.convert %[[status]] : (i64) -> i32
|
|
! CHECK-32: %{{[0-9]+}} = fir.call @_FortranAExit(%[[status]]) {{.*}}: (i32) -> none
|
|
! CHECK-64: %{{[0-9]+}} = fir.call @_FortranAExit(%[[statusConv]]) {{.*}}: (i32) -> none
|
|
end subroutine exit_test2
|