From: Lulu Cai Date: Mon, 21 Apr 2025 02:47:43 +0000 (+0800) Subject: LoongArch: Add test for divide by zero in instructions X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b4493da0897761187816d795de2562cf91ffc8a;p=thirdparty%2Fbinutils-gdb.git LoongArch: Add test for divide by zero in instructions Added tests for division/modulo by zero for instruction expressions. --- diff --git a/gas/testsuite/gas/loongarch/div_zero.l b/gas/testsuite/gas/loongarch/div_zero.l new file mode 100644 index 00000000000..b30c6657ecf --- /dev/null +++ b/gas/testsuite/gas/loongarch/div_zero.l @@ -0,0 +1,4 @@ +#source: div_zero.s +.*: Assembler messages: +.*: Warning: Divide by zero! +.*: Warning: Divide by zero! diff --git a/gas/testsuite/gas/loongarch/div_zero.s b/gas/testsuite/gas/loongarch/div_zero.s new file mode 100644 index 00000000000..44a5c269da6 --- /dev/null +++ b/gas/testsuite/gas/loongarch/div_zero.s @@ -0,0 +1,2 @@ +addi.w $a0,$a1,2/0 +addi.d $a0,$a1,4%0 diff --git a/gas/testsuite/gas/loongarch/loongarch.exp b/gas/testsuite/gas/loongarch/loongarch.exp index 0e836f7f217..d2008f4e9ed 100644 --- a/gas/testsuite/gas/loongarch/loongarch.exp +++ b/gas/testsuite/gas/loongarch/loongarch.exp @@ -37,5 +37,6 @@ if [istarget loongarch*-*-*] { run_list_test "illegal-operand" run_list_test "pseudo_op_option_fail" run_list_test "negative_right_shift" + run_list_test "div_zero" } }