summaryrefslogtreecommitdiff
path: root/test/Index/index-pch-with-module.m
blob: 36c9c2beb475b94d705ec6489919a48d75ce13e0 (plain)
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
#ifndef PCH_HEADER
#define PCH_HEADER

#include <DependsOnModule/DependsOnModule.h>
extern int pch_glob;

#else

int glob;

#endif

// RUN: rm -rf %t.cache
// RUN: c-index-test -write-pch %t.h.pch %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash
// RUN: c-index-test -index-file %s -include %t.h -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \
// RUN:      -Xclang -fdisable-module-hash | FileCheck %s

// CHECK-NOT: [indexDeclaration]
// CHECK:      [importedASTFile]: {{.*}}.h.pch
// CHECK-NEXT: [startedTranslationUnit]
// CHECK-NEXT: [enteredMainFile]: {{.*[/\\]}}index-pch-with-module.m
// CHECK-NEXT: [indexDeclaration]: kind: variable | name: glob | {{.*}} | loc: 10:5
// CHECK-NOT: [indexDeclaration]

// RUN: c-index-test -index-tu %t.h.pch | FileCheck %s -check-prefix=CHECK-PCH

// CHECK-PCH: [enteredMainFile]: {{.*[/\\]}}index-pch-with-module.m
// CHECK-PCH: [startedTranslationUnit]
// CHECK-PCH: [importedASTFile]: {{.*}}.cache{{[/\\]}}DependsOnModule.pcm | loc: 5:1 | name: "DependsOnModule" | isImplicit: 1
// CHECK-PCH: [indexDeclaration]: kind: variable | name: pch_glob | {{.*}} | loc: 6:12