Skip to content

Commit 36d0528

Browse files
add test for cross-import overlay symbol graphs
1 parent b360d3a commit 36d0528

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift %S/Inputs/CrossImport/A.swift -I %t -module-name A -emit-module -emit-module-path %t/
3+
// RUN: %target-build-swift %S/Inputs/CrossImport/B.swift -I %t -module-name B -emit-module -emit-module-path %t/
4+
// RUN: %target-build-swift %s -module-name _A_B -I %t -emit-module -emit-module-path %t/
5+
// RUN: cp -r %S/Inputs/CrossImport/A.swiftcrossimport %t/
6+
// RUN: %target-swift-symbolgraph-extract -module-name A -I %t -pretty-print -output-dir %t
7+
// RUN: %FileCheck %s --input-file %t/[email protected]
8+
9+
@_exported import A
10+
import B
11+
12+
extension A {
13+
public func transmogrify() -> B {
14+
return B(y: self.x);
15+
}
16+
}
17+
18+
// CHECK: module
19+
// CHECK-NEXT: "name": "A"
20+
// CHECK-NEXT: bystanders
21+
// CHECK-NEXT: B
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public struct A {
2+
public var x: Int
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%YAML 1.2
2+
---
3+
version: 1
4+
modules:
5+
- name: _A_B
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public struct B {
2+
public var y: Int
3+
4+
public init(y: Int) {
5+
self.y = y
6+
}
7+
}

0 commit comments

Comments
 (0)