forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This wasn't properly remapping the type like with the other attributes, so this would end up hitting a verifier error after linking different modules using byref. (cherry picked from commit c5ce603) Change-Id: Ifcf82db3941a2ada745b2e399e2d8a07834ce4e6
- Loading branch information
1 parent
2d3a36f
commit dac2bfc
Showing
7 changed files
with
99 additions
and
63 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,13 @@ | ||
%a = type { i64 } | ||
%struct = type { i32, i8 } | ||
|
||
define void @g(%a* byref(%a)) { | ||
ret void | ||
} | ||
|
||
declare void @baz(%struct* byref(%struct)) | ||
|
||
define void @foo(%struct* byref(%struct) %a) { | ||
call void @baz(%struct* byref(%struct) %a) | ||
ret void | ||
} |
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,25 @@ | ||
; RUN: llvm-link %s %p/Inputs/byref-type-input.ll -S | FileCheck %s | ||
|
||
%a = type { i64 } | ||
%struct = type { i32, i8 } | ||
|
||
; CHECK-LABEL: define void @f(%a* byref(%a) %0) | ||
define void @f(%a* byref(%a)) { | ||
ret void | ||
} | ||
|
||
; CHECK-LABEL: define void @bar( | ||
; CHECK: call void @foo(%struct* byref(%struct) %ptr) | ||
define void @bar() { | ||
%ptr = alloca %struct | ||
call void @foo(%struct* byref(%struct) %ptr) | ||
ret void | ||
} | ||
|
||
; CHECK-LABEL: define void @g(%a* byref(%a) %0) | ||
|
||
; CHECK-LABEL: define void @foo(%struct* byref(%struct) %a) | ||
; CHECK-NEXT: call void @baz(%struct* byref(%struct) %a) | ||
declare void @foo(%struct* byref(%struct) %a) | ||
|
||
; CHECK: declare void @baz(%struct* byref(%struct)) |
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