aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Interpreter/InterpreterTest.cpp
diff options
context:
space:
mode:
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) {