(self)
| 756 | ) |
| 757 | |
| 758 | def test_get_element_ptr(self) -> None: |
| 759 | r = RStruct( |
| 760 | "Foo", ["b", "i32", "i64"], [bool_rprimitive, int32_rprimitive, int64_rprimitive] |
| 761 | ) |
| 762 | self.assert_emit( |
| 763 | GetElementPtr(self.o, r, "b"), |
| 764 | """cpy_r_r0 = (CPyPtr)((CPyPtr)cpy_r_o + offsetof(Foo, b));""", |
| 765 | ) |
| 766 | self.assert_emit( |
| 767 | GetElementPtr(self.o, r, "i32"), |
| 768 | """cpy_r_r0 = (CPyPtr)((CPyPtr)cpy_r_o + offsetof(Foo, i32));""", |
| 769 | ) |
| 770 | self.assert_emit( |
| 771 | GetElementPtr(self.o, r, "i64"), |
| 772 | """cpy_r_r0 = (CPyPtr)((CPyPtr)cpy_r_o + offsetof(Foo, i64));""", |
| 773 | ) |
| 774 | |
| 775 | def test_set_element(self) -> None: |
| 776 | # Use compact syntax when setting the initial element of an undefined value |
nothing calls this directly
no test coverage detected