forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixlifetime.sil
47 lines (41 loc) · 2.43 KB
/
fixlifetime.sil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// RUN: %target-swift-frontend -parse-sil -emit-ir %s | FileCheck --check-prefix=CHECK-%target-runtime %s
// REQUIRES: CPU=i386_or_x86_64
// CHECK-objc-LABEL: define void @test(%C11fixlifetime1C*, %objc_object*, i8**, i8*, %swift.refcounted*, %V11fixlifetime3Agg* noalias nocapture dereferenceable({{.*}})) {{.*}} {
// CHECK-objc: entry:
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%objc_object*)*)(%objc_object*
// CHECK-objc: call void @swift_fixLifetime(%swift.refcounted*
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%objc_object*)*)(%objc_object*
// CHECK-objc: call void @swift_fixLifetime(%swift.refcounted*
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C**)*)(%C11fixlifetime1C**
// CHECK-native-LABEL: define void @test(%C11fixlifetime1C*, %swift.refcounted*, i8**, i8*, %swift.refcounted*, %V11fixlifetime3Agg* noalias nocapture dereferenceable({{.*}})) {{.*}} {
// CHECK-native: entry:
// CHECK-native: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
// CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
// CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
// CHECK-native: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
// CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
// CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
// CHECK-native: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C**)*)(%C11fixlifetime1C**
class C {}
sil_vtable C {}
protocol P : class {}
typealias F = () -> ()
struct Agg {
var c : C
var p : P
var f : F
}
sil @test : $@convention(thin) (C, P, @callee_owned () -> (), Agg) -> () {
bb0(%0 : $C, %1 : $P, %2 : $@callee_owned () -> (), %3 : $Agg):
fix_lifetime %0 : $C
fix_lifetime %1 : $P
fix_lifetime %2 : $@callee_owned () -> ()
fix_lifetime %3 : $Agg
%4 = alloc_stack $C
fix_lifetime %4#1 : $*C
dealloc_stack %4#0 : $*@local_storage C
%9999 = tuple()
return %9999 : $()
}