diff options
Diffstat (limited to 'compiler-rt/lib/interception/tests/interception_linux_test.cc')
-rw-r--r-- | compiler-rt/lib/interception/tests/interception_linux_test.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler-rt/lib/interception/tests/interception_linux_test.cc b/compiler-rt/lib/interception/tests/interception_linux_test.cc index 3aade45ebcd..5a1ca6ecbf5 100644 --- a/compiler-rt/lib/interception/tests/interception_linux_test.cc +++ b/compiler-rt/lib/interception/tests/interception_linux_test.cc @@ -33,6 +33,17 @@ INTERCEPTOR(int, isdigit, int d) { namespace __interception { +TEST(Interception, GetRealFunctionAddress) { + uptr malloc_address = 0; + EXPECT_TRUE(GetRealFunctionAddress("malloc", &malloc_address, 0, 0)); + EXPECT_NE(0U, malloc_address); + + uptr dummy_address = 0; + EXPECT_TRUE( + GetRealFunctionAddress("dummy_doesnt_exist__", &dummy_address, 0, 0)); + EXPECT_EQ(0U, dummy_address); +} + TEST(Interception, GetFuncAddr) { EXPECT_NE(GetFuncAddr("malloc"), nullptr); EXPECT_EQ(GetFuncAddr("does_not_exist"), nullptr); |