// RUN: %target-sil-opt -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only | %FileCheck %s sil_stage raw protocol P {} sil [ossa] @callWithAutoclosure_3 : $@convention(thin) (@in T) -> () { bb0(%0 : $*T): debug_value %0 : $*T, expr op_deref %2 = function_ref @mightApply : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned @callee_owned () -> @out τ_0_0) -> () %3 = function_ref @closure_to_specialize : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned <τ_0_0> { var τ_0_0 } <τ_0_0>) -> @out τ_0_0 %4 = alloc_box $<τ_0_0> { var τ_0_0 } %4c = mark_uninitialized [var] %4 : $<τ_0_0> { var τ_0_0 } %4a = project_box %4c : $<τ_0_0> { var τ_0_0 } , 0 %4copy = copy_value %4c : $<τ_0_0> { var τ_0_0 } copy_addr %0 to [init] %4a : $*T %6 = partial_apply %3(%4copy) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned <τ_0_0> { var τ_0_0 } <τ_0_0>) -> @out τ_0_0 %7 = apply %2(%6) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned @callee_owned () -> @out τ_0_0) -> () destroy_addr %0 : $*T destroy_value %4c : $<τ_0_0> { var τ_0_0 } %9 = tuple () return %9 : $() } // CHECK-LABEL: sil {{.*}}@$s21closure_to_specializeTf0ns_n : {{.*}}{ // CHECK: {{bb[0-9]+}}({{%[^,]+}} : @_eagerMove $*T, {{%[^,]+}} : @_eagerMove $ // CHECK-LABEL: } // end sil function '$s21closure_to_specializeTf0ns_n' sil shared [ossa] @closure_to_specialize : $@convention(thin) (@owned <τ_0_0> { var τ_0_0 } ) -> @out T { bb0(%0 : @_eagerMove $*T, %1 : @_eagerMove @owned $<τ_0_0> { var τ_0_0 } ): %2 = project_box %1 : $<τ_0_0> { var τ_0_0 } , 0 copy_addr %2 to [init] %0 : $*T destroy_value %1 : $<τ_0_0> { var τ_0_0 } %5 = tuple () return %5 : $() } sil [transparent] [serialized] [ossa] @mightApply : $@convention(thin) (@owned @callee_owned () -> @out U) -> () { bb0(%0 : @owned $@callee_owned () -> @out U): debug_value %0 : $@callee_owned () -> @out U %1 = copy_value %0 : $@callee_owned () -> @out U %3 = alloc_stack $U %4 = apply %1(%3) : $@callee_owned () -> @out U destroy_addr %3 : $*U dealloc_stack %3 : $*U destroy_value %0 : $@callee_owned () -> @out U %8 = tuple () return %8 : $() }