Skip to content

Commit b1ada5c

Browse files
[FrontendTool] Add test for SPI imports in module trace.
1 parent 5273bc9 commit b1ada5c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-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 -emit-module -module-name Module0 -DSPI_DECLARING_MODULE -o %t/Module0.swiftmodule
3+
// RUN: %target-build-swift %s -module-name Module1 -DSPI_IMPORTING_MODULE -emit-loaded-module-trace -o %t/spi_import -I %t
4+
// RUN: %FileCheck %s < %t/Module1.trace.json
5+
6+
#if SPI_DECLARING_MODULE
7+
8+
@_spi(ForModule1)
9+
public func f() {}
10+
11+
#endif
12+
13+
#if SPI_IMPORTING_MODULE
14+
15+
@_spi(ForModule1)
16+
import Module0
17+
18+
#endif
19+
20+
// FIXME: SPI imports are marked indirect in trace.
21+
// CHECK: "name":"Module0","path":"{{[^"]*}}","isImportedDirectly":false

0 commit comments

Comments
 (0)