Files
swift-mirror/test/SILOptimizer/closure_specialize_fragile.swift
Slava Pestov 890958ebfd SILOptimizer: Fix bug in closure specialization with resilient build
Fixes <rdar://problem/30480013>.
2017-02-12 23:39:07 -08:00

20 lines
725 B
Swift

// RUN: %target-swift-frontend -Xllvm -new-mangling-for-tests %s -emit-sil -O -o - -verify | %FileCheck %s
// Make sure we do not specialize resilientCallee.
// CHECK-LABEL: sil [fragile] [always_inline] @_T026closure_specialize_fragile0C6CalleryyF : $@convention(thin) () -> ()
// CHECK: function_ref @_T026closure_specialize_fragile15resilientCalleeyyyc2fn_tF : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
// CHECK: return
@inline(__always) public func fragileCaller() {
resilientCallee {
print("Hi")
}
}
// CHECK-LABEL: sil @_T026closure_specialize_fragile15resilientCalleeyyyc2fn_tF : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
public func resilientCallee(fn: () -> ()) {
fn()
}