test(agc): discard the results of recompiles expected to be refused #617

Merged
Erige005 merged 1 commit from upstream-pr/617 into main 2026-10-05 09:16:18 +00:00
Erige005 commented 2026-10-05 07:12:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Erige005 on 2026-10-05T07:12:51Z.


What

ExpectRefused in the scalar_program_end and scalar_sopk_misc execution tests calls the [[nodiscard]] ShaderRecompiler::Recompile only to check that it throws, and drops the result. GCC 15 warns about it (-Wunused-result). The result is now discarded explicitly with static_cast<void>, as ScalarGetreg.cpp, GlobalLoadAddtid.cpp and BufferAtomicCsub.cpp already do. Test behaviour is unchanged.

Tested

Ubuntu 26.04 (WSL2), GCC 15.2.0, -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON:

  • the two -Wunused-result warnings are gone
  • ctest: 265/265 passed (14 GPU subgroup tests skipped, as on main in this environment), including agc_driver_scalar_program_end and agc_driver_scalar_sopk_misc

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4741442821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/617). Originally posted by [Erige005](https://github.com/Erige005) on 2026-10-05T07:12:51Z. --- ### What `ExpectRefused` in the `scalar_program_end` and `scalar_sopk_misc` execution tests calls the `[[nodiscard]]` `ShaderRecompiler::Recompile` only to check that it throws, and drops the result. GCC 15 warns about it (`-Wunused-result`). The result is now discarded explicitly with `static_cast<void>`, as `ScalarGetreg.cpp`, `GlobalLoadAddtid.cpp` and `BufferAtomicCsub.cpp` already do. Test behaviour is unchanged. ### Tested Ubuntu 26.04 (WSL2), GCC 15.2.0, `-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON`: - the two `-Wunused-result` warnings are gone - `ctest`: 265/265 passed (14 GPU subgroup tests skipped, as on `main` in this environment), including `agc_driver_scalar_program_end` and `agc_driver_scalar_sopk_misc` ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-05 09:02:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T09:02:59Z.


Thanks, this is right. ShaderRecompiler::Recompile is [[nodiscard]], and static_cast<void> is what the other execution tests already use. With GCC 16.2 here, main's build prints the two -Wunused-result warnings for ScalarProgramEnd.cpp and ScalarSopkMisc.cpp, and with this change there are none. Both tests still pass, and the full ctest passes with it merged (Linux). It only touches test code. Ready to merge from my side once CI has run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5991364935 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/617#issuecomment-5991364935). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T09:02:59Z. --- Thanks, this is right. `ShaderRecompiler::Recompile` is `[[nodiscard]]`, and `static_cast<void>` is what the other execution tests already use. With GCC 16.2 here, main's build prints the two `-Wunused-result` warnings for `ScalarProgramEnd.cpp` and `ScalarSopkMisc.cpp`, and with this change there are none. Both tests still pass, and the full ctest passes with it merged (Linux). It only touches test code. Ready to merge from my side once CI has run.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!617
No description provided.