Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ struct SILMoveOnlyWrappedTypeEliminatorVisitor
NO_UPDATE_NEEDED(Object)
NO_UPDATE_NEEDED(OpenExistentialRef)
NO_UPDATE_NEEDED(OpenExistentialAddr)
NO_UPDATE_NEEDED(OpenExistentialBox)
NO_UPDATE_NEEDED(ConvertFunction)
NO_UPDATE_NEEDED(RefToBridgeObject)
NO_UPDATE_NEEDED(BridgeObjectToRef)
Expand Down
14 changes: 12 additions & 2 deletions test/SILOptimizer/moveonly_type_eliminator.sil
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
sil_stage raw

import Builtin
import Swift

//////////////////
// Declarations //
Expand Down Expand Up @@ -38,8 +39,6 @@ struct KlassPair {

sil @use_klass : $@convention(thin) (@guaranteed Klass) -> ()

protocol Error {}

///////////
// Tests //
///////////
Expand Down Expand Up @@ -616,6 +615,17 @@ bb0(%x : @guaranteed $any Error):
return %em : $@thick any Error.Type
}

// CHECK-LABEL: sil [ossa] @existential_box :
// CHECK: %1 = open_existential_box %0 : $any Error
// CHECK-LABEL: } // end sil function 'existential_box'
sil [ossa] @existential_box : $@convention(thin) (@guaranteed any Error) -> () {
bb0(%x : @guaranteed $any Error):
%y = copyable_to_moveonlywrapper [guaranteed] %x : $any Error
%o = open_existential_box %y : $@moveOnly (any Error) to $*@opened("01234567-89AB-CDEF-0123-000000000000", Error) Self
%r = tuple ()
return %r : $()
}

// CHECK-LABEL: sil [ossa] @builtin_tsanInoutAccess : {{.*}} {
// CHECK: builtin "tsanInoutAccess"
// CHECK-LABEL: } // end sil function 'builtin_tsanInoutAccess'
Expand Down