]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LoongArch: Add test for divide by zero in instructions
authorLulu Cai <cailulu@loongson.cn>
Mon, 21 Apr 2025 02:47:43 +0000 (10:47 +0800)
committercailulu <cailulu@loongson.cn>
Wed, 23 Apr 2025 06:51:39 +0000 (14:51 +0800)
Added tests for division/modulo by zero for instruction expressions.

gas/testsuite/gas/loongarch/div_zero.l [new file with mode: 0644]
gas/testsuite/gas/loongarch/div_zero.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/loongarch.exp

diff --git a/gas/testsuite/gas/loongarch/div_zero.l b/gas/testsuite/gas/loongarch/div_zero.l
new file mode 100644 (file)
index 0000000..b30c665
--- /dev/null
@@ -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 (file)
index 0000000..44a5c26
--- /dev/null
@@ -0,0 +1,2 @@
+addi.w   $a0,$a1,2/0
+addi.d   $a0,$a1,4%0
index 0e836f7f217c1f0b389953458ec496f5ef1d70bc..d2008f4e9ed201e1fabcb11714e012c01ac2ed4d 100644 (file)
@@ -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"
   }
 }