blob: 22453d11bbb42cebe31c56ec525b09d2535827a8 [file] [log] [blame]
// RUN: %target-swift-frontend %s -emit-silgen | %FileCheck %s
import Swift
// CHECK-LABEL: sil @alloc_dealloc : $@convention(thin) (Int) -> () {
sil @alloc_dealloc : $@convention(thin) (Int) -> () {
entry(%x : $Int):
// CHECK: [[B:%.*]] = alloc_box $<τ_0_0> { var τ_0_0 } <Int>
%b = alloc_box $_0_0> { var τ_0_0 } <Int>
// CHECK: [[PB:%.*]] = project_box [[B]] : $<τ_0_0> { var τ_0_0 } <Int>, 0
%ba = project_box %b : $_0_0> { var τ_0_0 } <Int>, 0
// CHECK: store [[X:%.*]] to [trivial] [[PB]] : $*Int
store %x to [trivial] %ba : $*Int
// CHECK: dealloc_box [[B]] : $<τ_0_0> { var τ_0_0 } <Int>
dealloc_box %b : $_0_0> { var τ_0_0 } <Int>
return undef : $()
}