llvm-capstone/flang/test/Lower/call-by-value.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

21 lines
668 B
Fortran

! Test for PassBy::Value
! RUN: bbc -emit-fir %s -o - | FileCheck %s
program call_by_value
interface
subroutine omp_set_nested(enable) bind(c)
logical, value :: enable
end subroutine omp_set_nested
end interface
logical do_nested
do_nested = .FALSE.
call omp_set_nested(do_nested)
end program call_by_value
!CHECK-LABEL: func @_QQmain()
!CHECK: %[[LOGICAL:.*]] = fir.alloca !fir.logical<4>
!CHECK: %false = arith.constant false
!CHECK: %[[VALUE:.*]] = fir.convert %false : (i1) -> !fir.logical<4>
!CHECK: fir.store %[[VALUE]] to %[[LOGICAL]]
!CHECK: %[[LOAD:.*]] = fir.load %[[LOGICAL]]
!CHECK: fir.call @omp_set_nested(%[[LOAD]]) : {{.*}}