Adds support for auto-detection of compilation databases
from a source file and changes clang-check to make use of this.

This makes clang-check just work on in-tree builds, and allows
easy setup via a symlink per source directory to make clang-check
work without any extra configuration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159990 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Tooling/clang-check-builtin-headers.cpp b/test/Tooling/clang-check-builtin-headers.cpp
index fda68cc..504d197 100644
--- a/test/Tooling/clang-check-builtin-headers.cpp
+++ b/test/Tooling/clang-check-builtin-headers.cpp
@@ -3,7 +3,7 @@
 // Add a path that doesn't exist as argv[0] for the compile command line:
 // RUN: echo '[{"directory":".","command":"/random/tool -c %t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
 // RUN: cp "%s" "%t/test.cpp"
-// RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s
+// RUN: clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
 // FIXME: Make the above easier.
 
 #include <stddef.h>