base: add simple exception tests
This commit is contained in:
parent
98dc504a04
commit
b505304e47
24
tests/asm/base/excp-1.S
Normal file
24
tests/asm/base/excp-1.S
Normal file
@ -0,0 +1,24 @@
|
||||
#include "test_start.S"
|
||||
|
||||
sys_rt_sigaction SIGSEGV, act
|
||||
addd,0 0, 1, %g16
|
||||
{
|
||||
stb,2 %g16, [ flag ]
|
||||
ldb,5 [ 0 ], %empty
|
||||
}
|
||||
sys_exit 1
|
||||
|
||||
#include "test_end.S"
|
||||
|
||||
sig_handler:
|
||||
ldb,0 [ flag ], %g16
|
||||
assert_eq_i64(%g16, 1)
|
||||
exit_with_code
|
||||
|
||||
.section ".rodata"
|
||||
act:
|
||||
init_sigaction sig_handler
|
||||
|
||||
.data
|
||||
flag:
|
||||
.byte 0
|
24
tests/asm/base/excp-2.S
Normal file
24
tests/asm/base/excp-2.S
Normal file
@ -0,0 +1,24 @@
|
||||
#include "test_start.S"
|
||||
|
||||
sys_rt_sigaction SIGSEGV, act
|
||||
addd,0 0, 1, %g16
|
||||
{
|
||||
ldb,0 [ 0 ], %empty
|
||||
stb,2 %g16, [ flag ]
|
||||
}
|
||||
sys_exit 1
|
||||
|
||||
#include "test_end.S"
|
||||
|
||||
sig_handler:
|
||||
ldb,0 [ flag ], %g16
|
||||
assert_eq_i64(%g16, 0)
|
||||
exit_with_code
|
||||
|
||||
.section ".rodata"
|
||||
act:
|
||||
init_sigaction sig_handler
|
||||
|
||||
.data
|
||||
flag:
|
||||
.byte 0
|
@ -44,6 +44,8 @@ asm_tests = {
|
||||
'exit-1': { 'should_fail': true },
|
||||
'template': {},
|
||||
'signal-1': {},
|
||||
'excp-1': {},
|
||||
'excp-2': {},
|
||||
},
|
||||
'win': {
|
||||
'setwd-1': {},
|
||||
|
Loading…
Reference in New Issue
Block a user