mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-13 17:57:12 +08:00
MPX: Add test cases for MPX
MPX test asm files are added. These include all three different styles of mib syntax (NASM, ICC and gas). Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
This commit is contained in:
parent
0304109b3d
commit
40762afbe8
117
test/mpx-64.asm
Normal file
117
test/mpx-64.asm
Normal file
@ -0,0 +1,117 @@
|
||||
;Testname=mpx-64; Arguments=-felf64 -ompx-64.o -O0; Files=stdout stderr mpx-64.o
|
||||
BITS 64
|
||||
|
||||
bndmk bnd1, [r11]
|
||||
bndmk bnd1, [rax]
|
||||
bndmk bnd1, [0x399]
|
||||
bndmk bnd1, [r9+0x3]
|
||||
bndmk bnd1, [rax+0x3]
|
||||
bndmk bnd1, [3,1*r12]
|
||||
bndmk bnd1, [rax+rcx]
|
||||
bndmk bnd1, [r11+1*rax+0x3]
|
||||
bndmk bnd1, [rbx+1*r9+0x3]
|
||||
|
||||
; bndmov
|
||||
bndmov bnd1, [r11]
|
||||
bndmov bnd1, [rax]
|
||||
bndmov bnd1, [0x399]
|
||||
bndmov bnd2, [r9+0x3]
|
||||
bndmov bnd2, [rax+0x3]
|
||||
bndmov bnd0, [1*r12+0x3]
|
||||
bndmov bnd2, [rax+rdx]
|
||||
bndmov bnd1, [r11+1*rax+0x3]
|
||||
bndmov bnd1, [rbx+1*r9+0x3]
|
||||
bndmov bnd0, bnd2
|
||||
|
||||
bndmov [r11], bnd1
|
||||
bndmov [rax], bnd1
|
||||
bndmov [0x399], bnd1
|
||||
bndmov [r9+0x3], bnd2
|
||||
bndmov [rax+0x3], bnd2
|
||||
bndmov [1*r12+0x3], bnd0
|
||||
bndmov [rax+rdx], bnd2
|
||||
bndmov [r11+1*rax+0x3], bnd1
|
||||
bndmov [rbx+1*r9+0x3], bnd1
|
||||
bndmov bnd2, bnd0
|
||||
|
||||
; bndcl
|
||||
bndcl bnd1, [r11]
|
||||
bndcl bnd1, [rax]
|
||||
bndcl bnd1, r11
|
||||
bndcl bnd1, rcx
|
||||
bndcl bnd1, [0x399]
|
||||
bndcl bnd1, [r9+0x3]
|
||||
bndcl bnd1, [rax+0x3]
|
||||
bndcl bnd1, [1*r12+0x3]
|
||||
bndcl bnd1, [rax+rcx]
|
||||
bndcl bnd1, [r11+1*rax+0x3]
|
||||
bndcl bnd1, [rbx+1*r9+0x3]
|
||||
|
||||
; bndcu
|
||||
bndcu bnd1, [r11]
|
||||
bndcu bnd1, [rax]
|
||||
bndcu bnd1, r11
|
||||
bndcu bnd1, rcx
|
||||
bndcu bnd1, [0x399]
|
||||
bndcu bnd1, [r9+0x3]
|
||||
bndcu bnd1, [rax+0x3]
|
||||
bndcu bnd1, [1*r12+0x3]
|
||||
bndcu bnd1, [rax+rcx]
|
||||
bndcu bnd1, [r11+1*rax+0x3]
|
||||
bndcu bnd1, [rbx+1*r9+0x3]
|
||||
|
||||
; bndcn
|
||||
bndcn bnd1, [r11]
|
||||
bndcn bnd1, [rax]
|
||||
bndcn bnd1, r11
|
||||
bndcn bnd1, rcx
|
||||
bndcn bnd1, [0x399]
|
||||
bndcn bnd1, [r9+0x3]
|
||||
bndcn bnd1, [rax+0x3]
|
||||
bndcn bnd1, [1*r9+0x3]
|
||||
bndcn bnd1, [rax+rcx]
|
||||
bndcn bnd1, [r11+1*rax+0x3]
|
||||
bndcn bnd1, [rbx+1*r9+0x3]
|
||||
|
||||
; bndstx
|
||||
; next 5 lines should be parsed same
|
||||
bndstx [rax+0x3,rbx], bnd0 ; NASM - split EA
|
||||
bndstx [rax+rbx*1+0x3], bnd0 ; GAS
|
||||
bndstx [rax+rbx+3], bnd0 ; GAS
|
||||
bndstx [rax+0x3], bnd0, rbx ; ICC-1
|
||||
bndstx [rax+0x3], rbx, bnd0 ; ICC-2
|
||||
|
||||
; GAS's confusing EA - rcx is base reg in NASM
|
||||
bndstx [rcx*1], bnd2
|
||||
; next 4 lines should be parsed same
|
||||
bndstx [,rcx*1], bnd2 ; NASM
|
||||
bndstx [0,rcx*1], bnd2 ; NASM
|
||||
bndstx [0], bnd2, rcx ; ICC-1
|
||||
bndstx [0], rcx, bnd2 ; ICC-2
|
||||
|
||||
bndstx [1*r12+3], bnd2 ; GAS's confusing EA again
|
||||
bndstx [3,1*r12], bnd2 ; NASM
|
||||
bndstx [3], r12, bnd2 ; ICC
|
||||
|
||||
bndstx [r12+0x399], bnd3
|
||||
bndstx [r11+0x1234], bnd1
|
||||
bndstx [rbx+0x1234], bnd2
|
||||
bndstx [rdx], bnd1
|
||||
|
||||
; bndldx
|
||||
bndldx bnd0, [rax+rbx*1+0x3]
|
||||
bndldx bnd2, [rbx+rdx+3]
|
||||
bndldx bnd3, [r12+0x399]
|
||||
bndldx bnd1, [r11+0x1234]
|
||||
bndldx bnd2, [rbx+0x1234]
|
||||
bndldx bnd2, [1*rbx+3]
|
||||
bndldx bnd2, [1*r12+3]
|
||||
bndldx bnd1, [rdx]
|
||||
|
||||
; bnd
|
||||
bnd ret
|
||||
bnd call foo
|
||||
bnd jmp foo
|
||||
bnd jno foo
|
||||
|
||||
foo: bnd ret
|
85
test/mpx.asm
Normal file
85
test/mpx.asm
Normal file
@ -0,0 +1,85 @@
|
||||
;Testname=mpx; Arguments=-felf -ompx.o -O0; Files=stdout stderr mpx.o
|
||||
BITS 32
|
||||
|
||||
bndmk bnd1, [eax]
|
||||
bndmk bnd1, [0x399]
|
||||
bndmk bnd1, [ecx+0x3]
|
||||
bndmk bnd1, [eax+ecx]
|
||||
bndmk bnd1, [ecx*1]
|
||||
bndmk bnd1, [edx+1*eax+0x3]
|
||||
|
||||
; bndmov
|
||||
bndmov bnd1, [eax]
|
||||
bndmov bnd1, [0x399]
|
||||
bndmov bnd1, [ecx+0x3]
|
||||
bndmov bnd1, [eax+ecx]
|
||||
bndmov bnd1, [ecx*1]
|
||||
bndmov bnd1, [edx+1*eax+0x3]
|
||||
bndmov bnd0, bnd1
|
||||
|
||||
bndmov [eax], bnd1
|
||||
bndmov [0x399], bnd1
|
||||
bndmov [ecx+0x3], bnd1
|
||||
bndmov [eax+ecx], bnd1
|
||||
bndmov [ecx*1], bnd1
|
||||
bndmov [edx+1*eax+0x3], bnd1
|
||||
bndmov bnd1, bnd0
|
||||
|
||||
; bndcl
|
||||
bndcl bnd1, [eax]
|
||||
bndcl bnd1, ecx
|
||||
bndcl bnd1, [0x399]
|
||||
bndcl bnd1, [ecx+0x3]
|
||||
bndcl bnd1, [eax+ecx]
|
||||
bndcl bnd1, [ecx*1]
|
||||
bndcl bnd1, [edx+1*eax+0x3]
|
||||
|
||||
; bndcu
|
||||
bndcu bnd1, [eax]
|
||||
bndcu bnd1, ecx
|
||||
bndcu bnd1, [0x399]
|
||||
bndcu bnd1, [ecx+0x3]
|
||||
bndcu bnd1, [eax+ecx]
|
||||
bndcu bnd1, [ecx*1]
|
||||
bndcu bnd1, [edx+1*eax+0x3]
|
||||
|
||||
; bndcn
|
||||
bndcn bnd1, [eax]
|
||||
bndcn bnd1, ecx
|
||||
bndcn bnd1, [0x399]
|
||||
bndcn bnd1, [ecx+0x3]
|
||||
bndcn bnd1, [eax+ecx]
|
||||
bndcn bnd1, [ecx*1]
|
||||
bndcn bnd1, [edx+1*eax+0x3]
|
||||
|
||||
; bndstx
|
||||
bndstx [eax+ebx*1+0x3], bnd0
|
||||
bndstx [eax+0x3,ebx], bnd0
|
||||
bndstx [eax+0x3], bnd0, ebx
|
||||
bndstx [eax+0x3], ebx, bnd0
|
||||
bndstx [ecx*1], bnd2
|
||||
bndstx [,ecx*1], bnd2
|
||||
bndstx [0,ecx*1], bnd2
|
||||
bndstx [0], bnd2, ecx
|
||||
bndstx [0], ecx, bnd2
|
||||
bndstx [edx+0x399], bnd3
|
||||
bndstx [1*ebx+3], bnd2
|
||||
bndstx [3,1*ebx], bnd2
|
||||
bndstx [3], ebx, bnd2
|
||||
bndstx [edx], bnd1
|
||||
|
||||
; bndldx
|
||||
bndldx bnd0, [eax+ebx*1+0x3]
|
||||
bndldx bnd2, [ebx+edx+3]
|
||||
bndldx bnd2, [ecx*1]
|
||||
bndldx bnd3, [edx+0x399]
|
||||
bndldx bnd2, [1*ebx+3]
|
||||
bndldx bnd1, [edx]
|
||||
|
||||
; bnd
|
||||
bnd ret
|
||||
bnd call foo
|
||||
bnd jmp foo
|
||||
bnd jno foo
|
||||
|
||||
foo: bnd ret
|
Loading…
x
Reference in New Issue
Block a user