blob: a4e548d3df87597d74bb11ba30d1b33bbf52448a [file] [log] [blame]
// RUN: %target-sil-opt %s
import Builtin
struct A {
var f : () -> ()
}
sil @callee_check : $@convention(thin) (@callee_guaranteed () -> ()) -> ()
sil @test1 : $@convention(thin) (@inout A) -> () {
bb0(%0 : $*A):
%1 = struct_element_addr %0 : $*A, #A.f
%2 = load %0 : $*A
%3 = struct_extract %2 : $A, #A.f
%4 = function_ref @callee_check : $@convention(thin) (@callee_guaranteed () -> ()) -> ()
apply %4(%3) : $@convention(thin) (@callee_guaranteed () -> ()) -> ()
%5 = tuple()
return %5 : $()
}
class B {
var f : () -> ()
init()
}
sil @test2 : $@convention(thin) (B) -> () {
bb0(%0 : $B):
%1 = ref_element_addr %0 : $B, #B.f
%5 = tuple()
return %5 : $()
}