Skip to content

Commit 913f011

Browse files
committed
use LLVM_TOOLS_BINARY_DIR
The not binary will always be placed in this directory.
1 parent de7f997 commit 913f011

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

flang/unittests/Runtime/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ target_link_libraries(FlangRuntimeTests
3636
FortranRuntime
3737
)
3838

39+
target_compile_definitions(FlangRuntimeTests PRIVATE LLVM_TOOLS_BINARY_DIR="${LLVM_TOOLS_BINARY_DIR}")
40+
3941
add_subdirectory(CUDA)

flang/unittests/Runtime/CommandTest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,8 @@ TEST_F(ZeroArguments, ECLValidCommandStatusSetSync) {
343343

344344
TEST_F(ZeroArguments, ECLGeneralErrorCommandErrorSync) {
345345
llvm::SmallString<64> cmd;
346-
if (std::error_code ec = llvm::sys::fs::current_path(cmd))
347-
FAIL() << "Failed to obtain the current working directory";
348-
llvm::sys::path::append(cmd, "bin", "not");
346+
llvm::sys::path::native(LLVM_TOOLS_BINARY_DIR, cmd);
347+
llvm::sys::path::append(cmd, "not");
349348
OwningPtr<Descriptor> command{CharDescriptor(cmd.data())};
350349
bool wait{true};
351350
OwningPtr<Descriptor> exitStat{IntDescriptor(404)};

0 commit comments

Comments
 (0)