Skip to content

Commit 0282cf5

Browse files
authored
Merge pull request swiftlang#35857 from akyrtzi/sourcekitd-test-match-module-cache
[test/SourceKit] Introduce a test that ensures a certain set of arguments allows both compiler and sourcekitd invocations to share the same module cache
2 parents 9318a24 + 233938a commit 0282cf5

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module mymod {
2+
header "mymod.h"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void mymod_call_me(void);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// This test ensures a certain set of arguments allows both compiler and sourcekitd invocations to share the same module cache.
2+
// NOTE: Do not change this test without a review from @akyrtzi
3+
4+
// REQUIRES: shell
5+
// RUN: %empty-directory(%t)
6+
7+
// RUN: COMPILER_ARGS=( \
8+
// RUN: -module-name themod \
9+
// RUN: -module-cache-path %t/mcp \
10+
// RUN: -sdk %sdk \
11+
// RUN: -swift-version 5 \
12+
// RUN: -I %S/Inputs/mymod \
13+
// RUN: -Xfrontend -experimental-allow-module-with-compiler-errors \
14+
// RUN: -Xcc -D__INDEX_BUILD__=1 -D__INDEX_BUILD__ \
15+
// RUN: -Xcc -Xclang -Xcc -fallow-pcm-with-compiler-errors \
16+
// RUN: -Xcc -Xclang -Xcc -fmodule-format=raw \
17+
// RUN: -Xcc -Xclang -Xcc -detailed-preprocessing-record \
18+
// RUN: %s \
19+
// RUN: )
20+
21+
// RUN: %swiftc_driver -emit-module -emit-module-path themod.swiftmodule -Xfrontend -experimental-skip-all-function-bodies ${COMPILER_ARGS[@]}
22+
// RUN: %swiftc_driver -index-file -index-file-path %s -index-store-path %t/idx -index-ignore-system-modules ${COMPILER_ARGS[@]}
23+
// RUN: %sourcekitd-test -req=sema %s -- ${COMPILER_ARGS[@]}
24+
// RUN: find %t/mcp -name "mymod-*.pcm" | count 1
25+
26+
import mymod

0 commit comments

Comments
 (0)