MCPcopy Create free account
hub / github.com/Samsung/UTopia / TEST_F

Function TEST_F

tests/astirmap/TestMacroMapper.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7class TestMacroMapper : public TestBase {};
8
9TEST_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

Callers

nothing calls this directly

Calls 2

getInstructionMethod · 0.80
getASTDefNodeMethod · 0.45

Tested by

no test coverage detected