Add tests for break, cont, and halt instructions.

This commit is contained in:
Eric Anholt 2006-09-01 13:37:07 -07:00 committed by Damien Lespiau
parent f45ac8b2cc
commit 9201e4e2a0
8 changed files with 28 additions and 0 deletions

View File

@ -13,6 +13,9 @@ if
iff
while
else
break
cont
halt
wait
endif
immediate

View File

@ -15,6 +15,9 @@ TESTS = \
iff \
while \
else \
break \
cont \
halt \
wait \
endif \
immediate
@ -52,6 +55,12 @@ TESTDATA = \
while.g4a \
else.expected \
else.g4a \
break.expected \
break.g4a \
cont.expected \
cont.g4a \
halt.expected \
halt.g4a \
wait.expected \
wait.g4a \
endif.expected \

View File

@ -0,0 +1 @@
{ 0x00000028, 0x34001c00, 0x00011400, 0x00010002 },

6
assembler/test/break.g4a Normal file
View File

@ -0,0 +1,6 @@
/* The break instruction syntax, which is currently just what was in the BNF,
* is bad. It really needs 2 arguments -- pop count (19:16, how many
* loops to break out of), and the IP count (15:0). For now, this argument
* should cover 1 loop, and jumping 2 instructions.
*/
break 65538;

View File

@ -0,0 +1 @@
{ 0x00000029, 0x34001c00, 0x00011400, 0x00010002 },

6
assembler/test/cont.g4a Normal file
View File

@ -0,0 +1,6 @@
/* The cont instruction syntax, which is currently just what was in the BNF,
* is bad. It really needs 2 arguments -- pop count (19:16, how many
* loops to break out of), and the IP count (15:0). For now, this argument
* should cover 1 loop, and jumping 2 instructions.
*/
cont 65538;

View File

@ -0,0 +1 @@
{ 0x0000002a, 0x34001c00, 0x00011400, 0x00000002 },

1
assembler/test/halt.g4a Normal file
View File

@ -0,0 +1 @@
halt 2;