]> granicus.if.org Git - clang/commitdiff
[test] Pass -ccc-install-dir in mac compilation db test
authorMichal Gorny <mgorny@gentoo.org>
Mon, 21 Jan 2019 17:05:43 +0000 (17:05 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Mon, 21 Jan 2019 17:05:43 +0000 (17:05 +0000)
Pass -ccc-install-dir explicitly as the compilation database code does
not pass argv[0] to getMainExecutable(), while some systems require it
to return the correct path.  Since the relevant code is apparently only
applicable to Darwin, just pass correct -ccc-install-dir to make
the tests pass on *BSD systems.

Differential Revision: https://reviews.llvm.org/D56976

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351752 91177308-0d34-0410-b5e6-96231b3b80d8

test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp

index 3778c395cd1007d2068dafd8b8671f57d1968b52..f6424380d719322ad140a1bb8cee424dde53888f 100644 (file)
 //
 // RUN: cp 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++ -target x86_64-apple-darwin
+// RUN: "%t/mock-libcxx/bin/clang-check" -p %t %t/test.cpp -- \
+// RUN:     -stdlib=libc++ -target x86_64-apple-darwin \
+// RUN:     -ccc-install-dir %t/mock-libcxx/bin
+//
+// ^ -ccc-install-dir passed to unbreak tests on *BSD where
+//   getMainExecutable() relies on real argv[0] being passed
 #include <mock_vector>
 vector v;