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

Function TEST_F

tests/rootdefanalysis/TestField.cpp:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47class TestRDField : public TestBase {};
48
49TEST_F(TestRDField, ArrayIndexN) {
50
51 const char *CODE = "void test() {\n"
52 " int Var1[10];\n"
53 " Var1[3] = 20;\n"
54 "}\n";
55
56 ASSERT_TRUE(loadC(CODE));
57
58 Instruction *I = nullptr, *Base = nullptr;
59 INST(I, "test", 0, 3);
60 INST(Base, "test", 0, 0);
61
62 RDNode Node(1, *I);
63 auto &Target = Node.getTarget();
64 auto &TargetBase = Target.getIR();
65 auto &MemoryIndices = Target.getMemoryIndices();
66
67 ASSERT_EQ(&TargetBase, Base);
68 ASSERT_EQ(MemoryIndices.size(), 1);
69 ASSERT_EQ(MemoryIndices[0], 3);
70}
71
72TEST_F(TestRDField, MultiArrayIndexN) {
73

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
getDefinitionMethod · 0.80
beginMethod · 0.80

Tested by

no test coverage detected