mirror of
https://github.com/fachat/xa65.git
synced 2024-09-26 11:55:24 +00:00
add tests for recursive preprocessor defines
This commit is contained in:
parent
e50236d62b
commit
25796d051a
13
xa/tests/ppdefines/Makefile
Normal file
13
xa/tests/ppdefines/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
XA=../../xa
|
||||||
|
|
||||||
|
all: test1 clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm a.o65
|
||||||
|
|
||||||
|
%:%.a65
|
||||||
|
${XA} $<
|
||||||
|
cmp a.o65 $@.o65
|
||||||
|
|
||||||
|
|
32
xa/tests/ppdefines/test1.a65
Normal file
32
xa/tests/ppdefines/test1.a65
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
#define macro1() \
|
||||||
|
lda #0
|
||||||
|
|
||||||
|
#define macro2(a) \
|
||||||
|
lda #(a)
|
||||||
|
|
||||||
|
#define macro3(a,b) \
|
||||||
|
lda #(a): \
|
||||||
|
ldy #(b)
|
||||||
|
|
||||||
|
#define const1 $40
|
||||||
|
|
||||||
|
#define func1(a) (a) | $20
|
||||||
|
|
||||||
|
*=$c000
|
||||||
|
|
||||||
|
macro1()
|
||||||
|
|
||||||
|
macro2(2)
|
||||||
|
|
||||||
|
macro3(2,3)
|
||||||
|
|
||||||
|
lda #(2) | $20
|
||||||
|
lda #func1(2)
|
||||||
|
|
||||||
|
macro2(func1(3))
|
||||||
|
|
||||||
|
macro3(const1, func1(5))
|
||||||
|
|
||||||
|
macro3(func1(const1), func1(func1(const1)))
|
||||||
|
|
BIN
xa/tests/ppdefines/test1.o65
Normal file
BIN
xa/tests/ppdefines/test1.o65
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user