aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Interpreter/InterpreterTest.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2023-08-29 19:38:34 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2023-08-29 19:42:58 +0000
commit452cb7f20bc7b976eb6fec4ac9f2d902f4175c08 (patch)
tree11c67e39f4abfe2c1bfe5643df13d1a204ccf1c8 /clang/unittests/Interpreter/InterpreterTest.cpp
parente6cd950d1b4a07f8c339b6f55374e4aa229e42f7 (diff)
downloadllvm-452cb7f20bc7b976eb6fec4ac9f2d902f4175c08.zip
llvm-452cb7f20bc7b976eb6fec4ac9f2d902f4175c08.tar.gz
llvm-452cb7f20bc7b976eb6fec4ac9f2d902f4175c08.tar.bz2
Reland "[clang-repl] Adapt to the recent dylib-related changes in ORC."
Original commit message:" 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 " This patch disables the test statement on windows as it seems we might have a bug in the way we model dllimports.
Diffstat (limited to 'clang/unittests/Interpreter/InterpreterTest.cpp')
-rw-r--r--clang/unittests/Interpreter/InterpreterTest.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index 1800bff..07fb002 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -234,10 +234,20 @@ 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);
+
+ // FIXME: Re-enable when we investigate the way we handle dllimports on Win.
+#ifndef _WIN32
+ EXPECT_EQ((unsigned long long)&printf, Addr->getValue());
+#endif // _WIN32
}
static void *AllocateObject(TypeDecl *TD, Interpreter &Interp) {