aboutsummaryrefslogtreecommitdiff
path: root/test/Tooling/auto-detect-from-source-parent.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2012-07-10 13:10:51 +0000
committerManuel Klimek <klimek@google.com>2012-07-10 13:10:51 +0000
commit8fa2fb859a4cb8e67d9763225281d9b0aa9cb59f (patch)
treebaba2e136725c1e8cba0ce410db39759981af927 /test/Tooling/auto-detect-from-source-parent.cpp
parent3f6d513d51a382371669f4d0b943fa830fffeef2 (diff)
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
Diffstat (limited to 'test/Tooling/auto-detect-from-source-parent.cpp')
-rw-r--r--test/Tooling/auto-detect-from-source-parent.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Tooling/auto-detect-from-source-parent.cpp b/test/Tooling/auto-detect-from-source-parent.cpp
new file mode 100644
index 0000000000..cb5fd56328
--- /dev/null
+++ b/test/Tooling/auto-detect-from-source-parent.cpp
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/abc/def/ijk/qwe
+// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/abc/def/ijk/qwe/test.cpp\",\"file\":\"%t/abc/def/ijk/qwe/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
+// RUN: cp "%s" "%t/abc/def/ijk/qwe/test.cpp"
+// RUN: clang-check "%t/abc/def/ijk/qwe/test.cpp" 2>&1 | FileCheck %s
+
+// CHECK: C++ requires
+invalid;