1
- // RUN: %target-swift-frontend -parse-sil -emit-ir %s | FileCheck --check-prefix=CHECK-%target-runtime %s
1
+ // RUN: %target-swift-frontend -parse-sil -emit-ir -disable-llvm-optzns -O %s | FileCheck --check-prefix=CHECK-%target-runtime %s
2
+ // RUN: %target-swift-frontend -parse-sil -emit-ir -disable-llvm-optzns -Ounchecked %s | FileCheck --check-prefix=CHECK-%target-runtime %s
3
+ // RUN: %target-swift-frontend -parse-sil -emit-ir -disable-llvm-optzns -Onone %s | FileCheck --check-prefix=ONONE %s
2
4
3
5
// REQUIRES: CPU=i386_or_x86_64
4
6
7
+ // At -Onone we don't run the LLVM ARC optimizer, so the fixLifetime call is
8
+ // unnecessary.
9
+ // ONONE-NOT: @__swift_fixLifetime
10
+
5
11
// CHECK-objc-LABEL: define void @test(%C11fixlifetime1C*, %objc_object*, i8**, i8*, %swift.refcounted*, %V11fixlifetime3Agg* noalias nocapture dereferenceable({{.*}})) {{.*}} {
6
12
// CHECK-objc: entry:
7
- // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
8
- // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%objc_object*)*)(%objc_object*
9
- // CHECK-objc: call void @swift_fixLifetime (%swift.refcounted*
10
- // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
11
- // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%objc_object*)*)(%objc_object*
12
- // CHECK-objc: call void @swift_fixLifetime (%swift.refcounted*
13
- // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C**)*)(%C11fixlifetime1C**
13
+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
14
+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object*
15
+ // CHECK-objc: call void @__swift_fixLifetime (%swift.refcounted*
16
+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
17
+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object*
18
+ // CHECK-objc: call void @__swift_fixLifetime (%swift.refcounted*
19
+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%C11fixlifetime1C**)*)(%C11fixlifetime1C**
14
20
15
21
// CHECK-native-LABEL: define void @test(%C11fixlifetime1C*, %swift.refcounted*, i8**, i8*, %swift.refcounted*, %V11fixlifetime3Agg* noalias nocapture dereferenceable({{.*}})) {{.*}} {
16
22
// CHECK-native: entry:
17
- // CHECK-native: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
18
- // CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
19
- // CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
20
- // CHECK-native: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
21
- // CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
22
- // CHECK-native: call void @swift_fixLifetime(%swift.refcounted*
23
- // CHECK-native: call void bitcast (void (%swift.refcounted*)* @swift_fixLifetime to void (%C11fixlifetime1C**)*)(%C11fixlifetime1C**
23
+ // CHECK-native: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
24
+ // CHECK-native: call void @__swift_fixLifetime(%swift.refcounted*
25
+ // CHECK-native: call void @__swift_fixLifetime(%swift.refcounted*
26
+ // CHECK-native: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%C11fixlifetime1C*)*)(%C11fixlifetime1C*
27
+ // CHECK-native: call void @__swift_fixLifetime(%swift.refcounted*
28
+ // CHECK-native: call void @__swift_fixLifetime(%swift.refcounted*
29
+ // CHECK-native: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%C11fixlifetime1C**)*)(%C11fixlifetime1C**
30
+
31
+ sil_stage canonical
24
32
25
33
class C {}
26
34
sil_vtable C {}
@@ -32,7 +40,8 @@ struct Agg {
32
40
var f : F
33
41
}
34
42
35
- sil @test : $@convention(thin) (C, P, @callee_owned () -> (), Agg) -> () {
43
+ sil [_semantics "optimize.sil.never"] @test
44
+ : $@convention(thin) (C, P, @callee_owned () -> (), Agg) -> () {
36
45
bb0(%0 : $C, %1 : $P, %2 : $@callee_owned () -> (), %3 : $Agg):
37
46
fix_lifetime %0 : $C
38
47
fix_lifetime %1 : $P
0 commit comments