aboutsummaryrefslogtreecommitdiff
path: root/test/Tooling
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2012-05-07 09:17:48 +0000
committerManuel Klimek <klimek@google.com>2012-05-07 09:17:48 +0000
commit00f3c4f499cc27c88005176226bb424f6db4a31b (patch)
treef4c0ea23832cd90a58a2897d14e3a1b1eec58e8b /test/Tooling
parent0265555a0fec81102bfb3757cfc7f3d90dbbe409 (diff)
Fixes resolution of relative paths when running clang tools.
The chdir is not the perfect fix, as it is thread hostile. The real fix will be to make -working-dir work correctly, which will take time to implement. Before that, the tooling library cannot be used concurrently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Tooling')
-rw-r--r--test/Tooling/clang-check-chdir.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Tooling/clang-check-chdir.cpp b/test/Tooling/clang-check-chdir.cpp
new file mode 100644
index 0000000000..fbcd7ae3e8
--- /dev/null
+++ b/test/Tooling/clang-check-chdir.cpp
@@ -0,0 +1,18 @@
+// Verifies that paths are resolved relatively to the directory specified in the
+// compilation database.
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp -I.\",\"file\":\"%t/test.cpp\"}]" > %t/compile_commands.json
+// RUN: cp "%s" "%t/test.cpp"
+// RUN: touch "%t/clang-check-test.h"
+// RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s
+// FIXME: Make the above easier.
+
+#include "clang-check-test.h"
+
+// CHECK: C++ requires
+invalid;
+
+// FIXME: JSON doesn't like path separator '\', on Win32 hosts.
+// FIXME: clang-check doesn't like gcc driver on cygming.
+// XFAIL: cygwin,mingw32,win32