Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
4d323f4
commit 96fd54c
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
! 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 |