@@ -33,7 +33,7 @@ struct DepStruct {
33
33
private var depField2: [X]
34
34
}
35
35
36
- // CHECK-LABEL: sil @test_alloc_stack
36
+ // CHECK-LABEL: sil @test_alloc_stack :
37
37
// CHECK: [[I:%[0-9]+]] = integer_literal $Builtin.Int1, -1
38
38
// CHECK: [[R:%[0-9]+]] = struct $Bool ([[I]] : $Builtin.Int1)
39
39
// CHECK: return [[R]]
54
54
return %10 : $Bool
55
55
}
56
56
57
- // CHECK-LABEL: sil @test_alloc_stack_escapes
57
+ // CHECK-LABEL: sil [ossa] @test_alloc_stack_ossa :
58
+ // CHECK: [[I:%[0-9]+]] = integer_literal $Builtin.Int1, -1
59
+ // CHECK: [[R:%[0-9]+]] = struct $Bool ([[I]] : $Builtin.Int1)
60
+ // CHECK: return [[R]]
61
+ sil [ossa] @test_alloc_stack_ossa : $@convention(thin) () -> Bool {
62
+ bb0:
63
+ %1 = alloc_stack $Array<X>
64
+ %3 = function_ref @_array_X_init : $@convention(thin) () -> @owned Array<X>
65
+ %4 = apply %3() : $@convention(thin) () -> @owned Array<X>
66
+ store %4 to [init] %1 : $*Array<X>
67
+
68
+ %m1 = function_ref @_array_X_mutate : $@convention(method) (@inout Array<X>) -> ()
69
+ %m2 = apply %m1(%1) : $@convention(method) (@inout Array<X>) -> ()
70
+
71
+ %5 = load_borrow %1 : $*Array<X>
72
+ %6 = function_ref @_is_native_X_no_type_check : $@convention(method) (@guaranteed Array<X>) -> Bool
73
+ %10 = apply %6(%5) : $@convention(method) (@guaranteed Array<X>) -> Bool
74
+ end_borrow %5
75
+ destroy_addr %1
76
+ dealloc_stack %1 : $*Array<X>
77
+ return %10 : $Bool
78
+ }
79
+
80
+ // CHECK-LABEL: sil @test_alloc_stack_escapes :
58
81
// CHECK: [[F:%[0-9]+]] = function_ref @_is_native_X_no_type_check
59
82
// CHECK: [[R:%[0-9]+]] = apply [[F]]
60
83
// CHECK: return [[R]]
75
98
return %10 : $Bool
76
99
}
77
100
101
+ // CHECK-LABEL: sil [ossa] @test_alloc_stack_escapes_ossa :
102
+ // CHECK: [[F:%[0-9]+]] = function_ref @_is_native_X_no_type_check
103
+ // CHECK: [[R:%[0-9]+]] = apply [[F]]
104
+ // CHECK: return [[R]]
105
+ sil [ossa] @test_alloc_stack_escapes_ossa : $@convention(thin) () -> Bool {
106
+ bb0:
107
+ %1 = alloc_stack $Array<X>
108
+ %3 = function_ref @_array_X_init : $@convention(thin) () -> @owned Array<X>
109
+ %4 = apply %3() : $@convention(thin) () -> @owned Array<X>
110
+ store %4 to [init] %1 : $*Array<X>
111
+
112
+ %m1 = function_ref @_take_array_addr : $@convention(method) (@inout Array<X>) -> ()
113
+ %m2 = apply %m1(%1) : $@convention(method) (@inout Array<X>) -> ()
114
+
115
+ %5 = load_borrow %1 : $*Array<X>
116
+ %6 = function_ref @_is_native_X_no_type_check : $@convention(method) (@guaranteed Array<X>) -> Bool
117
+ %10 = apply %6(%5) : $@convention(method) (@guaranteed Array<X>) -> Bool
118
+ end_borrow %5
119
+ destroy_addr %1
120
+ dealloc_stack %1 : $*Array<X>
121
+ return %10 : $Bool
122
+ }
123
+
78
124
// CHECK-LABEL: sil @test_alloc_write_unknown
79
125
// CHECK: [[F:%[0-9]+]] = function_ref @_is_native_X_no_type_check
80
126
// CHECK: [[R:%[0-9]+]] = apply [[F]]
0 commit comments