This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][test] Make PATH empty when testing --gcc-toolchain is multilib_riscv_elf_sdk
ClosedPublic

Authored by StephenFan on Mar 28 2022, 8:41 AM.

Details

Summary

Due to D79842, clang dirver would search possible tool name in both possible
locations, then moving to the next name. The gcc toolchain `llvm-project/clang/test/Driver/
Inputs/multilib_riscv_elf_sdk` don't have a riscv64-unknown-elf-ld executable in
llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/bin/. So when searching
riscv64-unknown-elf-ld, if there is a riscv64-unknown-elf-ld in PATH, the
test would fail.

This patch makes the PATH empty when testing it.

Diff Detail

Event Timeline

StephenFan created this revision.Mar 28 2022, 8:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 8:41 AM
StephenFan requested review of this revision.Mar 28 2022, 8:41 AM
MaskRay added a comment.EditedMar 28 2022, 9:51 AM

Thanks for the patch. I think it's correct and makes the intention clear, though I'd add [test] to indicate this patch is test only and therefore not change any code.

If the test no longer works on Windows, add // UNSUPPORTED: system-windows

Does riscv32-toolchain.c need a similar change? Please look around for related tests when fixing something.

Address @MaskRay 's comments

Change log:

  1. Update test in riscv32-toolchain.c
  2. Make system-windows UNSUPPORTED
StephenFan retitled this revision from [RISCV] Make PATH empty when testing --gcc-toolchain is multilib_riscv_elf_sdk to [RISCV][test] Make PATH empty when testing --gcc-toolchain is multilib_riscv_elf_sdk.Mar 28 2022, 8:12 PM
MaskRay accepted this revision.Mar 28 2022, 8:31 PM
This revision is now accepted and ready to land.Mar 28 2022, 8:31 PM
This revision was landed with ongoing or failed builds.Mar 28 2022, 11:52 PM
This revision was automatically updated to reflect the committed changes.