[llvm] [RISCV][MC] Emit Better Token Diagnostics (PR #209700)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 22:58:22 PDT 2026


================
@@ -30,13 +30,13 @@ c.sdsp t1, -8(sp) # CHECK: :[[@LINE]]:12: error: immediate must be a multiple of
 c.ld  s0, -8(sp)
 # CHECK: :[[@LINE-1]]:1: error: invalid instruction, any one of the following would fix this:
 # CHECK: :[[@LINE-2]]:7: note: register must be a GPR from x8 to x15
-# CHECK: :[[@LINE-3]]:11: note: invalid operand for instruction
+# CHECK: :[[@LINE-3]]:11: note: expected '('
 # CHECK: :[[@LINE-4]]:11: note: immediate must be a multiple of 8 bytes in the range [0, 248]
 
 c.sd  s0, 256(sp)
 # CHECK: :[[@LINE-1]]:1: error: invalid instruction, any one of the following would fix this:
 # CHECK: :[[@LINE-2]]:7: note: register must be a GPR from x8 to x15
-# CHECK: :[[@LINE-3]]:11: note: invalid operand for instruction
+# CHECK: :[[@LINE-3]]:11: note: expected '('
----------------
arichardson wrote:

This message actually seems more confusing than the previous generic error? 

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


More information about the llvm-commits mailing list