asm/win: add psize tests

This commit is contained in:
Denis Drakhnia 2023-12-24 13:27:10 +02:00
parent 651d474982
commit 2ddd3e9a5a
3 changed files with 43 additions and 0 deletions

View File

@ -49,6 +49,8 @@ asm_tests = {
'setwd-2': {},
'setwd-invalidate-regs-1': {},
'setwd-invalidate-regs-2': {},
'setwd-psize-1': {},
'setwd-psize-2': { 'should_fail': true },
'setbn-invalidate-regs-1': {},
'setbn-invalidate-regs-2': { 'should_fail': true },
'setbp-invalidate-regs-1': {},

View File

@ -0,0 +1,20 @@
#include "test_start.S"
setwd wsz=8, nfx=1
disp %ctpr1, 0f
// psize = (8 - 4) * 2 = 8 regs
call %ctpr1, wbs=4
disp %ctpr1, 0f
// psize = (8 - 8) * 2 = 0 regs
call %ctpr1, wbs=8
#include "test_end.S"
0:
{
setwd wsz=4, nfx=1
return %ctpr3
}
ct %ctpr3

View File

@ -0,0 +1,21 @@
#include "test_start.S"
{
setwd wsz=16, nfx=1
disp %ctpr1, 0f
}
{
// psize = (16 - 4) * 2 = 24 regs
call %ctpr1, wbs=4
}
#include "test_end.S"
0:
// psize = 24
{
// try to set wsz lower than psize
setwd wsz=4, nfx=1
return %ctpr3
}
ct %ctpr3