diff --git a/tests/asm/base/excp-1.S b/tests/asm/base/excp-1.S new file mode 100644 index 0000000..e398059 --- /dev/null +++ b/tests/asm/base/excp-1.S @@ -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 diff --git a/tests/asm/base/excp-2.S b/tests/asm/base/excp-2.S new file mode 100644 index 0000000..5a0665d --- /dev/null +++ b/tests/asm/base/excp-2.S @@ -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 diff --git a/tests/asm/meson.build b/tests/asm/meson.build index 89d5e84..fef21d4 100644 --- a/tests/asm/meson.build +++ b/tests/asm/meson.build @@ -44,6 +44,8 @@ asm_tests = { 'exit-1': { 'should_fail': true }, 'template': {}, 'signal-1': {}, + 'excp-1': {}, + 'excp-2': {}, }, 'win': { 'setwd-1': {},