Files
swift-mirror/test/Utils/swift-function-caller-generator/basic.swift
T
2026-02-28 11:38:24 -08:00

44 lines
824 B
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %swift-function-caller-generator Test %t/test.swift > %t/out.swift
// RUN: %diff %t/out.swift %t/out.swift.expected
//--- test.swift
/// doc comment
func foo(x: Int) -> Int
func bar(_ y: UnsafePointer<CInt>)
@_lifetime(borrow z)
func baz(_ z: Span<CInt>) -> Span<CInt>
@_lifetime(`func`: copy `func`)
func qux(_ func: inout MutableSpan<CInt>)
@available(*, unavailable)
func unavailable(x: Int) -> Int
//--- out.swift.expected
import Test
func call_foo(x: Int) -> Int {
return foo(x: x)
}
func call_bar(_ y: UnsafePointer<CInt>) {
return unsafe bar(y)
}
@_lifetime(borrow z)
func call_baz(_ z: Span<CInt>) -> Span<CInt> {
return baz(z)
}
@_lifetime(`func`: copy `func`)
func call_qux(_ func: inout MutableSpan<CInt>) {
return qux(&`func`)
}