related issue: https://github.com/llvm/llvm-project/issues/59139
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
any chance of portable test coverage? (like a JITLink unit test or llvm-jitlink lit test)
Hi, test was added. I see that x64 Debian is failed (probably, an error is not related to this fix?).
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.
llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s | ||
---|---|---|
49 | Why is this a test for the case you're fixing? This is valid input so shouldn't be hitting an error path in the first place. |
Please upload diffs with full context; see https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface
llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s | ||
---|---|---|
49 | Actually, no error is expected. Without changes in ELF_riscv.cpp LLVM throws Expected<T> must be checked before access or destruction. Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed). because result RelHI20 wrapped to Expected<T> is correct but not checked for the potential error. |
llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s | ||
---|---|---|
49 | Oh ok, the context makes this clearer, I thought it was code shared with the _I form but no. Thanks for the clarification. |
llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s | ||
---|---|---|
49 | Yeah, sorry about that. Thanks for review! |
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.
LGTM.
@dkurt Do you have commit access already? If not please just let me know the name and email that you'd like me to use for attribution and I'll commit on your behalf.
Thank you!
Not yet, I believe. Name is "Dmitry Kurtaev" and email "dmitry.kurtaev@gmail.com".
Why is this a test for the case you're fixing? This is valid input so shouldn't be hitting an error path in the first place.