llvm-project/flang/test/Lower/control-flow.f90
Valentin Clement b914efc529
[flang][NFC] Add more lowering tests
This patch adds more lowering tests from the PFT to FIR.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D122354

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-24 00:09:06 +01:00

26 lines
531 B
Fortran

! Tests for control-flow
! RUN: bbc -emit-fir %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