diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-07-30 09:50:29 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-07-30 09:50:29 -0700 |
| commit | 351bcc91b53c3559309002388fd3357f5700f4b6 (patch) | |
| tree | 3dac2dafa5f2842c6716864e14582fc6d15e5ffe /csc/linker-test.csc | |
| parent | Write more tests for decode. (diff) | |
| download | chromatopelma-351bcc91b53c3559309002388fd3357f5700f4b6.tar.zst | |
Fix some test cases in the compiler.
Diffstat (limited to 'csc/linker-test.csc')
| -rw-r--r-- | csc/linker-test.csc | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/csc/linker-test.csc b/csc/linker-test.csc index 7b5d5db..3c24e90 100644 --- a/csc/linker-test.csc +++ b/csc/linker-test.csc @@ -18,43 +18,32 @@ (test link-labels (assert-equal - '((jmp (const 3)) - (jmp (const 2)) + '((alloc (local 0) (const 0)) (jmp (const 1)) - (jmp (const 1))) + (jmp (const 0))) (link '(((label 0) (jmp (label 1)) (label 1) - (jmp (label 0)) - (label init) (jmp (label 0))))))) (test link-labels-are-unique-per-program (assert-equal - '((jmp (const 2)) - (jmp (const 1)) - (jmp (const 1)) - (jmp (const 5)) - (jmp (const 4)) - (jmp (const 4))) + '((alloc (local 0) (const 0)) + (jmp (const 0)) + (jmp (const 1))) (link '(((label 0) - (jmp (label 0)) - (label init) (jmp (label 0))) ((label 0) - (jmp (label 0)) - (label init) (jmp (label 0))))))) (test link-globals (assert-equal - '((jmp (const 1)) - (peek (local 0) (const 10))) + '((alloc (local 0) (const 11)) + (peek (local 1) (local 0) (const 10))) (link - '(((label init) - (peek (local 0) (global cons (csc based))))) + '(((peek (local 1) (local 0) (global cons (csc based))))) (alist->map compare-globals '(((global cons (csc based)) . 10)))))))) |
