Files
swift-mirror/test/SIL/verifier-init-existential.sil
Nate Chandler ed623d7b64 [NFC] Shortened SIL [init] flag.
Instead of writing out [initalization] for some instructions, use [init]
everywhere.
2022-10-27 10:38:54 -07:00

18 lines
415 B
Plaintext

// RUN: %target-sil-opt %s
// REQUIRES: asserts
sil_stage canonical
protocol Proto {
}
sil @test : $@convention(thin) (@in Proto) -> @out Any {
bb0(%0 : $*Any, %1 : $*Proto):
// init_existential_addr should be able to put an existential container inside an existential container
%2 = init_existential_addr %0 : $*Any, $Proto
copy_addr [take] %1 to [init] %2 : $*Proto
%4 = tuple ()
return %4 : $()
}