|
2 | 2 | // RUN: %empty-directory(%t)
|
3 | 3 | // RUN: %empty-directory(%t/clang-module-cache)
|
4 | 4 | // RUN: %empty-directory(%t/PCH)
|
| 5 | +// RUN: %empty-directory(%t/HEADER) |
5 | 6 | // RUN: %empty-directory(%t/SwiftModules)
|
| 7 | +// RUN: %empty-directory(%t/CAS) |
6 | 8 |
|
7 | 9 | // - Set up Foo Swift dependency
|
8 | 10 | // RUN: echo "extension Profiler {" >> %t/foo.swift
|
9 | 11 | // RUN: echo " public static let count: Int = 42" >> %t/foo.swift
|
10 | 12 | // RUN: echo "}" >> %t/foo.swift
|
11 | 13 |
|
12 | 14 | // - Set up Foo bridging header
|
13 |
| -// RUN: echo "struct Profiler { void* ptr; };" >> %t/foo.h |
| 15 | +// RUN: echo "struct Profiler { void* ptr; };" >> %t/HEADER/foo.h |
14 | 16 |
|
15 | 17 | // - Compile bridging header
|
16 |
| -// RUN: %target-swift-frontend -enable-objc-interop -emit-pch %t/foo.h -o %t/PCH/foo.pch -disable-implicit-swift-modules |
| 18 | +// RUN: %target-swift-frontend -enable-objc-interop -emit-pch %t/HEADER/foo.h -o %t/PCH/foo.pch -disable-implicit-swift-modules |
17 | 19 |
|
18 | 20 | // - Set up explicit dependencies for Foo
|
19 | 21 | // RUN: %target-swift-emit-pcm -module-name SwiftShims %swift-lib-dir/swift/shims/module.modulemap -o %t/inputs/SwiftShims.pcm
|
|
50 | 52 | // RUN: %target-swift-frontend -emit-module -emit-module-path %t/SwiftModules/Foo.swiftmodule %t/foo.swift -module-name Foo -import-objc-header %t/PCH/foo.pch -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -disable-implicit-swift-modules -explicit-swift-module-map-file %t/foo_inputs_map.json
|
51 | 53 |
|
52 | 54 | // - Scan main module
|
53 |
| -// RUN: %target-swift-frontend -scan-dependencies %s -I %t/SwiftModules -I %S/Inputs/Swift -o %t/deps.json |
| 55 | +// RUN: %target-swift-frontend -scan-dependencies %s -I %t/SwiftModules -I %S/Inputs/Swift -o %t/deps.json -cache-compile-job -cas-path %t/cas |
54 | 56 | // RUN: %validate-json %t/deps.json | %FileCheck %s
|
55 | 57 |
|
| 58 | +// - Scan main module without a CAS and ensure no headerDependencies are emitted |
| 59 | +// RUN: %target-swift-frontend -scan-dependencies %s -I %t/SwiftModules -I %S/Inputs/Swift -o %t/deps_nocas.json |
| 60 | +// RUN: %validate-json %t/deps_nocas.json | %FileCheck %s --check-prefix=CHECK-NO-HEADERS |
| 61 | + |
56 | 62 | // CHECK: "swift": "FooClient"
|
57 | 63 | // CHECK: "swift": "FooClient"
|
58 | 64 | // CHECK: "swiftPrebuiltExternal": "Foo"
|
59 | 65 | // CHECK: "commandLine": [
|
60 | 66 | // CHECK: "-include-pch",
|
61 | 67 | // CHECK-NEXT: "-Xcc",
|
62 |
| -// CHECK-NEXT: "{{.*}}{{/|\\}}PCH{{/|\\}}foo.pch" |
| 68 | +// CHECK-NEXT: "{{.*}}{{/|\\}}HEADER{{/|\\}}foo.h" |
63 | 69 |
|
64 | 70 |
|
65 | 71 | // CHECK: "swiftPrebuiltExternal": "Foo"
|
66 | 72 | // CHECK: "headerDependencies": [
|
67 |
| -// CHECK: "{{.*}}{{/|\\}}PCH{{/|\\}}foo.pch" |
| 73 | +// CHECK: "{{.*}}{{/|\\}}HEADER{{/|\\}}foo.h" |
68 | 74 | // CHECK: ],
|
69 | 75 |
|
| 76 | +// CHECK-NO-HEADERS-NOT: "headerDependencies" |
| 77 | + |
70 | 78 | import FooClient
|
0 commit comments