@@ -760,17 +760,34 @@ if_else_block_test() ->
760760 >>,
761761 ? assertEqual (dump_to_bin (Dump ), Stream ).
762762
763- shift_right_test () ->
764- State0 = ? BACKEND :new (? JIT_VARIANT_PIC , jit_stream_binary , jit_stream_binary :new (0 )),
765- {State1 , Reg } = ? BACKEND :move_to_native_register (State0 , {x_reg , 0 }),
766- State2 = ? BACKEND :shift_right (State1 , Reg , 3 ),
767- Stream = ? BACKEND :stream (State2 ),
768- Dump =
769- <<
770- " 0: f9401807 ldr x7, [x0, #48]\n "
771- " 4: d343fce7 lsr x7, x7, #3"
772- >>,
773- ? assertEqual (dump_to_bin (Dump ), Stream ).
763+ shift_right_test_ () ->
764+ [
765+ ? _test (begin
766+ State0 = ? BACKEND :new (? JIT_VARIANT_PIC , jit_stream_binary , jit_stream_binary :new (0 )),
767+ {State1 , Reg } = ? BACKEND :move_to_native_register (State0 , {x_reg , 0 }),
768+ {State2 , Reg } = ? BACKEND :shift_right (State1 , {free , Reg }, 3 ),
769+ Stream = ? BACKEND :stream (State2 ),
770+ Dump =
771+ <<
772+ " 0: f9401807 ldr x7, [x0, #48]\n "
773+ " 4: d343fce7 lsr x7, x7, #3"
774+ >>,
775+ ? assertEqual (dump_to_bin (Dump ), Stream )
776+ end ),
777+ ? _test (begin
778+ State0 = ? BACKEND :new (? JIT_VARIANT_PIC , jit_stream_binary , jit_stream_binary :new (0 )),
779+ {State1 , Reg } = ? BACKEND :move_to_native_register (State0 , {x_reg , 0 }),
780+ {State2 , OtherReg } = ? BACKEND :shift_right (State1 , Reg , 3 ),
781+ ? assertNotEqual (OtherReg , Reg ),
782+ Stream = ? BACKEND :stream (State2 ),
783+ Dump =
784+ <<
785+ " 0: f9401807 ldr x7, [x0, #48]\n "
786+ " 4: d343fce8 lsr x8, x7, #3"
787+ >>,
788+ ? assertEqual (dump_to_bin (Dump ), Stream )
789+ end )
790+ ].
774791
775792shift_left_test () ->
776793 State0 = ? BACKEND :new (? JIT_VARIANT_PIC , jit_stream_binary , jit_stream_binary :new (0 )),
0 commit comments