Skip to content

Commit

Permalink
[ORC-RT] Fix unit tests on Linux.
Browse files Browse the repository at this point in the history
The unit tests may transiently depend on __orc_rt_log_error, which is usually
provided by an alias when loading the runtime through the JIT. The unit tests
statically link the runtime, so this patch provides a fixed definition.
  • Loading branch information
lhames committed Dec 9, 2024
1 parent b33c807 commit f6c51ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler-rt/lib/orc/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(UNITTEST_SOURCES
adt_test.cpp
bitmask_enum_test.cpp
c_api_test.cpp
common.cpp
endian_test.cpp
error_test.cpp
executor_address_test.cpp
Expand Down
6 changes: 6 additions & 0 deletions compiler-rt/lib/orc/tests/unit/common.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

/// Defined so that tests can use code that logs errors.
extern "C" void __orc_rt_log_error(const char *ErrMsg) {
fprintf(stderr, "orc runtime error: %s\n", ErrMsg);
}

0 comments on commit f6c51ea

Please sign in to comment.