blob: bb7d3e6808798943e97fa93b58af608bde1ebaf0 [file] [log] [blame]
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -external-func-definition-elim | %FileCheck %s
sil_stage canonical
import Builtin
import Swift
import SwiftShims
public class X {
func testit() -> () -> ()
deinit
init()
}
// Check if we keep the body of the externally available transparent function.
// CHECK-LABEL: sil public_external [transparent] [serialized] @imported_transparent_func : $@convention(thin) () -> () {
sil public_external [transparent] [serialized] @imported_transparent_func : $@convention(thin) () -> () {
bb0:
%r = tuple ()
return %r : $()
}
sil private @_TFC4test1X6testitfT_FT_T_ : $@convention(method) (@guaranteed X) -> @owned @callee_owned () -> () {
bb0(%0 : $X):
%6 = function_ref @imported_transparent_func : $@convention(thin) () -> ()
%7 = thin_to_thick_function %6 : $@convention(thin) () -> () to $@callee_owned () -> ()
return %7 : $@callee_owned () -> ()
}
sil @_TFC4test1XD : $@convention(method) (@owned X) -> ()
sil_vtable X {
#X.testit!1: _TFC4test1X6testitfT_FT_T_
#X.deinit!deallocator: _TFC4test1XD
}