Files
clang-p2996/flang/test/Lower/Intrinsics/present.f90
Valentin Clement 96fd54c964 [flang] Lower present intrinsic
This patch adds lowering for the `present` intrinsic.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 13:19:40 +01:00

11 lines
315 B
Fortran

! RUN: bbc -emit-fir %s -o - | FileCheck %s
! CHECK-LABEL: present_test
! CHECK-SAME: %[[arg0:[^:]+]]: !fir.box<!fir.array<?xi32>>
subroutine present_test(a)
integer, optional :: a(:)
if (present(a)) print *,a
! CHECK: %{{.*}} = fir.is_present %[[arg0]] : (!fir.box<!fir.array<?xi32>>) -> i1
end subroutine