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.
26 lines
544 B
Fortran
26 lines
544 B
Fortran
! Tests for control-flow
|
|
|
|
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
|
|
|
|
! check the lowering of a RETURN in the body of a SUBROUTINE
|
|
! CHECK-LABEL one
|
|
subroutine one(a,b,c)
|
|
d = 1.0
|
|
if (a .ne. b) then
|
|
! CHECK: call @_QPone_a
|
|
call one_a(d)
|
|
! CHECK: cond_br %{{.*}}, ^bb[[TB:.*]], ^
|
|
if (d .eq. 1.0) then
|
|
! CHECK-NEXT: ^bb[[TB]]:
|
|
! CHECK-NEXT: br ^bb[[EXIT:.*]]
|
|
return
|
|
endif
|
|
else
|
|
e = 4.0
|
|
call one_b(c,d,e)
|
|
endif
|
|
! CHECK: ^bb[[EXIT]]:
|
|
! CHECK-NEXT: return
|
|
end subroutine one
|
|
|