This matches GNU assembler behaviour.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Alex, I was looking at why the fuzzer did not detect this issue (the constrained fuzzer was not generating the modifier, but the unconstrained fuzzer is and should have generated that test case).
In the process I ran into this other example that the llvm assembler fails to assemble, but GAS is able to assemble.
echo "li x0,%lo(4)" |llvm-mc -triple riscv32
.text
<stdin>:1:12: error: immediate must be an integer in the range [-2147483648, 4294967295]
li x0,%lo(4)
With your patch, this example works fine. You might want to add a test case for it.
Comment Actions
Thanks Ana, it was indeed intentional that this patch allows li a0, %lo(1234) but the test coverage was lacking. Updated to improve tests.