llvm.org GIT mirror llvm / f228328
Quick fix for -DBUILD_SHARED_LIBS=on build after rL341502 libLLVMTestingSupport.so references a symbol in utils/unittest/UnitTestMain/TestMain.cpp (a layering issue) and will cause a link error because of -Wl,-z,defs (cmake/modules/HandleLLVMOptions.cmake) Waiting zturner for a better fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341580 91177308-0d34-0410-b5e6-96231b3b80d8 Fangrui Song 1 year, 1 month ago
3 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
5555 } // namespace detail
5656
5757 namespace unittest {
58 SmallString<128> getInputFileDirectory();
58 SmallString<128> getInputFileDirectory(const char *Argv0);
5959 }
6060 } // namespace llvm
6161
1212 using namespace llvm;
1313 using namespace llvm::unittest;
1414
15 extern const char *TestMainArgv0;
16
17 SmallString<128> llvm::unittest::getInputFileDirectory() {
18 llvm::SmallString<128> Result = llvm::sys::path::parent_path(TestMainArgv0);
15 SmallString<128> llvm::unittest::getInputFileDirectory(const char *Argv0) {
16 llvm::SmallString<128> Result = llvm::sys::path::parent_path(Argv0);
1917 llvm::sys::fs::make_absolute(Result);
2018 llvm::sys::path::append(Result, "llvm.srcdir.txt");
2119
2222 using namespace llvm;
2323 using namespace llvm::pdb;
2424
25 extern const char *TestMainArgv0;
26
2527 TEST(NativeSymbolReuseTest, GlobalSymbolReuse) {
26 SmallString<128> InputsDir = unittest::getInputFileDirectory();
28 SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0);
2729 llvm::sys::path::append(InputsDir, "empty.pdb");
2830
2931 std::unique_ptr S;
5052 }
5153
5254 TEST(NativeSymbolReuseTest, CompilandSymbolReuse) {
53 SmallString<128> InputsDir = unittest::getInputFileDirectory();
55 SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0);
5456 llvm::sys::path::append(InputsDir, "empty.pdb");
5557
5658 std::unique_ptr S;
9294 }
9395
9496 TEST(NativeSymbolReuseTest, CompilandSymbolReuseBackwards) {
95 SmallString<128> InputsDir = unittest::getInputFileDirectory();
97 SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0);
9698 llvm::sys::path::append(InputsDir, "empty.pdb");
9799
98100 std::unique_ptr S;