From 45d5f2f8223fe64a4ab27c7b7fce7fa974a62470 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 19 Oct 2008 16:25:57 -0700 Subject: test: add test for preprocessor indirection construct Add a test for the preprocessor indirection construct, %[...]. Signed-off-by: H. Peter Anvin --- test/ppindirect.asm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/ppindirect.asm (limited to 'test') diff --git a/test/ppindirect.asm b/test/ppindirect.asm new file mode 100644 index 0000000..635e657 --- /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 -- cgit v1.2.3 From 2d4722fe4ca6d6509fb4b6078e6ce07e3634b3a4 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 19 Oct 2008 16:47:53 -0700 Subject: test: better smartalign tests Smartalign tests for 16, 32 and 64-bit mode. Signed-off-by: H. Peter Anvin --- test/smartalign.asm | 34 ---------------------------------- test/smartalign16.asm | 36 ++++++++++++++++++++++++++++++++++++ test/smartalign32.asm | 36 ++++++++++++++++++++++++++++++++++++ test/smartalign64.asm | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+), 34 deletions(-) delete mode 100644 test/smartalign.asm create mode 100644 test/smartalign16.asm create mode 100644 test/smartalign32.asm create mode 100644 test/smartalign64.asm (limited to 'test') diff --git a/test/smartalign.asm b/test/smartalign.asm deleted file mode 100644 index 1b8bdae..0000000 --- a/test/smartalign.asm +++ /dev/null @@ -1,34 +0,0 @@ -%use smartalign - - bits 32 - - alignmode nop - add ax,ax - align 16 - - alignmode generic - add ax,ax - align 16 - - alignmode k7 - add ax,ax - align 16 - - alignmode k8 - add ax,ax - align 16 - - alignmode p6 - add ax,ax - align 16 - - add ecx,ecx - align 32 - add edx,edx - align 128 - add ebx,ebx - align 256 - add esi,esi - align 512 - - add edi,edi diff --git a/test/smartalign16.asm b/test/smartalign16.asm new file mode 100644 index 0000000..42915de --- /dev/null +++ b/test/smartalign16.asm @@ -0,0 +1,36 @@ +;Testname=test; Arguments=-fbin -osmartalign16.bin; Files=stdout stderr smartalign16.bin + +%use smartalign + + bits 16 + + alignmode nop, 32 + add ax,ax + align 32 + + alignmode generic, 32 + add ax,ax + align 32 + + alignmode k7, 32 + add ax,ax + align 32 + + alignmode k8, 32 + add ax,ax + align 32 + + alignmode p6, 32 + add ax,ax + align 32 + + add ecx,ecx + align 32 + add edx,edx + align 128 + add ebx,ebx + align 256 + add esi,esi + align 512 + + add edi,edi diff --git a/test/smartalign32.asm b/test/smartalign32.asm new file mode 100644 index 0000000..64d65b0 --- /dev/null +++ b/test/smartalign32.asm @@ -0,0 +1,36 @@ +;Testname=test; Arguments=-fbin -osmartalign32.bin; Files=stdout stderr smartalign32.bin + +%use smartalign + + bits 32 + + alignmode nop, 32 + add ax,ax + align 32 + + alignmode generic, 32 + add ax,ax + align 32 + + alignmode k7, 32 + add ax,ax + align 32 + + alignmode k8, 32 + add ax,ax + align 32 + + alignmode p6, 32 + add ax,ax + align 32 + + add ecx,ecx + align 32 + add edx,edx + align 128 + add ebx,ebx + align 256 + add esi,esi + align 512 + + add edi,edi diff --git a/test/smartalign64.asm b/test/smartalign64.asm new file mode 100644 index 0000000..74454ca --- /dev/null +++ b/test/smartalign64.asm @@ -0,0 +1,36 @@ +;Testname=test; Arguments=-fbin -osmartalign64.bin; Files=stdout stderr smartalign64.bin + +%use smartalign + + bits 64 + + alignmode nop, 32 + add ax,ax + align 32 + + alignmode generic, 32 + add ax,ax + align 32 + + alignmode k7, 32 + add ax,ax + align 32 + + alignmode k8, 32 + add ax,ax + align 32 + + alignmode p6, 32 + add ax,ax + align 32 + + add ecx,ecx + align 32 + add edx,edx + align 128 + add ebx,ebx + align 256 + add esi,esi + align 512 + + add edi,edi -- cgit v1.2.3 From 207b1c4d3d314d6349e09ba829db732165288de0 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 19 Oct 2008 22:23:12 -0700 Subject: test/ppindirect.asm: test token pasting inside %[...] Test for token pasting inside %[...]. Signed-off-by: H. Peter Anvin --- test/ppindirect.asm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/ppindirect.asm b/test/ppindirect.asm index 635e657..0a30d07 100644 --- a/test/ppindirect.asm +++ b/test/ppindirect.asm @@ -21,6 +21,9 @@ foo%[n]*100 foo22 foo33 +%define foo33bar 999999 + %[foo%[foo3]bar] + %assign bctr 0 %macro bluttan 0 %assign bctr bctr+1 -- cgit v1.2.3