c-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.

-Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation.

FIXME: Could autoconf detect clang or availability of -isystem?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185927 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-index-test/Makefile b/tools/c-index-test/Makefile
index 4df90e6..5aaabef 100644
--- a/tools/c-index-test/Makefile
+++ b/tools/c-index-test/Makefile
@@ -37,4 +37,12 @@
 include $(CLANG_LEVEL)/Makefile
 
 LIBS += $(LIBXML2_LIBS)
+
+# Headers in $(LIBXML2_INC) should not be checked with clang's -Wdocumentation.
+# Use -isystem instead of -I then.
+# FIXME: Could autoconf detect clang or availability of -isystem?
+ifneq ($(findstring -Wdocumentation,$(OPTIMIZE_OPTION)),)
+CPPFLAGS += $(subst -I,-isystem ,$(LIBXML2_INC))
+else
 CPPFLAGS += $(LIBXML2_INC)
+endif