summaryrefslogtreecommitdiff
path: root/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp')
-rw-r--r--test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp b/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
new file mode 100644
index 0000000000000..035155c96c925
--- /dev/null
+++ b/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
@@ -0,0 +1,16 @@
+// Clang on MacOS can find libc++ living beside the installed compiler.
+// This test makes sure our libTooling-based tools emulate this properly with
+// fixed compilation database.
+//
+// RUN: rm -rf %t
+// RUN: mkdir %t
+//
+// Install the mock libc++ (simulates the libc++ directory structure).
+// RUN: cp -r %S/Inputs/mock-libcxx %t/
+//
+// RUN: cp $(which clang-check) %t/mock-libcxx/bin/
+// RUN: cp "%s" "%t/test.cpp"
+// RUN: %t/mock-libcxx/bin/clang-check -p "%t" "%t/test.cpp" -- -stdlib=libc++
+
+#include <mock_vector>
+vector v;