llvm-project/flang/test/Lower/call-implicit.f90
Valentin Clement e28e1b4b6d
[flang][NFC] Add call lowering tests
This patch adds various lowering test
for calls.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Mats Petersson <mats.petersson@arm.com>
2022-03-23 15:27:17 +01:00

15 lines
793 B
Fortran

! RUN: bbc %s -o "-" -emit-fir | FileCheck %s
! Test lowering of calls to procedures with implicit interfaces using different
! calls with different argument types, one of which is character
subroutine s2
integer i(3)
! CHECK: %[[a0:.*]] = fir.alloca !fir.array<3xi32> {bindc_name = "i", uniq_name = "_QFs2Ei"}
! CHECK: fir.call @_QPsub2(%[[a0]]) : (!fir.ref<!fir.array<3xi32>>) -> ()
call sub2(i)
! CHECK: %[[a1:.*]] = fir.address_of(@_QQcl.3031323334) : !fir.ref<!fir.char<1,5>>
! CHECK: %[[a2:.*]] = fir.convert %[[a1]] : (!fir.ref<!fir.char<1,5>>) -> !fir.ref<!fir.char<1,?>>
! CHECK: %[[a3:.*]] = fir.convert %[[a2]] : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<3xi32>>
! CHECK: fir.call @_QPsub2(%[[a3]]) : (!fir.ref<!fir.array<3xi32>>) -> ()
call sub2("01234")
end