File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -emit-sil -parse-as-library -O -module-name=test \
2+ // RUN: -enable-experimental-feature LifetimeDependence \
3+ // RUN: -enable-experimental-feature AddressableTypes \
4+ // RUN: %s | %FileCheck %s
5+
6+ // REQUIRES: swift_feature_AddressableTypes
7+ // REQUIRES: swift_feature_LifetimeDependence
8+
9+ // Enable this test as soon as CollectionOfOne is marked @_addressableForDependencies.
10+ // REQUIRES: rdar145687827
11+
12+ // CHECK-LABEL: sil {{.*}}@$s4test0A10OneIntSpan1cs0D0VySiGs012CollectionOfB0VySiG_tF : $@convention(thin) (@in_guaranteed CollectionOfOne<Int>) -> @lifetime(borrow address_for_deps 0) @owned Span<Int> {
13+ // CHECK: bb0(%0 : $*CollectionOfOne<Int>):
14+ // CHECK: [[RP:%.*]] = address_to_pointer {{.*}}%0 to $Builtin.RawPointer
15+ // CHECK: [[UP:%.*]] = struct $UnsafeRawPointer ([[RP]])
16+ // CHECK: [[OP:%.*]] = enum $Optional<UnsafeRawPointer>, #Optional.some!enumelt, [[UP]]
17+ // CHECK: [[SPAN:%.*]] = struct $Span<Int> ([[OP]]
18+ // CHECK: return [[SPAN]]
19+ // CHECK-LABEL: } // end sil function '$s4test0A10OneIntSpan1cs0D0VySiGs012CollectionOfB0VySiG_tF'
20+ @available ( SwiftStdlib 6 . 2 , * )
21+ @lifetime ( borrow c)
22+ public func testOneIntSpan( c: CollectionOfOne < Int > ) -> Span < Int > {
23+ c. span
24+ }
You can’t perform that action at this time.
0 commit comments