Skip to content

Commit d50d116

Browse files
committed
Test UnsafeRawPointer store of ~Escapable
1 parent 969f7ca commit d50d116

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/SILOptimizer/lifetime_dependence/rawpointer_span.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@ func goodGenericLoadUnaligned<T: ~Escapable>(p: UnsafeRawPointer, _: T.Type) ->
7474
return unsafe p.loadUnaligned(as: T.self) // OK
7575
}
7676
*/
77+
78+
//===----------------------------------------------------------------------===//
79+
// raw pointer .storeBytes()
80+
//===----------------------------------------------------------------------===//
81+
82+
@available(Span 0.1, *)
83+
func storeSpan(span: RawSpan) {
84+
let p = getMutRawPointer()
85+
unsafe p.storeBytes(of: span, as: RawSpan.self)
86+
}
87+
88+
/* TODO: support storeBytes<T: ~BitwiseCopyable>
89+
func storeGeneric<T: ~Escapable>(value: T) {
90+
let p = getMutRawPointer()
91+
unsafe p.storeBytes(of: value, as: T.self)
92+
}
93+
*/

0 commit comments

Comments
 (0)