1 # Tests for Mu's stream primitives. 2 3 fn test-stream { 4 # write an int to a stream, then read it back 5 var s: (stream int 4) 6 var s2/ecx: (addr stream int 4) <- address s 7 var x: int 8 copy-to x, 0x34 9 var x2/edx: (addr int) <- address x 10 write-to-stream s2, x2 11 var y: int 12 var y2/ebx: (addr int) <- address y 13 read-from-stream s2, y2 14 check-ints-equal y, 0x34, "F - test-stream" 15 }