diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2023-08-29 15:37:34 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2023-08-29 19:17:18 +0000 |
commit | 196d8569d46dc5200c44e70cdf839b042148b988 (patch) | |
tree | cfed2ae67a51340a2cafd4c60c4f6d931b68b756 /clang/unittests/Interpreter/InterpreterTest.cpp | |
parent | 34e2f4f2e28a464b127d878979efbc87bc148db5 (diff) | |
download | llvm-196d8569d46dc5200c44e70cdf839b042148b988.zip llvm-196d8569d46dc5200c44e70cdf839b042148b988.tar.gz llvm-196d8569d46dc5200c44e70cdf839b042148b988.tar.bz2 |
[clang-repl] Adapt to the recent dylib-related changes in ORC.
ORC splits into separate dylibs symbols coming from the process and symbols
materialized in the Jit. This patch adapts intent of the existing interface and
adds a regression test to make sure both Jit'd and compiled symbols can be found.
Differential revision: https://reviews.llvm.org/D159115
Diffstat (limited to 'clang/unittests/Interpreter/InterpreterTest.cpp')
-rw-r--r-- | clang/unittests/Interpreter/InterpreterTest.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp index 1800bff..0f546d2 100644 --- a/clang/unittests/Interpreter/InterpreterTest.cpp +++ b/clang/unittests/Interpreter/InterpreterTest.cpp @@ -234,10 +234,16 @@ TEST(IncrementalProcessing, FindMangledNameSymbol) { } std::string MangledName = MangleName(FD); - auto Addr = cantFail(Interp->getSymbolAddress(MangledName)); - EXPECT_NE(0U, Addr.getValue()); + auto Addr = Interp->getSymbolAddress(MangledName); + EXPECT_FALSE(!Addr); + EXPECT_NE(0U, Addr->getValue()); GlobalDecl GD(FD); - EXPECT_EQ(Addr, cantFail(Interp->getSymbolAddress(GD))); + EXPECT_EQ(*Addr, cantFail(Interp->getSymbolAddress(GD))); + cantFail( + Interp->ParseAndExecute("extern \"C\" int printf(const char*,...);")); + Addr = Interp->getSymbolAddress("printf"); + EXPECT_FALSE(!Addr); + EXPECT_EQ((unsigned long long)&printf, Addr->getValue()); } static void *AllocateObject(TypeDecl *TD, Interpreter &Interp) { |