1# sh testcase for addv $rm, $rn -*- Asm -*- 2# mach: all 3# as: -isa=shcompact 4# ld: -m shelf32 5 6 .include "compact/testutils.inc" 7 8 start 9zero: 10 mov #0, r0 11 mov #0, r1 12 addv r0, r1 13 # Assert !T and #0. 14 bt wrong 15 assert r1, #0 16 17one: 18 mov #0, r0 19 mov #1, r1 20 addv r0, r1 21 # Assert !T and #1. 22 bt wrong 23 assert r1, #1 24 25large: 26 # Produce MAXINT in R0. 27 mov #0, r0 28 not r0, r0 29 shlr r0 30 31 # Put #3 into R1. 32 mov #3, r1 33 34 # Add them and overflow. 35 addv r0, r1 36 37 # Assert T and overflowed value. 38 bf wrong 39 mov #1, r7 40 rotr r7 41 add #2, r7 42 cmp/eq r1, r7 43 bf wrong 44 45okay: 46 pass 47wrong: 48 fail 49