|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-build-swift %S/Inputs/RemoteP.swift -module-name RemoteP -emit-module -emit-module-path %t/ |
| 3 | +// RUN: %target-build-swift %s -module-name External -emit-module -emit-module-path %t/ -I %t |
| 4 | +// RUN: %target-swift-symbolgraph-extract -module-name External -I %t -pretty-print -output-dir %t |
| 5 | +// RUN: %FileCheck %s --input-file %t/ [email protected] |
| 6 | +// RUN: %FileCheck %s --input-file %t/ [email protected] --check-prefix MEMBER |
| 7 | + |
| 8 | +// RUN: %empty-directory(%t) |
| 9 | +// RUN: %target-build-swift %S/Inputs/RemoteP.swift -module-name RemoteP -emit-module -emit-module-path %t/ |
| 10 | +// RUN: %target-build-swift %s -module-name External -emit-module -emit-module-path %t/ -I %t |
| 11 | +// RUN: %target-swift-symbolgraph-extract -module-name External -I %t -pretty-print -output-dir %t -emit-extension-block-symbols |
| 12 | +// RUN: %FileCheck %s --input-file %t/ [email protected] |
| 13 | +// RUN: %FileCheck %s --input-file %t/ [email protected] --check-prefix MEMBEREBS |
| 14 | +// RUN: %FileCheck %s --input-file %t/ [email protected] --check-prefix EXTENSIONTOEBS |
| 15 | + |
| 16 | +import RemoteP |
| 17 | + |
| 18 | +public extension RemoteP { |
| 19 | + func someFunc() {} |
| 20 | +} |
| 21 | + |
| 22 | +// Default implementations that are for protocols in a different module should have a `memberOf` |
| 23 | +// relation linking them to a local symbol. If the default implementation is not defined on a local |
| 24 | +// protocol, the extension block symbol defining the default implementation should be the target |
| 25 | +// of the memberOf relationship. |
| 26 | + |
| 27 | +// CHECK: "kind": "defaultImplementationOf" |
| 28 | +// CHECK-NEXT: "source": "s:7RemotePAAP8ExternalE8someFuncyyF" |
| 29 | +// CHECK-NEXT: "target": "s:7RemotePAAP8someFuncyyF" |
| 30 | +// CHECK-NEXT: "targetFallback": "RemoteP.RemoteP.someFunc()" |
| 31 | + |
| 32 | +// MEMBER: "kind": "memberOf" |
| 33 | +// MEMBER-NEXT: "source": "s:7RemotePAAP8ExternalE8someFuncyyF" |
| 34 | +// MEMBER-NEXT: "target": "s:7RemotePAAP" |
| 35 | +// MEMBER-NEXT: "targetFallback": "RemoteP.RemoteP" |
| 36 | + |
| 37 | +// MEMBEREBS: "kind": "memberOf" |
| 38 | +// MEMBEREBS-NEXT: "source": "s:7RemotePAAP8ExternalE8someFuncyyF" |
| 39 | +// MEMBEREBS-NEXT: "target": "s:e:s:7RemotePAAP8ExternalE8someFuncyyF" |
| 40 | +// MEMBEREBS-NEXT: "targetFallback": "RemoteP.RemoteP" |
| 41 | + |
| 42 | +// EXTENSIONTOEBS: "kind": "extensionTo" |
| 43 | +// EXTENSIONTO-NEXT: "source": "s:7RemotePAAP8ExternalE8someFuncyyF" |
| 44 | +// EXTENSIONTO-NEXT: "target": "s:7RemotePAAP" |
| 45 | +// EXTENSIONTO-NEXT: "targetFallback": "RemoteP.RemoteP" |
0 commit comments