summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/pch-from-libclang.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Index/pch-from-libclang.c')
-rw-r--r--clang/test/Index/pch-from-libclang.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Index/pch-from-libclang.c b/clang/test/Index/pch-from-libclang.c
new file mode 100644
index 00000000000..e1bbe7cbd12
--- /dev/null
+++ b/clang/test/Index/pch-from-libclang.c
@@ -0,0 +1,18 @@
+// Check that clang can use a PCH created from libclang.
+// RUN: c-index-test -write-pch %t.h.pch %s -fmodules -fmodules-cache-path=%t.mcp
+// RUN: %clang -fsyntax-only -include %t.h %s -Xclang -verify -fmodules -fmodules-cache-path=%t.mcp -Xclang -detailed-preprocessing-record
+
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+struct S { int x; };
+
+#else
+
+void test(struct S *s) {
+ s->x = 0;
+}
+
+#endif
OpenPOWER on IntegriCloud