diff options
author | Araq <rumpf_a@web.de> | 2013-10-25 13:30:34 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-10-25 13:30:34 +0200 |
commit | 6ea538cec3f2da832873252d0ec3810b9dbfede4 (patch) | |
tree | a5d6e6abd506dbbfca91485137e36c48cd3fba85 /tests/compile | |
parent | ca12bf76f595027076a437f8bf98a1928f1504d4 (diff) | |
download | Nim-6ea538cec3f2da832873252d0ec3810b9dbfede4.tar.gz |
computed goto now works; some progress on the new VM
Diffstat (limited to 'tests/compile')
-rw-r--r-- | tests/compile/tcomputedgoto.nim | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/compile/tcomputedgoto.nim b/tests/compile/tcomputedgoto.nim index 2c3b4bbd4..b21fc07a3 100644 --- a/tests/compile/tcomputedgoto.nim +++ b/tests/compile/tcomputedgoto.nim @@ -1,16 +1,16 @@ discard """ - output: '''yeah A -yeah A -yeah CD -yeah CD -yeah A -yeah CD -yeah CD -yeah A -yeah B -yeah A -yeah A -yeah A''' + output: '''yeah A enumB +yeah A enumB +yeah CD enumD +yeah CD enumE +yeah A enumB +yeah CD enumE +yeah CD enumD +yeah A enumB +yeah B enumC +yeah A enumB +yeah A enumB +yeah A enumB''' """ type @@ -32,13 +32,14 @@ proc vm() = while true: {.computedGoto.} let instr = instructions[pc] + let ra = instr.succ # instr.regA case instr of enumA: - echo "yeah A" + echo "yeah A ", ra of enumC, enumD: - echo "yeah CD" + echo "yeah CD ", ra of enumB: - echo "yeah B" + echo "yeah B ", ra of enumE: break inc(pc) |