Skip to content

Add a test for PR #72617 #76261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions test/IRGen/loadable_by_address_reg2mem.sil
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ struct X {
var x16: Int
}

struct X2 {
var x1 : Int
var x2 : Int
var x3 : Int
var x4: Int
var x5: Int
var x6: Int
var x7: Int
var x8: Int
var x9: Int
var x10: Int
var x11: Int
var x12: Int
var x13: Int
var x14: Int
var x15: Int
var x16: Int
}

struct Y {
var y1 : X
var y2: X
Expand Down Expand Up @@ -314,3 +333,21 @@ bb0:
%t = tuple ()
return %t : $()
}

// CHECK: sil @test13
// CHECK: [[ADDR:%.*]] = unchecked_addr_cast %1 : $*X to $*Y
// CHECK: copy_addr [take] [[ADDR]] to [init] %2 : $*Y
// CHECK: } // end sil function 'test13'
sil @test13 : $@convention(thin) (@in X) -> () {
bb0(%0 : $*X):
%1 = alloc_stack $Y
%2 = alloc_stack $X
copy_addr [take] %0 to [init] %2 : $*X
%4 = load %2 : $*X
%7 = unchecked_bitwise_cast %4 : $X to $Y
store %7 to %1: $*Y
%13 = tuple ()
dealloc_stack %2 : $*X
dealloc_stack %1 : $*Y
return %13 : $()
}