-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathunit-pcm-dependency.swift
95 lines (79 loc) · 4.25 KB
/
unit-pcm-dependency.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// RUN: rm -rf %t
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -index-store-path %t/idx -primary-file %s -o %t/s1.o -I %S/Inputs -typecheck -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefixes=FILE1,FILE1-PCM
// If the module cache already exists, the pcm gets indexed.
// RUN: rm -rf %t/idx
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -index-store-path %t/idx -primary-file %s -o %t/s1.o -I %S/Inputs -typecheck -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefixes=FILE1,FILE1-PCM
// FIXME: index the bridging header!
// RUN: %empty-directory(%t)
// RUN: echo 'import ClangModuleA' > %t/s2.swift
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -index-store-path %t/idx %s %t/s2.swift -o %t/s1.o -o %t/s2.o -I %S/Inputs -c -emit-module -module-name main -emit-module-path %t/main.swiftmodule -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx > %t/both.txt
// RUN: %FileCheck %s -check-prefixes=FILE1,FILE1-PCM < %t/both.txt
// RUN: %FileCheck %s -check-prefixes=FILE2,FILE2-PCM < %t/both.txt
// Test -index-ignore-clang-modules.
// RUN: %empty-directory(%t)
// RUN: echo 'import ClangModuleA' > %t/s2.swift
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -index-store-path %t/idx -index-ignore-clang-modules %s %t/s2.swift -o %t/s1.o -o %t/s2.o -I %S/Inputs -c -emit-module -module-name main -emit-module-path %t/main.swiftmodule -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx > %t/both.txt
// RUN: %FileCheck %s -check-prefixes=FILE1,FILE1-IGNORE < %t/both.txt --dump-input-filter all
// RUN: %FileCheck %s -check-prefixes=FILE2,FILE2-IGNORE < %t/both.txt
import ClangModuleB
import ClangModuleC.Sub1
import ClangModuleC.Sub2
func test() {
funcA()
funcB()
}
// FILE1-IGNORE-NOT: ClangModuleA-
// FILE1-PCM: ClangModuleA-
// FILE1-PCM: --------
// FILE1-PCM: is-system: 0
// FILE1-PCM: has-main: 0
// FILE1-PCM: DEPEND START
// FILE1-PCM: Record | user | {{.*}}ClangModuleA.h | ClangModuleA.h-
// FILE1-PCM: DEPEND END
// FILE1-IGNORE-NOT: ClangModuleB-
// FILE1-PCM: ClangModuleB-
// FILE1-PCM: --------
// FILE1-PCM: is-system: 0
// FILE1-PCM: has-main: 0
// FILE1-PCM: DEPEND START
// FILE1-PCM: Unit | user | ClangModuleA | {{.*}}ClangModuleA-{{.*}}.pcm | ClangModuleA-{{.*}}.pcm-
// FILE1-PCM: Record | user | {{.*}}ClangModuleB.h | ClangModuleB.h-
// FILE1-PCM: DEPEND END
// FILE1: s1.o-
// FILE1: --------
// FILE1: has-main: 1
// FILE1: DEPEND START
// FILE1-NOT: ClangModuleA.h
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: Unit | system | Swift | {{.*}}Swift.swiftmodule
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1-PCM: Unit | user | ClangModuleB | {{.*}}ClangModuleB-{{[A-Z0-9]*}}.pcm | ClangModuleB-{{[A-Z0-9]*}}.pcm-
// FILE1-PCM: Unit | user | ClangModuleC | {{.*}}ClangModuleC-{{[A-Z0-9]*}}.pcm | ClangModuleC-{{[A-Z0-9]*}}.pcm-
// FILE1-IGNORE: Unit | user | ClangModuleB | {{.*}}ClangModuleB-{{[A-Z0-9]*}}.pcm
// FILE1-IGNORE: Unit | user | ClangModuleC | {{.*}}ClangModuleC-{{[A-Z0-9]*}}.pcm
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: Record | user | {{.*}}unit-pcm-dependency.swift | unit-pcm-dependency.swift-
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: DEPEND END (4)
// FILE2-NOT: main.swiftmodule-
// FILE2: s2.o-
// FILE2: --------
// FILE2: has-main: 1
// FILE2: out-file: {{.*}}s2.o
// FILE2: DEPEND START
// FILE2-NOT: ClangModuleB.h
// FILE2-NOT: Unit |{{.*}}ClangModuleB
// FILE2-NOT: Record
// FILE2: Unit | system | Swift | {{.*}}Swift.swiftmodule
// FILE2-NOT: Unit |{{.*}}ClangModuleB
// FILE2-NOT: Record
// FILE2-PCM: Unit | user | ClangModuleA | {{.*}}ClangModuleA-{{[A-Z0-9]*}}.pcm | ClangModuleA-{{[A-Z0-9]*}}.pcm-
// FILE2-IGNORE: Unit | user | ClangModuleA | {{.*}}ClangModuleA-{{[A-Z0-9]*}}.pcm
// FILE2: Record | user | {{.*}}s2.swift | s2.swift-
// FILE2-NOT: Unit |{{.*}}ClangModuleB
// FILE2-NOT: Record
// FILE2: DEPEND END