// S : tags c min $TAGS // S : expect --result valid // S : cc -o test.bc $CC_OPT $file // S : verify $V_OPT test.bc #include #include #include __vm_pointer_t ptr; void poke( int off, int len, int val ) { __vm_poke( _VM_ML_User, ptr.obj, ptr.off + off, len, val ); } int main() { char a[ 16 ]; ptr = __vm_pointer_split( &a ); poke( 4, 8, 42 ); __vm_meta_t meta = __vm_peek( _VM_ML_User, ptr.obj, ptr.off, 8 ); __dios_trace_f( "%d %d", meta.offset, meta.length ); assert( meta.offset == 4 ); assert( meta.length == 8 ); assert( meta.value == 42 ); return 0; }