-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][hlfir] Handle intrinsic subroutines
The code did not propagate the result optionality for subroutine. Make the result of genIntrinsicRef optional. Differential Revision: https://reviews.llvm.org/D143251
- Loading branch information
1 parent
8998fa6
commit c3645de
Showing
2 changed files
with
21 additions
and
5 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,14 @@ | ||
! Test lowering of intrinsic subroutines to HLFIR what matters here | ||
! is not to test each subroutine, but to check how their | ||
! lowering interfaces with the rest of lowering. | ||
! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s | ||
|
||
subroutine test_subroutine(x) | ||
real :: x | ||
call cpu_time(x) | ||
end subroutine | ||
! CHECK-LABEL: func.func @_QPtest_subroutine( | ||
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %{{.*}} | ||
! CHECK: %[[VAL_2:.*]] = fir.call @_FortranACpuTime() fastmath<contract> : () -> f64 | ||
! CHECK: %[[VAL_3:.*]] = fir.convert %[[VAL_2]] : (f64) -> f32 | ||
! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]]#1 : !fir.ref<f32> |