xref: /minix3/external/bsd/llvm/dist/clang/test/Index/index-pch-with-module.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc
2*f4a2713aSLionel Sambuc#ifndef PCH_HEADER
3*f4a2713aSLionel Sambuc#define PCH_HEADER
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc#include <DependsOnModule/DependsOnModule.h>
6*f4a2713aSLionel Sambucextern int pch_glob;
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc#else
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambucint glob;
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc#endif
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc// RUN: rm -rf %t.cache
15*f4a2713aSLionel Sambuc// RUN: c-index-test -write-pch %t.h.pch %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash
16*f4a2713aSLionel Sambuc// RUN: c-index-test -index-file %s -include %t.h -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \
17*f4a2713aSLionel Sambuc// RUN:      -Xclang -fdisable-module-hash | FileCheck %s
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc// CHECK-NOT: [indexDeclaration]
20*f4a2713aSLionel Sambuc// CHECK:      [importedASTFile]: {{.*}}.h.pch
21*f4a2713aSLionel Sambuc// CHECK-NEXT: [enteredMainFile]: {{.*[/\\]}}index-pch-with-module.m
22*f4a2713aSLionel Sambuc// CHECK-NEXT: [startedTranslationUnit]
23*f4a2713aSLionel Sambuc// CHECK-NEXT: [indexDeclaration]: kind: variable | name: glob | {{.*}} | loc: 10:5
24*f4a2713aSLionel Sambuc// CHECK-NOT: [indexDeclaration]
25*f4a2713aSLionel Sambuc
26*f4a2713aSLionel Sambuc// RUN: c-index-test -index-tu %t.h.pch | FileCheck %s -check-prefix=CHECK-PCH
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc// CHECK-PCH: [enteredMainFile]: {{.*[/\\]}}index-pch-with-module.m
29*f4a2713aSLionel Sambuc// CHECK-PCH: [startedTranslationUnit]
30*f4a2713aSLionel Sambuc// CHECK-PCH: [importedASTFile]: {{.*}}.cache{{[/\\]}}DependsOnModule.pcm | loc: 5:2 | name: "DependsOnModule" | isImplicit: 1
31*f4a2713aSLionel Sambuc// CHECK-PCH: [indexDeclaration]: kind: variable | name: pch_glob | {{.*}} | loc: 6:12
32