Skip to content

tests: cleanup for two ownership verifier tests. #36255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions test/SIL/ownership-verifier/interior_pointer.sil
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,6 @@ bb0(%0 : @owned $Builtin.NativeObject):
return %9999 : $()
}

// CHECK-LABEL: Error#: 0. Begin Error in Function: 'recursive_interior_pointer_error'
// CHECK-NEXT: Found outside of lifetime use?!
// CHECK-NEXT: Value: %2 = begin_borrow %0 : $KlassUser
// CHECK-NEXT: Consuming User: end_borrow %2 : $KlassUser
// CHECK-NEXT: Non Consuming User: %6 = load [copy] %3 : $*Klass
// CHECK-NEXT: Block: bb0
// CHECK: Error#: 0. End Error in Function: 'recursive_interior_pointer_error'
sil [ossa] @recursive_interior_pointer_error : $@convention(thin) (@owned KlassUser, @guaranteed Klass) -> @owned Klass {
bb0(%0 : @owned $KlassUser, %0a : @guaranteed $Klass):
%1 = begin_borrow %0 : $KlassUser
%2 = ref_tail_addr %1 : $KlassUser, $Klass
end_borrow %1 : $KlassUser
destroy_value %0 : $KlassUser
%3 = load [copy] %2 : $*Klass
return %3 : $Klass
}

// CHECK-LABEL: Error#: 0. Begin Error in Function: 'open_existential_box_interior_pointer_error'
// CHECK-NEXT: Found outside of lifetime use?!
// CHECK-NEXT: Value: %1 = begin_borrow %0 : $Error // users: %3, %2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ bb0(%0 : @owned $WrapperStruct):
return %res : $()
}

// Note: The MemoryLifetimeVerifier will also report an error for this function. Therefore
// we run sil-opt with -dont-abort-on-memory-lifetime-error.

// CHECK-LABEL: Begin Error in function caller2
// CHECK: SIL verification failed: Found load borrow that is invalidated by a local write?!: loadBorrowImmutabilityAnalysis.isImmutable(LBI)
// CHECK-LABEL: End Error in function caller2
Expand Down