1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3 ;; Copyright (C) 2003, Frode Vatvedt Fjeld <frodef@acm.org>
5 ;; Filename: ia-x86-test.lisp
6 ;; Description: Regression tests for the assembler
7 ;; Author: Nikodemus Siivola
8 ;; Created at: Wed Oct 20 23:13:46 1999
10 ;; $Id: ia-x86-test.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14 (defpackage :ia-x86-test
15 (:use
:cl
:ia-x86
:rt
))
17 (in-package :ia-x86-test
)
23 (defvar *proglist-1
* '((:movl
10 :eax
) loop
28 (deftest read-proglist
.1
29 ;; KLUDGE: it's just simpler to compare the printed version here...
30 (equal (with-output-to-string (s)
31 (prin1 (read-proglist *proglist-1
*) s
))
32 "(#<asm MOVL #xA => %EAX> LOOP #<asm DECL %EAX> #<asm JE 'EXIT> #<asm JMP 'LOOP>
36 (deftest proglist-encode
.1
37 (multiple-value-bind (a b
)
38 (proglist-encode :octet-list
:32-bit
0 (read-proglist *proglist-1
*))
39 (and (equal a
'(#xB8
#xA
#x0
#x0
#x0
#x48
#x74
#x2
#xEB
#xFB
))
40 (equal b
'((EXIT .
#xA
) (LOOP .
#x5
)))))