|
1 | 1 | // RUN: %empty-directory(%t)
|
2 | 2 | // RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/
|
3 | 3 | // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
|
| 4 | +// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB |
4 | 5 |
|
5 | 6 | // also try without the trailing slash on `-emit-symbol-graph-dir` and make sure it works
|
6 | 7 |
|
7 | 8 | // RUN: %empty-directory(%t)
|
8 | 9 | // RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t
|
9 | 10 | // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
|
| 11 | +// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB |
10 | 12 |
|
11 | 13 | // also try while forcing the use of supplementary file maps to make sure the symbol graph path gets
|
12 | 14 | // added to the file map for the inner frontend call
|
13 | 15 |
|
14 | 16 | // RUN: %empty-directory(%t)
|
15 | 17 | // RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t -driver-filelist-threshold=0 -O -whole-module-optimization
|
16 | 18 | // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
|
| 19 | +// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB |
17 | 20 |
|
18 | 21 | // also try with an up-to-date incremental build to make sure that adding the symbol graph flags
|
19 | 22 | // can get them to be generated
|
|
23 | 26 | // RUN: cd %t && %target-build-swift %t/EmitWhileBuilding.swift -module-name EmitWhileBuilding -c -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-dependencies -incremental -output-file-map=%S/Inputs/EmitWhileBuilding.output.json -working-directory %t -v -driver-show-incremental
|
24 | 27 | // RUN: cd %t && %target-build-swift %t/EmitWhileBuilding.swift -module-name EmitWhileBuilding -c -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-dependencies -incremental -output-file-map=%S/Inputs/EmitWhileBuilding.output.json -working-directory %t -v -driver-show-incremental -emit-symbol-graph -emit-symbol-graph-dir %t
|
25 | 28 | // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
|
| 29 | +// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB |
| 30 | + |
| 31 | +// now run with -symbol-graph-minimum-access-level to change the available symbols |
| 32 | + |
| 33 | +// RUN: %empty-directory(%t) |
| 34 | +// RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -symbol-graph-minimum-access-level private |
| 35 | +// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json |
| 36 | +// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PRIV |
26 | 37 |
|
27 | 38 | /// Does a foo.
|
28 | 39 | public func foo() {}
|
29 | 40 |
|
| 41 | +/// Does a bar. |
| 42 | +func bar() {} |
| 43 | + |
30 | 44 | // CHECK: "precise":"s:17EmitWhileBuilding3fooyyF"
|
| 45 | +// PUB-NOT: "precise":"s:17EmitWhileBuilding3baryyF" |
| 46 | +// PRIV: "precise":"s:17EmitWhileBuilding3baryyF" |
0 commit comments