| 47 | class TestRDField : public TestBase {}; |
| 48 | |
| 49 | TEST_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 | |
| 72 | TEST_F(TestRDField, MultiArrayIndexN) { |
| 73 |
nothing calls this directly
no test coverage detected