bolt/deps/llvm-18.1.8/flang/test/Lower/Intrinsics/present.f90
2025-02-14 19:21:04 +01:00

10 lines
328 B
Fortran

! RUN: bbc -emit-fir -hlfir=false %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