aboutsummaryrefslogtreecommitdiffstats
path: root/csc/linker-test.csc
diff options
context:
space:
mode:
Diffstat (limited to 'csc/linker-test.csc')
-rw-r--r--csc/linker-test.csc27
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))))))))