[llvm] [RISCV] Report all near-miss reasons in the AsmParser (PR #205721)

Mark Zhuang via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 28 07:31:30 PDT 2026


================
@@ -32,23 +32,20 @@
 # CHECK-ERR: [[@LINE-1]]:24: error: invalid operand for instruction
 
 .insn qc.ei 127, 7, 3, x31, not_a_reg, 0
-# CHECK-ERR: [[@LINE-1]]:29: error: immediate must be an integer in the range [-33554432, 33554431]
+# CHECK-ERR: [[@LINE-1]]:29: error: invalid operand for instruction
 
 .insn qc.ei 127, 7, 3, x31, x31, 0x2000000
 # CHECK-ERR: [[@LINE-1]]:34: error: immediate must be an integer in the range [-33554432, 33554431]
 
 .insn qc.ei 127, 7, 3, x31, x31, 0x1000000, extra
-# CHECK-ERR: [[@LINE-1]]:45: error: invalid operand for instruction
+# CHECK-ERR: [[@LINE-1]]:45: error: too many operands for instruction
 
 .insn qc.ei 126, 7, 3, x31, 0x2000000(x0)
 # CHECK-ERR: [[@LINE-1]]:29: error: immediate must be an integer in the range [-33554432, 33554431]
 
 .insn qc.ei 126, 7, 3, x31, 0x1000000(not_a_reg)
 # CHECK-ERR: [[@LINE-1]]:39: error: expected register
 
-.insn qc.ei 126, 7, 3, x31, 0x1000000(x31), extra
----------------
zqb-all wrote:

The original implementation didn't check for extra arguments. I've added a commit to support this, which requires changes to the shared `AsmMatcherEmitter.cpp`. We can review it together as part of this PR, or if you prefer to keep this PR minimal, we can move it to a follow-up PR instead.

https://github.com/llvm/llvm-project/pull/205721


More information about the llvm-commits mailing list