summaryrefslogtreecommitdiffstats
path: root/test/Index/index-pch-with-module.m
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-11 19:00:44 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-11 19:00:44 +0000
commit8003fd613724847bba834ae41aca6f446af1f818 (patch)
tree1aed373ce9afbf882666f06410ee0fc4ba872ec2 /test/Index/index-pch-with-module.m
parent90da80c869eebc5a73bf031af5bedb6f281214fb (diff)
[libclang] Add tests for indexing modules and PCHs using modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/index-pch-with-module.m')
-rw-r--r--test/Index/index-pch-with-module.m31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Index/index-pch-with-module.m b/test/Index/index-pch-with-module.m
new file mode 100644
index 0000000000..c962c307a8
--- /dev/null
+++ b/test/Index/index-pch-with-module.m
@@ -0,0 +1,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 -fmodule-cache-path %t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash
+// RUN: c-index-test -index-file %s -include %t.h -fmodule-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: [enteredMainFile]: {{.*}}/index-pch-with-module.m
+// CHECK-NEXT: [startedTranslationUnit]
+// 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:2 | name: "DependsOnModule" | isImplicit: 1
+// CHECK-PCH: [indexDeclaration]: kind: variable | name: pch_glob | {{.*}} | loc: 6:12