Skip to content

Commit b30e056

Browse files
committed
[Test] Moved test case.
Put it in the file with all the other canonicalize-ossa-lifetime tests.
1 parent 7856842 commit b30e056

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

test/SILOptimizer/canonicalize_ossa_lifetime_unit.sil

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,29 @@
33
class C {}
44
sil @getOwned : $@convention(thin) () -> @owned C
55
sil @barrier : $@convention(thin) () -> ()
6+
sil [ossa] @getC : $@convention(thin) () -> @owned C
7+
sil [ossa] @borrowC : $@convention(thin) (@guaranteed C) -> ()
68
struct S {}
79

810
@_moveOnly struct MoS {}
911
@_moveOnly struct MoE {}
1012

13+
// CHECK-LABEL: begin running test 1 of 1 on fn: canonicalize-ossa-lifetime with: true, true, true, @trace
14+
// CHECK-LABEL: end running test 1 of 1 on fn: canonicalize-ossa-lifetime with: true, true, true, @trace
15+
sil [ossa] @fn : $@convention(thin) () -> () {
16+
entry:
17+
specify_test "canonicalize-ossa-lifetime true true true @trace"
18+
%getC = function_ref @getC : $@convention(thin) () -> @owned C
19+
%c = apply %getC() : $@convention(thin) () -> @owned C
20+
debug_value [trace] %c : $C
21+
%borrowC = function_ref @borrowC : $@convention(thin) (@guaranteed C) -> ()
22+
apply %borrowC(%c) : $@convention(thin) (@guaranteed C) -> ()
23+
debug_value %c : $C
24+
destroy_value %c : $C
25+
%retval = tuple ()
26+
return %retval : $()
27+
}
28+
1129
// When access scopes are respected, the lifetime which previously extended
1230
// beyond the access scope still extends beyond it.
1331
// CHECK-LABEL: begin running test 1 of 2 on retract_value_lifetime_into_access_scope_when_access_scopes_not_respected: canonicalize-ossa-lifetime with: true, false, true, @trace

test/SILOptimizer/unit_test.sil

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,6 @@ entry(%instance : $X):
150150
return %retval : $()
151151
}
152152

153-
class C {}
154-
155-
sil [ossa] @getC : $@convention(thin) () -> @owned C
156-
sil [ossa] @borrowC : $@convention(thin) (@guaranteed C) -> ()
157-
sil [ossa] @takeC : $@convention(thin) (@owned C) -> ()
158-
159-
// CHECK-LABEL: begin running test 1 of 1 on fn: canonicalize-ossa-lifetime with: true, true, true, @trace
160-
// CHECK-LABEL: end running test 1 of 1 on fn: canonicalize-ossa-lifetime with: true, true, true, @trace
161-
sil [ossa] @fn : $@convention(thin) () -> () {
162-
entry:
163-
specify_test "canonicalize-ossa-lifetime true true true @trace"
164-
%getC = function_ref @getC : $@convention(thin) () -> @owned C
165-
%c = apply %getC() : $@convention(thin) () -> @owned C
166-
debug_value [trace] %c : $C
167-
%borrowC = function_ref @borrowC : $@convention(thin) (@guaranteed C) -> ()
168-
apply %borrowC(%c) : $@convention(thin) (@guaranteed C) -> ()
169-
debug_value %c : $C
170-
destroy_value %c : $C
171-
%retval = tuple ()
172-
return %retval : $()
173-
}
174-
175153
// CHECK-LABEL: begin running test 1 of {{[^,]+}} on test_arg_parsing_2
176154
// CHECK: block:
177155
// CHECK: {{bb[0-9]+}}:

0 commit comments

Comments
 (0)