mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
11 lines
228 B
Swift
11 lines
228 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
|
|
func test(_ data: UnsafePointer<Int8>?, len: Int) {
|
|
data?.withMemoryRebound(to: UInt8.self, capacity: len) {
|
|
data in
|
|
for i in 0..<len {
|
|
print("\(data[i])")
|
|
}
|
|
}
|
|
}
|