|
| 1 | +// RUN: %target-sil-opt %s -access-path-verification -o /dev/null |
| 2 | + |
| 3 | +sil_stage canonical |
| 4 | + |
| 5 | +import Builtin |
| 6 | +import Swift |
| 7 | +import SwiftShims |
| 8 | + |
| 9 | +public struct S { |
| 10 | +} |
| 11 | + |
| 12 | +@available(*, unavailable) |
| 13 | +public struct Unavailable { |
| 14 | + @_hasStorage @_hasInitialValue public let i: S { get } |
| 15 | + @_hasStorage @_hasInitialValue static let j: S { get } |
| 16 | + init() |
| 17 | +} |
| 18 | + |
| 19 | +sil [transparent] @$s28accessed_storage_unavailable11UnavailableV1iAA1SVvpfi : $@convention(thin) () -> S { |
| 20 | +bb0: |
| 21 | + %0 = function_ref @$s28accessed_storage_unavailable11UnavailableV1jAA1SVvau : $@convention(thin) () -> Builtin.RawPointer |
| 22 | + %1 = apply %0() : $@convention(thin) () -> Builtin.RawPointer |
| 23 | + %2 = pointer_to_address %1 : $Builtin.RawPointer to [strict] $*S |
| 24 | + %3 = load %2 : $*S |
| 25 | + return %3 : $S |
| 26 | +} |
| 27 | + |
| 28 | +sil hidden [global_init] @$s28accessed_storage_unavailable11UnavailableV1jAA1SVvau : $@convention(thin) () -> Builtin.RawPointer { |
| 29 | +bb0: |
| 30 | + %0 = function_ref @$ss31_diagnoseUnavailableCodeReacheds5NeverOyF : $@convention(thin) () -> Never |
| 31 | + %1 = apply %0() : $@convention(thin) () -> Never |
| 32 | + unreachable |
| 33 | +} |
| 34 | + |
| 35 | +sil [transparent] @$s28accessed_storage_unavailable11UnavailableV1iAA1SVvg : $@convention(method) (Unavailable) -> S { |
| 36 | +bb0(%0 : $Unavailable): |
| 37 | + debug_value %0 : $Unavailable, let, name "self", argno 1, implicit |
| 38 | + %2 = function_ref @$ss31_diagnoseUnavailableCodeReacheds5NeverOyF : $@convention(thin) () -> Never |
| 39 | + %3 = apply %2() : $@convention(thin) () -> Never |
| 40 | + unreachable |
| 41 | +} |
| 42 | + |
| 43 | +sil private [global_init_once_fn] @$s28accessed_storage_unavailable11UnavailableV1j_WZ : $@convention(c) (Builtin.RawPointer) -> () { |
| 44 | +bb0(%0 : $Builtin.RawPointer): |
| 45 | + %1 = function_ref @$ss31_diagnoseUnavailableCodeReacheds5NeverOyF : $@convention(thin) () -> Never |
| 46 | + %2 = apply %1() : $@convention(thin) () -> Never |
| 47 | + unreachable |
| 48 | +} |
| 49 | + |
| 50 | +sil [noinline] [_semantics "unavailable_code_reached"] @$ss31_diagnoseUnavailableCodeReacheds5NeverOyF : $@convention(thin) () -> Never |
| 51 | + |
| 52 | +sil_property #Unavailable.i () |
0 commit comments