Skip to content

Commit d06e2cc

Browse files
committed
tests: fix memory_lifetime tests
verifier failures must be placed into memory_lifetime_failures.sil. Otherwise they won't be tested.
1 parent 5435bb4 commit d06e2cc

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

test/SIL/memory_lifetime.sil

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -709,20 +709,3 @@ entry:
709709
return %retval : $()
710710
}
711711

712-
// CHECK: SIL memory lifetime failure in @begin_apply_inout_destroy: memory is not initialized, but should be
713-
sil [ossa] @begin_apply_inout_no_destroy : $@convention(thin) () -> () {
714-
entry:
715-
(%instance, %token) = begin_apply undef<Inner>() : $@yield_once @convention(thin) <U> () -> @yields @inout U
716-
end_apply %token
717-
%retval = tuple ()
718-
return %retval : $()
719-
}
720-
721-
// CHECK: SIL memory lifetime failure in @begin_apply_inout_aliasable_destroy: memory is not initialized, but should be
722-
sil [ossa] @begin_apply_inout_aliasable_no_destroy : $@convention(thin) () -> () {
723-
entry:
724-
(%instance, %token) = begin_apply undef<Inner>() : $@yield_once @convention(thin) <U> () -> @yields @inout_aliasable U
725-
end_apply %token
726-
%retval = tuple ()
727-
return %retval : $()
728-
}

test/SIL/memory_lifetime_failures.sil

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,3 +756,21 @@ entry:
756756
%retval = tuple ()
757757
return %retval : $()
758758
}
759+
760+
// CHECK: SIL memory lifetime failure in @begin_apply_inout_destroy: memory is not initialized, but should be
761+
sil [ossa] @begin_apply_inout_no_destroy : $@convention(thin) () -> () {
762+
entry:
763+
(%instance, %token) = begin_apply undef<Inner>() : $@yield_once @convention(thin) <U> () -> @yields @inout U
764+
end_apply %token
765+
%retval = tuple ()
766+
return %retval : $()
767+
}
768+
769+
// CHECK: SIL memory lifetime failure in @begin_apply_inout_aliasable_destroy: memory is not initialized, but should be
770+
sil [ossa] @begin_apply_inout_aliasable_no_destroy : $@convention(thin) () -> () {
771+
entry:
772+
(%instance, %token) = begin_apply undef<Inner>() : $@yield_once @convention(thin) <U> () -> @yields @inout_aliasable U
773+
end_apply %token
774+
%retval = tuple ()
775+
return %retval : $()
776+
}

0 commit comments

Comments
 (0)