mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
393 lines
18 KiB
Plaintext
393 lines
18 KiB
Plaintext
// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name basic2
|
|
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.2.sib -module-name basic2
|
|
// RUN: %target-sil-opt -sil-print-types %t/tmp.2.sib -module-name basic2 -emit-sorted-sil | %FileCheck %s
|
|
|
|
import Builtin
|
|
import Swift
|
|
|
|
class C {}
|
|
class Klass {}
|
|
|
|
sil @getC : $@convention(thin) () -> (@owned C)
|
|
sil @getKlass : $@convention(thin) () -> (@owned Klass)
|
|
|
|
// CHECK-LABEL: sil [ossa] @ignored_use_test : $@convention(thin) (@guaranteed Klass) -> () {
|
|
// CHECK: ignored_use %0 : $Klass
|
|
// CHECK: } // end sil function 'ignored_use_test'
|
|
sil [ossa] @ignored_use_test : $@convention(thin) (@guaranteed Klass) -> () {
|
|
bb0(%0 : @guaranteed $Klass):
|
|
ignored_use %0 : $Klass
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @merge_isolation_region : $@convention(thin) (@guaranteed Klass) -> () {
|
|
// CHECK: merge_isolation_region %0 : $Klass, %1 : $*C
|
|
// CHECK: merge_isolation_region %1 : $*C, %0 : $Klass, %0 : $Klass
|
|
// CHECK: } // end sil function 'merge_isolation_region'
|
|
sil [ossa] @merge_isolation_region : $@convention(thin) (@guaranteed Klass) -> () {
|
|
bb0(%0 : @guaranteed $Klass):
|
|
%1 = alloc_stack $C
|
|
merge_isolation_region %0 : $Klass, %1 : $*C
|
|
merge_isolation_region %1 : $*C, %0 : $Klass, %0 : $Klass
|
|
dealloc_stack %1 : $*C
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_allocbox_moveable_value_debuginfo_flag : $@convention(thin) () -> () {
|
|
// CHECK: alloc_box [moveable_value_debuginfo] ${ var Builtin.NativeObject }
|
|
// CHECK: } // end sil function 'test_allocbox_moveable_value_debuginfo_flag'
|
|
sil [ossa] @test_allocbox_moveable_value_debuginfo_flag : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_box [moveable_value_debuginfo] ${ var Builtin.NativeObject }
|
|
dealloc_box %0 : ${ var Builtin.NativeObject }
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_copyable_to_moveonlywrapper : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
// CHECK: copyable_to_moveonlywrapper [owned]
|
|
// CHECK: } // end sil function 'test_copyable_to_moveonlywrapper'
|
|
sil [ossa] @test_copyable_to_moveonlywrapper : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
bb0(%0 : @owned $Builtin.NativeObject):
|
|
%0a = copyable_to_moveonlywrapper [owned] %0 : $Builtin.NativeObject
|
|
destroy_value %0a : $@moveOnly Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_copyable_to_moveonlywrapper_addr : $@convention(thin) (@in Builtin.NativeObject) -> () {
|
|
// CHECK: copyable_to_moveonlywrapper_addr
|
|
// CHECK: } // end sil function 'test_copyable_to_moveonlywrapper_addr'
|
|
sil [ossa] @test_copyable_to_moveonlywrapper_addr : $@convention(thin) (@in Builtin.NativeObject) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject):
|
|
%0a = copyable_to_moveonlywrapper_addr %0 : $*Builtin.NativeObject
|
|
destroy_addr %0a : $*@moveOnly Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_dealloc_box : {{.*}} {
|
|
// CHECK: cond_br undef, [[EXIT:bb[0-9]+]], [[DIE:bb[0-9]+]]
|
|
// CHECK: [[DIE]]:
|
|
// CHECK: dealloc_box [dead_end]
|
|
// CHECK: unreachable
|
|
// CHECK: [[EXIT]]:
|
|
// CHECK: dealloc_box
|
|
// CHECK-LABEL: } // end sil function 'test_dealloc_box'
|
|
sil [ossa] @test_dealloc_box : $@convention(thin) () -> () {
|
|
entry:
|
|
%b = alloc_box ${ var C }
|
|
cond_br undef, exit, die
|
|
|
|
exit:
|
|
dealloc_box %b : ${ var C }
|
|
%retval = tuple()
|
|
return %retval : $()
|
|
|
|
die:
|
|
dealloc_box [dead_end] %b : ${ var C }
|
|
unreachable
|
|
}
|
|
|
|
// We don't serialize debug_value today... but we should.
|
|
//
|
|
// CHECK-LABEL: sil [ossa] @test_debug_value_alloc_stack_moved : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
// CHECK: %1 = alloc_stack [moveable_value_debuginfo] $Builtin.NativeObject
|
|
// CHECK: } // end sil function 'test_debug_value_alloc_stack_moved'
|
|
sil [ossa] @test_debug_value_alloc_stack_moved : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
bb0(%0 : @owned $Builtin.NativeObject):
|
|
debug_value [moveable_value_debuginfo] %0 : $Builtin.NativeObject
|
|
debug_value [poison] %0 : $Builtin.NativeObject
|
|
debug_value [moveable_value_debuginfo] [poison] %0 : $Builtin.NativeObject
|
|
debug_value [poison] [moveable_value_debuginfo] %0 : $Builtin.NativeObject
|
|
|
|
%1 = alloc_stack [moveable_value_debuginfo] $Builtin.NativeObject
|
|
dealloc_stack %1 : $*Builtin.NativeObject
|
|
|
|
destroy_value %0 : $Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_destroy_value : {{.*}} {
|
|
// CHECK: cond_br undef, [[GOOD:bb[0-9]+]], [[BAD:bb[0-9]+]]
|
|
// CHECK: [[BAD]]:
|
|
// CHECK: cond_br undef, [[BLEFT:bb[0-9]+]], [[BRIGHT:bb[0-9]+]]
|
|
// CHECK: [[BRIGHT]]:
|
|
// CHECK: %3 = apply %0()
|
|
// CHECK: destroy_value [poison] [dead_end] %3
|
|
// CHECK: unreachable
|
|
// CHECK: [[BLEFT]]:
|
|
// CHECK: %6 = apply %0()
|
|
// CHECK: destroy_value [dead_end] %6
|
|
// CHECK: unreachable
|
|
// CHECK: [[GOOD]]:
|
|
// CHECK: cond_br undef, [[GLEFT:bb[0-9]+]], [[GRIGHT:bb[0-9]+]]
|
|
// CHECK: [[GRIGHT]]:
|
|
// CHECK: %10 = apply %0()
|
|
// CHECK: destroy_value [poison] %10
|
|
// CHECK: br [[EXIT:bb[0-9]+]]
|
|
// CHECK: [[GLEFT]]:
|
|
// CHECK: %13 = apply %0()
|
|
// CHECK: destroy_value %13
|
|
// CHECK: br [[EXIT]]
|
|
// CHECK: [[EXIT]]:
|
|
// CHECK-LABEL: } // end sil function 'test_destroy_value'
|
|
sil [ossa] @test_destroy_value : $@convention(thin) () -> () {
|
|
entry:
|
|
%getC = function_ref @getC : $@convention(thin) () -> (@owned C)
|
|
cond_br undef, good, bad
|
|
|
|
good:
|
|
cond_br undef, gleft, gright
|
|
gleft:
|
|
%k1 = apply %getC() : $@convention(thin) () -> (@owned C)
|
|
destroy_value %k1 : $C
|
|
br exit
|
|
gright:
|
|
%k2 = apply %getC() : $@convention(thin) () -> (@owned C)
|
|
destroy_value [poison] %k2 : $C
|
|
br exit
|
|
exit:
|
|
%retval = tuple()
|
|
return %retval : $()
|
|
bad:
|
|
cond_br undef, bleft, bright
|
|
bleft:
|
|
%k3 = apply %getC() : $@convention(thin) () -> (@owned C)
|
|
destroy_value [dead_end] %k3 : $C
|
|
unreachable
|
|
bright:
|
|
%k4 = apply %getC() : $@convention(thin) () -> (@owned C)
|
|
destroy_value [poison] [dead_end] %k4 : $C
|
|
unreachable
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_explicit_copy_addr : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
// CHECK: explicit_copy_addr %{{[0-9]+}} to [init] %{{[0-9]+}} :
|
|
// CHECK: explicit_copy_addr [take] %{{[0-9]+}} to [init] %{{[0-9]+}} :
|
|
// CHECK: explicit_copy_addr [take] %{{[0-9]+}} to %{{[0-9]+}} :
|
|
// CHECK: explicit_copy_addr %{{[0-9]+}} to %{{[0-9]+}} :
|
|
// CHECK: } // end sil function 'test_explicit_copy_addr'
|
|
sil [ossa] @test_explicit_copy_addr : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
bb0(%0 : @owned $Builtin.NativeObject):
|
|
%1 = alloc_stack $Builtin.NativeObject
|
|
%2 = alloc_stack $Builtin.NativeObject
|
|
%3 = alloc_stack $Builtin.NativeObject
|
|
|
|
%0a = copy_value %0 : $Builtin.NativeObject
|
|
store %0a to [init] %1 : $*Builtin.NativeObject
|
|
explicit_copy_addr %1 to [init] %2 : $*Builtin.NativeObject
|
|
explicit_copy_addr [take] %2 to [init] %3 : $*Builtin.NativeObject
|
|
explicit_copy_addr [take] %3 to %1 : $*Builtin.NativeObject
|
|
|
|
store %0 to [init] %2 : $*Builtin.NativeObject
|
|
explicit_copy_addr %1 to %2 : $*Builtin.NativeObject
|
|
|
|
destroy_addr %2 : $*Builtin.NativeObject
|
|
destroy_addr %1 : $*Builtin.NativeObject
|
|
dealloc_stack %3 : $*Builtin.NativeObject
|
|
dealloc_stack %2 : $*Builtin.NativeObject
|
|
dealloc_stack %1 : $*Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_extend_lifetime : {{.*}} {
|
|
// CHECK: bb0([[K:%[^,]+]] :
|
|
// CHECK: br [[LOOP:bb[0-9]+]]
|
|
// CHECK: [[LOOP]]:
|
|
// CHECK: extend_lifetime [[K]]
|
|
// CHECK: br [[LOOP]]
|
|
// CHECK-LABEL: } // end sil function 'test_extend_lifetime'
|
|
sil [ossa] @test_extend_lifetime : $@convention(thin) (@owned Builtin.NativeObject) -> () {
|
|
entry(%k : @owned $Builtin.NativeObject):
|
|
br bb1
|
|
bb1:
|
|
extend_lifetime %k : $Builtin.NativeObject
|
|
br bb1
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_mark_dependence : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> () {
|
|
// CHECK: [[MD1:%.*]] = mark_dependence %1 : $Builtin.NativeObject on %0 : $Builtin.NativeObject
|
|
// CHECK: [[MD2:%.*]] = mark_dependence [nonescaping] [[MD1]] : $Builtin.NativeObject on %0 : $Builtin.NativeObject
|
|
// CHECK: mark_dependence [unresolved] [[MD2]] : $Builtin.NativeObject on %0 : $Builtin.NativeObject
|
|
// CHECK: } // end sil function 'test_mark_dependence'
|
|
sil [ossa] @test_mark_dependence : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> () {
|
|
bb0(%0 : @owned $Builtin.NativeObject, %1 : @owned $Builtin.NativeObject):
|
|
%md1 = mark_dependence %1 : $Builtin.NativeObject on %0 : $Builtin.NativeObject
|
|
%md2 = mark_dependence [nonescaping] %md1 : $Builtin.NativeObject on %0 : $Builtin.NativeObject
|
|
%md3 = mark_dependence [unresolved] %md2 : $Builtin.NativeObject on %0 : $Builtin.NativeObject
|
|
destroy_value %md3 : $Builtin.NativeObject
|
|
destroy_value %0 : $Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_mark_dependence_addr : $@convention(thin) (@in Builtin.NativeObject, @in Builtin.NativeObject) -> () {
|
|
// CHECK: mark_dependence_addr %1 : $*Builtin.NativeObject on %0 : $*Builtin.NativeObject
|
|
// CHECK: mark_dependence_addr [nonescaping] %1 : $*Builtin.NativeObject on %0 : $*Builtin.NativeObject
|
|
// CHECK: mark_dependence_addr [unresolved] %1 : $*Builtin.NativeObject on %0 : $*Builtin.NativeObject
|
|
// CHECK: } // end sil function 'test_mark_dependence_addr'
|
|
sil [ossa] @test_mark_dependence_addr : $@convention(thin) (@in Builtin.NativeObject, @in Builtin.NativeObject) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject, %1 : $*Builtin.NativeObject):
|
|
mark_dependence_addr %1 : $*Builtin.NativeObject on %0 : $*Builtin.NativeObject
|
|
mark_dependence_addr [nonescaping] %1 : $*Builtin.NativeObject on %0 : $*Builtin.NativeObject
|
|
mark_dependence_addr [unresolved] %1 : $*Builtin.NativeObject on %0 : $*Builtin.NativeObject
|
|
destroy_addr %1 : $*Builtin.NativeObject
|
|
destroy_addr %0 : $*Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_moveonlywrapper_to_copyable_addr : $@convention(thin) (@in Builtin.NativeObject) -> () {
|
|
// CHECK: moveonlywrapper_to_copyable_addr
|
|
// CHECK: } // end sil function 'test_moveonlywrapper_to_copyable_addr'
|
|
sil [ossa] @test_moveonlywrapper_to_copyable_addr : $@convention(thin) (@in Builtin.NativeObject) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject):
|
|
%1 = alloc_stack $@moveOnly Builtin.NativeObject
|
|
%1a = moveonlywrapper_to_copyable_addr %1 : $*@moveOnly Builtin.NativeObject
|
|
copy_addr [take] %0 to [init] %1a : $*Builtin.NativeObject
|
|
destroy_addr %1 : $*@moveOnly Builtin.NativeObject
|
|
dealloc_stack %1 : $*@moveOnly Builtin.NativeObject
|
|
%9999 = tuple()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_moveonlywrapper_to_copyable_box : $@convention(thin) () -> () {
|
|
// CHECK: [[BOX:%.*]] = alloc_box ${ var @moveOnly Builtin.NativeObject }
|
|
// CHECK: [[CAST:%.*]] = moveonlywrapper_to_copyable_box [[BOX]] : ${ var @moveOnly Builtin.NativeObject }
|
|
// CHECK: dealloc_box [[CAST]] : ${ var Builtin.NativeObject }
|
|
// CHECK: } // end sil function 'test_moveonlywrapper_to_copyable_box'
|
|
sil [ossa] @test_moveonlywrapper_to_copyable_box : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_box ${ var @moveOnly Builtin.NativeObject }
|
|
%1 = moveonlywrapper_to_copyable_box %0 : ${ var @moveOnly Builtin.NativeObject }
|
|
dealloc_box %1 : ${ var Builtin.NativeObject }
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @test_type_value : $@convention(thin) <let N : Int> () -> Int {
|
|
// CHECK: [[VAL:%.*]] = type_value $Int for N
|
|
// CHECK: return [[VAL]] : $Int
|
|
// CHECK-LABEL: } // end sil function 'test_type_value'
|
|
sil [ossa] @test_type_value : $@convention(thin) <let N : Int> () -> Int {
|
|
entry:
|
|
%val = type_value $Int for N
|
|
return %val : $Int
|
|
}
|
|
|
|
// CHECK-LABEL: sil @thunk_inst : $@convention(thin) () -> () {
|
|
// CHECK: [[FUNC:%[0-9]+]] = function_ref @getKlass : $@convention(thin) () -> @owned Klass
|
|
// CHECK: %{{.*}} = thunk [identity] [[FUNC]]() : $@convention(thin) () -> @owned Klass
|
|
// CHECK: } // end sil function 'thunk_inst'
|
|
sil @thunk_inst : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = function_ref @getKlass : $@convention(thin) () -> (@owned Klass)
|
|
%1 = thunk [identity] %0() : $@convention(thin) () -> @owned Klass
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @thunk_inst_ossa : $@convention(thin) () -> () {
|
|
// CHECK: [[FUNC:%[0-9]+]] = function_ref @getKlass : $@convention(thin) () -> @owned Klass
|
|
// CHECK: %{{.*}} = thunk [identity] [[FUNC]]() : $@convention(thin) () -> @owned Klass
|
|
// CHECK: } // end sil function 'thunk_inst_ossa'
|
|
sil [ossa] @thunk_inst_ossa : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = function_ref @getKlass : $@convention(thin) () -> @owned Klass
|
|
%1 = thunk [identity] %0() : $@convention(thin) () -> @owned Klass
|
|
destroy_value %1 : $@callee_guaranteed () -> @owned Klass
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
sil @generic_func : $@convention(thin) <T> (@in T) -> ()
|
|
|
|
// CHECK-LABEL: sil [ossa] @thunk_inst_ossa_generic : $@convention(thin) () -> () {
|
|
// CHECK: [[FUNC:%[0-9]+]] = function_ref @generic_func : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
|
|
// CHECK: {{%.*}} = thunk [identity] [[FUNC]]<Klass>() : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
|
|
// CHECK: } // end sil function 'thunk_inst_ossa_generic'
|
|
sil [ossa] @thunk_inst_ossa_generic : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = function_ref @generic_func : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
|
|
%1 = thunk [identity] %0<Klass>() : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
|
|
destroy_value %1 : $@callee_guaranteed (@in Klass) -> ()
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @tuple_addr_constructor_assign : $@convention(thin) (@in Builtin.NativeObject, @in (Builtin.NativeObject, Builtin.NativeObject)) -> () {
|
|
// CHECK: bb0([[LHS:%.*]] : $*Builtin.NativeObject,
|
|
// CHECK: [[RHS:%.*]] = alloc_stack $Builtin.NativeObject
|
|
// CHECK: [[DEST:%.*]] = alloc_stack $(Builtin.NativeObject, Builtin.NativeObject)
|
|
// CHECK: tuple_addr_constructor [assign] [[DEST]] : $*(Builtin.NativeObject, Builtin.NativeObject) with ([[LHS]] : $*Builtin.NativeObject, [[RHS]] : $*Builtin.NativeObject)
|
|
// CHECK: } // end sil function 'tuple_addr_constructor_assign'
|
|
sil [ossa] @tuple_addr_constructor_assign : $@convention(thin) (@in Builtin.NativeObject, @in (Builtin.NativeObject, Builtin.NativeObject)) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject, %0a : $*(Builtin.NativeObject, Builtin.NativeObject)):
|
|
%1 = alloc_stack $Builtin.NativeObject
|
|
copy_addr %0 to [init] %1 : $*Builtin.NativeObject
|
|
%2 = alloc_stack $(Builtin.NativeObject, Builtin.NativeObject)
|
|
copy_addr [take] %0a to [init] %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
tuple_addr_constructor [assign] %2 : $*(Builtin.NativeObject, Builtin.NativeObject) with (%0 : $*Builtin.NativeObject, %1 : $*Builtin.NativeObject)
|
|
destroy_addr %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
destroy_addr %1 : $*Builtin.NativeObject
|
|
dealloc_stack %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
dealloc_stack %1 : $*Builtin.NativeObject
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
|
|
// CHECK-LABEL: sil [ossa] @tuple_addr_constructor_differing_category : $@convention(thin) (@in Builtin.NativeObject, @owned Builtin.NativeObject) -> () {
|
|
// CHECK: bb0([[LHS:%.*]] : $*Builtin.NativeObject, [[RHS:%.*]] : @owned $Builtin.NativeObject)
|
|
// CHECK: [[DEST:%.*]] = alloc_stack $(Builtin.NativeObject, Builtin.NativeObject)
|
|
// CHECK: tuple_addr_constructor [init] [[DEST]] : $*(Builtin.NativeObject, Builtin.NativeObject) with ([[LHS]] : $*Builtin.NativeObject, [[RHS]] : $Builtin.NativeObject)
|
|
// CHECK: } // end sil function 'tuple_addr_constructor_differing_category'
|
|
sil [ossa] @tuple_addr_constructor_differing_category : $@convention(thin) (@in Builtin.NativeObject, @owned Builtin.NativeObject) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject, %1 : @owned $Builtin.NativeObject):
|
|
%2 = alloc_stack $(Builtin.NativeObject, Builtin.NativeObject)
|
|
tuple_addr_constructor [init] %2 : $*(Builtin.NativeObject, Builtin.NativeObject) with (%0 : $*Builtin.NativeObject, %1 : $Builtin.NativeObject)
|
|
destroy_addr %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
dealloc_stack %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @tuple_addr_constructor_init : $@convention(thin) (@in Builtin.NativeObject) -> () {
|
|
// CHECK: bb0([[LHS:%.*]] : $*
|
|
// CHECK: [[RHS:%.*]] = alloc_stack $Builtin.NativeObject
|
|
// CHECK: [[DEST:%.*]] = alloc_stack $(Builtin.NativeObject, Builtin.NativeObject)
|
|
// CHECK: tuple_addr_constructor [init] [[DEST]] : $*(Builtin.NativeObject, Builtin.NativeObject) with ([[LHS]] : $*Builtin.NativeObject, [[RHS]] : $*Builtin.NativeObject)
|
|
// CHECK: } // end sil function 'tuple_addr_constructor_init'
|
|
sil [ossa] @tuple_addr_constructor_init : $@convention(thin) (@in Builtin.NativeObject) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject):
|
|
%1 = alloc_stack $Builtin.NativeObject
|
|
copy_addr %0 to [init] %1 : $*Builtin.NativeObject
|
|
%2 = alloc_stack $(Builtin.NativeObject, Builtin.NativeObject)
|
|
tuple_addr_constructor [init] %2 : $*(Builtin.NativeObject, Builtin.NativeObject) with (%0 : $*Builtin.NativeObject, %1 : $*Builtin.NativeObject)
|
|
destroy_addr %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
dealloc_stack %2 : $*(Builtin.NativeObject, Builtin.NativeObject)
|
|
dealloc_stack %1 : $*Builtin.NativeObject
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|
|
// CHECK-LABEL: sil [ossa] @tuple_addr_constructor_unfriendly_tuple : $@convention(thin) (@in Builtin.NativeObject, @owned Builtin.NativeObject) -> () {
|
|
// CHECK: tuple_addr_constructor [init] {{%.*}} : $*((), (Builtin.NativeObject, Builtin.NativeObject)) with
|
|
sil [ossa] @tuple_addr_constructor_unfriendly_tuple : $@convention(thin) (@in Builtin.NativeObject, @owned Builtin.NativeObject) -> () {
|
|
bb0(%0 : $*Builtin.NativeObject, %1 : @owned $Builtin.NativeObject):
|
|
%2 = alloc_stack $((), (Builtin.NativeObject, Builtin.NativeObject))
|
|
tuple_addr_constructor [init] %2 : $*((), (Builtin.NativeObject, Builtin.NativeObject)) with (%0 : $*Builtin.NativeObject, %1 : $Builtin.NativeObject)
|
|
destroy_addr %2 : $*((), (Builtin.NativeObject, Builtin.NativeObject))
|
|
dealloc_stack %2 : $*((), (Builtin.NativeObject, Builtin.NativeObject))
|
|
%9999 = tuple ()
|
|
return %9999 : $()
|
|
}
|
|
|