[PATCH] D138781: [RISCV] Check missed Expected<T> result

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 16:26:15 PST 2022


dblaikie added a comment.

In D138781#3965828 <https://reviews.llvm.org/D138781#3965828>, @dkurt wrote:

> In D138781#3964747 <https://reviews.llvm.org/D138781#3964747>, @dblaikie wrote:
>
>> Is it possible to test the actual error case too? (show that the error is propagated/reported?)
>>
>> Looks good though - if you happen to be able to conjure up the failing test too, that'd be great!
>
> Not sure I could handle it. The added test is similar to one for `R_RISCV_PCREL_LO12_I` (success path) but I have not found any existing checks for fail results of `getRISCVPCRelHi20`.

Ah, yeah, I tried and I guess it'd require hand-crafted yaml to feed to yaml2obj, probably - because the assembler won't let you create this situation:

  /usr/local/google/home/blaikie/dev/llvm/src/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s:37:9: error: could not find corresponding %pcrel_hi
          lw  a0, %pcrel_lo(test_pcrel32)(a0)
          ^

(if I comment out the prior line with the pcrel_hi on it, to produce this ^)

SGTM - will leave it to @lhames for final sign-off.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138781/new/

https://reviews.llvm.org/D138781



More information about the llvm-commits mailing list