Index: include/llvm/Testing/Support/SupportHelpers.h =================================================================== --- include/llvm/Testing/Support/SupportHelpers.h +++ include/llvm/Testing/Support/SupportHelpers.h @@ -56,7 +56,7 @@ } // namespace detail namespace unittest { -SmallString<128> getInputFileDirectory(); +SmallString<128> getInputFileDirectory(const char *TestBinary); } } // namespace llvm Index: lib/Testing/Support/SupportHelpers.cpp =================================================================== --- lib/Testing/Support/SupportHelpers.cpp +++ lib/Testing/Support/SupportHelpers.cpp @@ -13,10 +13,8 @@ using namespace llvm; using namespace llvm::unittest; -extern const char *TestMainArgv0; - -SmallString<128> llvm::unittest::getInputFileDirectory() { - llvm::SmallString<128> Result = llvm::sys::path::parent_path(TestMainArgv0); +SmallString<128> llvm::unittest::getInputFileDirectory(const char *TestBinary) { + llvm::SmallString<128> Result = llvm::sys::path::parent_path(TestBinary); llvm::sys::fs::make_absolute(Result); llvm::sys::path::append(Result, "llvm.srcdir.txt"); Index: unittests/DebugInfo/PDB/NativeSymbolReuseTest.cpp =================================================================== --- unittests/DebugInfo/PDB/NativeSymbolReuseTest.cpp +++ unittests/DebugInfo/PDB/NativeSymbolReuseTest.cpp @@ -23,8 +23,10 @@ using namespace llvm; using namespace llvm::pdb; +extern const char *TestMainArgv0; + TEST(NativeSymbolReuseTest, GlobalSymbolReuse) { - SmallString<128> InputsDir = unittest::getInputFileDirectory(); + SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0); llvm::sys::path::append(InputsDir, "empty.pdb"); std::unique_ptr S; @@ -51,7 +53,7 @@ } TEST(NativeSymbolReuseTest, CompilandSymbolReuse) { - SmallString<128> InputsDir = unittest::getInputFileDirectory(); + SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0); llvm::sys::path::append(InputsDir, "empty.pdb"); std::unique_ptr S; @@ -93,7 +95,7 @@ } TEST(NativeSymbolReuseTest, CompilandSymbolReuseBackwards) { - SmallString<128> InputsDir = unittest::getInputFileDirectory(); + SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0); llvm::sys::path::append(InputsDir, "empty.pdb"); std::unique_ptr S;