Skip to content

Commit 8eb5cbe

Browse files
committed
add test by @nathawes
1 parent 4e227f8 commit 8eb5cbe

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// Make a basic clang framework to import
4+
//
5+
// RUN: %empty-directory(%t/MySystemFramework.framework/Headers)
6+
// RUN: %empty-directory(%t/MySystemFramework.framework/Modules)
7+
// RUN: echo 'void someSystemFunc(int arg);' > %t/MySystemFramework.framework/Headers/MySystemFramework.h
8+
// RUN: echo 'framework module MySystemFramework { umbrella header "MySystemFramework.h" export * }' > %t/MySystemFramework.framework/Modules/module.modulemap
9+
10+
import MySystemFramework
11+
someSystemFunc(2)
12+
13+
// Index this file with and without ignoring system frameworks
14+
//
15+
// RUN: %target-swiftc_driver -index-store-path %t/idx1 -o %t/file.o -Fsystem %t -typecheck %s
16+
// RUN: %target-swiftc_driver -index-store-path %t/idx2 -o %t/file.o -index-ignore-system-modules -Fsystem %t -typecheck %s
17+
// RUN: c-index-test core -print-unit %t/idx1 | %FileCheck --check-prefixes=ALLOWSYSTEM,BOTH %s
18+
// RUN: c-index-test core -print-unit %t/idx2 | %FileCheck --check-prefixes=IGNORESYSTEM,BOTH %s
19+
20+
// We should always get a dependency on the system framework in the unit for this file's module.
21+
//
22+
// BOTH: DEPEND START
23+
// BOTH: Unit | system | MySystemFramework |
24+
// BOTH: DEPEND END
25+
26+
// We should get a unit for the system framework if not ignoring them.
27+
//
28+
// ALLOWSYSTEM: provider: clang
29+
// ALLOWSYSTEM-NEXT: is-system: 1
30+
// ALLOWSYSTEM-NEXT: is-module: 1
31+
// ALLOWSYSTEM-NEXT: module-name: MySystemFramework
32+
33+
// But shouldn't if we are.
34+
//
35+
// IGNORESYSTEM-NOT: module-name: MySystemFramework

0 commit comments

Comments
 (0)