mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When the frontend option `-abi-comments-in-module-interface` is provided during interface printing, the printed interface will contain additional comments that provide the mangled names for public symbols. This is an experiment in seeing how much information we can meaningfully extract from a printed Swift interface for the purpose of bridging with other languages.
18 lines
724 B
Swift
18 lines
724 B
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t/ABIComments.swiftinterface -module-name ABIComments -abi-comments-in-module-interface %s
|
|
|
|
// RUN: %FileCheck %s < %t/ABIComments.swiftinterface
|
|
|
|
// CHECK: // MANGLED NAME: $s11ABIComments11intToStringySSSiF
|
|
// CHECK-NEXT: public func intToString(_ value: Swift.Int) -> Swift.String
|
|
public func intToString(_ value: Int) -> String { "\(value)" }
|
|
|
|
// CHECK: // MANGLED NAME: $s11ABIComments8MyStructVMa
|
|
// CHECK-NEXT: public struct MyStruct {
|
|
public struct MyStruct {
|
|
// CHECK: // MANGLED NAME: $s11ABIComments8MyStructV6methodSiyF
|
|
// CHECK-NEXT: public func method() -> Swift.Int
|
|
public func method() -> Int { 5 }
|
|
}
|