mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
unittests/MultiJITTest.cpp: Tweak how to check symbol value for Win32 --enable-shared.
getPointerToNamedFunction might be indirect jump on Win32 --enable-shared. FF 25 <disp32>: jmp *(pointer to IAT) llvm-svn: 144178
This commit is contained in:
parent
7ff77dc2b1
commit
91dabac407
@ -160,8 +160,21 @@ TEST(MultiJitTest, JitPool) {
|
||||
EXPECT_EQ(getPointerToNamedFunction("foo2"), foo2);
|
||||
|
||||
// Symbol search
|
||||
EXPECT_EQ((intptr_t)getPointerToNamedFunction("getPointerToNamedFunction"),
|
||||
(intptr_t)&getPointerToNamedFunction);
|
||||
intptr_t
|
||||
sa = (intptr_t)getPointerToNamedFunction("getPointerToNamedFunction");
|
||||
EXPECT_TRUE(sa != 0);
|
||||
intptr_t fa = (intptr_t)&getPointerToNamedFunction;
|
||||
EXPECT_TRUE(fa != 0);
|
||||
#ifdef __i386__
|
||||
// getPointerToNamedFunction might be indirect jump on Win32 --enable-shared.
|
||||
// FF 25 <disp32>: jmp *(pointer to IAT)
|
||||
if (sa != fa && memcmp((char *)fa, "\xFF\x25", 2) == 0) {
|
||||
fa = *(intptr_t *)(fa + 2); // Address to IAT
|
||||
EXPECT_TRUE(fa != 0);
|
||||
fa = *(intptr_t *)fa; // Bound value of IAT
|
||||
}
|
||||
#endif
|
||||
EXPECT_TRUE(sa == fa);
|
||||
}
|
||||
#endif // !defined(__arm__)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user