Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Embox argument for assumed type dummy argument to !fir.box<none>
When passing an argument to an assumed type dummy argument, embox it directly to a !fir.box<none> box. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D146207
- Loading branch information
1 parent
c3a6bea
commit b52e974
Showing
4 changed files
with
35 additions
and
8 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
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,23 @@ | ||
! RUN: bbc -polymorphic-type -emit-fir %s -o - | FileCheck %s | ||
|
||
module assumed_type_test | ||
|
||
interface | ||
subroutine assumed(a) | ||
type(*), intent(in), target :: a | ||
end subroutine | ||
end interface | ||
|
||
contains | ||
|
||
subroutine call_assmued() | ||
integer, target :: i | ||
call assumed(i) | ||
end subroutine | ||
|
||
! CHECK-LABEL: func.func @_QMassumed_type_testPcall_assmued() { | ||
! CHECK: %[[I:.*]] = fir.alloca i32 {bindc_name = "i", fir.target, uniq_name = "_QMassumed_type_testFcall_assmuedEi"} | ||
! CHECK: %[[BOX_NONE:.*]] = fir.embox %[[I]] : (!fir.ref<i32>) -> !fir.box<none> | ||
! CHECK: fir.call @_QPassumed(%[[BOX_NONE]]) fastmath<contract> : (!fir.box<none>) -> () | ||
|
||
end module |