X-Git-Url: http://git.subgeniuskitty.com/vvhitespace/.git/blobdiff_plain/60d04456549c25d8125c85c899e877e0d0b5a13c..6b5e4b38b5fff236dce186ec191390d92d227a47:/tests/6001_push_intmin.pvvs diff --git a/tests/6001_push_intmin.pvvs b/tests/6001_push_intmin.pvvs new file mode 100644 index 0000000..6452d78 --- /dev/null +++ b/tests/6001_push_intmin.pvvs @@ -0,0 +1,22 @@ +@ This tests the interpreters ability to push the +@ most negative number directly to the stack. + +@ Construct the number -(2^63) on the stack indirectly. +SSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTN | -((2^63)-1) +SSSTN | PUSH 1 +TSST | SUBTRACT + +@ Now push -(2^63) directly onto the stack. +SSTTSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSN | -(2^63) + +@ See if the interpreter thinks -((2^63)-1) - 1 == -(2^63) +@ Print 1 for true and 0 for false. +TSST | SUBTRACT +NTSTN | BRZ > 1 +SSSSN | PUSH 0 +TNST | PUTDIGIT +NNN | DIE +NSSVTN | Mark: 1 +SSSTN | PUSH 1 +TNST | PUTDIGIT +NNN | DIE