diff options
author | Eric Anholt <eric@anholt.net> | 2006-09-01 13:37:07 -0700 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-03-04 15:54:25 +0000 |
commit | 9201e4e2a0eb2311daf5333f198631a497e06313 (patch) | |
tree | 5b39949b0b42074befc15b4ec3025e509eb05eba /assembler/test | |
parent | f45ac8b2cca414224427069ae7edc28d5e8e4278 (diff) |
Add tests for break, cont, and halt instructions.
Diffstat (limited to 'assembler/test')
-rw-r--r-- | assembler/test/.gitignore | 3 | ||||
-rw-r--r-- | assembler/test/Makefile.am | 9 | ||||
-rw-r--r-- | assembler/test/break.expected | 1 | ||||
-rw-r--r-- | assembler/test/break.g4a | 6 | ||||
-rw-r--r-- | assembler/test/cont.expected | 1 | ||||
-rw-r--r-- | assembler/test/cont.g4a | 6 | ||||
-rw-r--r-- | assembler/test/halt.expected | 1 | ||||
-rw-r--r-- | assembler/test/halt.g4a | 1 |
8 files changed, 28 insertions, 0 deletions
diff --git a/assembler/test/.gitignore b/assembler/test/.gitignore index 68a959c3..090a4f9f 100644 --- a/assembler/test/.gitignore +++ b/assembler/test/.gitignore @@ -13,6 +13,9 @@ if iff while else +break +cont +halt wait endif immediate diff --git a/assembler/test/Makefile.am b/assembler/test/Makefile.am index 3045e96d..541da73a 100644 --- a/assembler/test/Makefile.am +++ b/assembler/test/Makefile.am @@ -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 \ diff --git a/assembler/test/break.expected b/assembler/test/break.expected new file mode 100644 index 00000000..4e3e4ebe --- /dev/null +++ b/assembler/test/break.expected @@ -0,0 +1 @@ + { 0x00000028, 0x34001c00, 0x00011400, 0x00010002 }, diff --git a/assembler/test/break.g4a b/assembler/test/break.g4a new file mode 100644 index 00000000..f23a0bac --- /dev/null +++ b/assembler/test/break.g4a @@ -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; diff --git a/assembler/test/cont.expected b/assembler/test/cont.expected new file mode 100644 index 00000000..a1cd9360 --- /dev/null +++ b/assembler/test/cont.expected @@ -0,0 +1 @@ + { 0x00000029, 0x34001c00, 0x00011400, 0x00010002 }, diff --git a/assembler/test/cont.g4a b/assembler/test/cont.g4a new file mode 100644 index 00000000..300e7d8f --- /dev/null +++ b/assembler/test/cont.g4a @@ -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; diff --git a/assembler/test/halt.expected b/assembler/test/halt.expected new file mode 100644 index 00000000..b92db85f --- /dev/null +++ b/assembler/test/halt.expected @@ -0,0 +1 @@ + { 0x0000002a, 0x34001c00, 0x00011400, 0x00000002 }, diff --git a/assembler/test/halt.g4a b/assembler/test/halt.g4a new file mode 100644 index 00000000..e6952b19 --- /dev/null +++ b/assembler/test/halt.g4a @@ -0,0 +1 @@ +halt 2; |