| 7 | class TestMacroMapper : public TestBase {}; |
| 8 | |
| 9 | TEST_F(TestMacroMapper, FunctionName) { |
| 10 | |
| 11 | const std::string CODE = "void API_1();\n" |
| 12 | "void test_func_name() {\n" |
| 13 | "#define NAME API_1\n" |
| 14 | " NAME();\n" |
| 15 | "#undef NAME\n" |
| 16 | "}\n"; |
| 17 | |
| 18 | ASSERT_TRUE(load(CODE, "-O0 -g", CompileHelper::SourceType_C)); |
| 19 | |
| 20 | auto *I = IRAH->getInstruction("test_func_name", 0, 0); |
| 21 | ASSERT_TRUE(I); |
| 22 | |
| 23 | auto *CB = llvm::dyn_cast_or_null<llvm::CallBase>(I); |
| 24 | ASSERT_TRUE(CB); |
| 25 | ASSERT_TRUE(AIMap->getASTDefNode(*CB)); |
| 26 | } |
| 27 | |
| 28 | } // end namespace ftg |
nothing calls this directly
no test coverage detected