File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
test/ParseableInterface/ModuleCache Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t/BuildDir)
2
+ // RUN: %empty-directory(%t/SecondBuildDir/Lib.swiftmodule)
3
+ // RUN: %empty-directory(%t/ModuleCache)
4
+
5
+ // RUN: echo 'public func showsUpInBothPlaces() {}' > %t/Lib.swift
6
+
7
+ // 1. Create a .swiftinterface file containing just one API, and put it inside a second build dir (without a .swiftmodule)
8
+ // RUN: %target-swift-frontend -typecheck %t/Lib.swift -emit-parseable-module-interface-path %t/SecondBuildDir/Lib.swiftmodule/%target-cpu.swiftinterface
9
+
10
+ // 2. Add a new API to the module, and compile just the serialized version in the build dir.
11
+ // RUN: echo 'public func onlyInTheCompiledModule() {}' >> %t/Lib.swift
12
+ // RUN: %target-swift-frontend -emit-module %t/Lib.swift -o %t/BuildDir/Lib.swiftmodule -emit-parseable-module-interface-path %t/BuildDir/Lib.swiftinterface
13
+
14
+ // 3. Make sure when we compile this test file, we can access both APIs since we'll
15
+ // load the compiled .swiftmodule instead of the .swiftinterface in the SDK.
16
+ // RUN: %target-swift-frontend -typecheck %s -I %t/BuildDir -I %t/SecondBuildDir -module-cache-path %t/ModuleCache
17
+
18
+ // 4. Make sure we didn't compile any .swiftinterfaces into the module cache.
19
+ // RUN: ls %t/ModuleCache | not grep 'swiftmodule'
20
+
21
+ import Lib
22
+
23
+ showsUpInBothPlaces ( )
24
+ onlyInTheCompiledModule ( )
You can’t perform that action at this time.
0 commit comments