def f(): s = lltype.malloc(S) s.x = 42 llop.bare_setfield(lltype.Void, s0, void('next'), s) llop.gc_writebarrier(lltype.Void, llmemory.cast_ptr_to_adr(s0)) rgc.collect(0) return s0.next.x
def test_llop_with_voids_interp(): from rpython.rtyper.annlowlevel import LowLevelAnnotatorPolicy S = lltype.GcStruct('S', ('x', lltype.Signed), ('y', lltype.Signed)) name_y = void('y') def llf(): s = lltype.malloc(S) llop.bare_setfield(lltype.Void, s, void('x'), 3) llop.bare_setfield(lltype.Void, s, name_y, 2) return s.x + s.y res = interpret(llf, [], policy=LowLevelAnnotatorPolicy()) assert res == 5
def llf(): s = lltype.malloc(S) llop.bare_setfield(lltype.Void, s, void('x'), 3) llop.bare_setfield(lltype.Void, s, name_y, 2) return s.x + s.y