diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-10-19 16:25:57 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-10-19 16:25:57 -0700 |
commit | 45d5f2f8223fe64a4ab27c7b7fce7fa974a62470 (patch) | |
tree | 3578778cc947ade3ac33a162a27e442852d4bd89 /test/ppindirect.asm | |
parent | c0ab1cd15a8008d820ebbeedb04c53bc84afd995 (diff) | |
download | nasm-45d5f2f8223fe64a4ab27c7b7fce7fa974a62470.tar.gz |
test: add test for preprocessor indirection construct
Add a test for the preprocessor indirection construct, %[...].
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'test/ppindirect.asm')
-rw-r--r-- | test/ppindirect.asm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/ppindirect.asm b/test/ppindirect.asm new file mode 100644 index 00000000..635e6570 --- /dev/null +++ b/test/ppindirect.asm @@ -0,0 +1,39 @@ +;Testname=test; Arguments=-E -o ppindirect.out; Files=ppindirect.out + +; Fun tests of the preprocessor indirection mode... + +%assign foo1 11 +%assign foo11 1111 +%assign foo2 22 +%assign foo22 2222 +%assign foo3 33 +%assign foo33 3333 +%assign n 2 +foo%[foo%[n]]*100 +foo%[n]*100 +%assign foo%[foo%[n]] foo%[foo%[n]]*100 +;%assign foo%[n] foo%[n]*100 + + foo1 + foo2 + foo3 + foo11 + foo22 + foo33 + +%assign bctr 0 +%macro bluttan 0 +%assign bctr bctr+1 +%assign bluttan%[bctr] bctr +%defstr bstr bluttan%[bctr] + bluttan%[bctr] + bstr +%endmacro + +%rep 20 + bluttan +%endrep +%rep 20 + bluttan%[bctr] +%assign bctr bctr-1 +%endrep |