blob: 1a5a7d99624c78263cff9179a28e1a87fa04b6c8 [file] [log] [blame]
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-module -Xfrontend -disable-diagnostic-passes -force-single-frontend-invocation -o %t/sil_box_types.swiftmodule %s
// RUN: %target-build-swift -emit-sil -I %t %s | %FileCheck %s
import Builtin
protocol P { }
protocol Q {
associatedtype AT
}
// CHECK-LABEL: sil @boxes : $@convention(thin) (<τ_0_0> { var τ_0_0 } <Builtin.Int32>, <τ_0_0> { var τ_0_0 } <Builtin.Int32>) -> () {
sil @boxes : $@convention(thin) (<τ_0_0> { var τ_0_0 } <Builtin.Int32>, _0_0> { var τ_0_0 } <Builtin.Int32>) -> () {
// CHECK: bb0(%0 : $<τ_0_0> { var τ_0_0 } <Builtin.Int32>, %1 : $<τ_0_0> { var τ_0_0 } <Builtin.Int32>):
entry(%0 : $_0_0> { var τ_0_0 } <Builtin.Int32>, %1 : $_0_0> { var τ_0_0 } <Builtin.Int32>):
return undef : $()
}
// CHECK-LABEL: sil @boxes_extra_reqs : $@convention(thin) <T where T : Q, T.AT : P> (@owned <τ_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>) -> () {
sil @boxes_extra_reqs : $@convention(thin) <T where T : Q, T.AT : P> (@owned _0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>) -> () {
// CHECK: bb0(%0 : $<τ_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>)
bb0(%0 : $_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>):
%1 = project_box %0 : $_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>, 0
return undef : $()
}