Files
swift-mirror/test/SymbolGraph/Module/BasicExtension.swift
Franklin Schrans 9cd44ca5d1 [SymbolGraphGen] Emit symbols from exported modules
When emitting a symbol graph file for a module that import modules via
`@_exported import`, emits those modules' symbols as well.

SR-15753

rdar://89547374
2022-02-28 17:21:25 +00:00

42 lines
1.4 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name BasicExtension -emit-module -emit-module-path %t/
// RUN: %target-swift-symbolgraph-extract -module-name BasicExtension -I %t -pretty-print -output-dir %t
// RUN: %FileCheck %s --input-file %t/BasicExtension@Swift.symbols.json --check-prefix EXTRACT
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name BasicExtension -emit-module -emit-module-path %t/ -emit-symbol-graph -emit-symbol-graph-dir %t
// RUN: %FileCheck %s --input-file %t/BasicExtension@Swift.symbols.json --check-prefix BUILD
extension String {
/// Return something.
public var something: String {
return "something"
}
}
// EXTRACT: module
// EXTRACT-NEXT: "name": "BasicExtension"
// BUILD: module
// BUILD: "name":"BasicExtension"
// EXTRACT: "precise": "s:SS14BasicExtensionE9somethingSSvp"
// BUILD: "precise":"s:SS14BasicExtensionE9somethingSSvp"
// EXTRACT: "kind": "memberOf"
// EXTRACT-NEXT: "source": "s:SS14BasicExtensionE9somethingSSvp"
// EXTRACT-NEXT: "target": "s:SS"
// BUILD: "kind":"memberOf"
// BUILD: "source":"s:SS14BasicExtensionE9somethingSSvp"
// BUILD: "target":"s:SS"
// Extending `String` creates a memberOf relationship above.
// However, it should not be included as a node because `String`
// is owned by the Swift module.
// rdar://58876107
// EXTRACT-NOT: "precise": "s:SS"
// BUILD-NOT: "precise":"s:SS"