[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

David Spickett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 01:52:10 PDT 2020


DavidSpickett marked 2 inline comments as done.
DavidSpickett added inline comments.


================
Comment at: clang/test/Driver/program-path-priority.c:117
+/// Check file exists first in case $DEFAULT_TRIPLE == %target_triple
+// RUN: file -E %t/$DEFAULT_TRIPLE-gcc 2>&1 > /dev/null && \
+// RUN:   mv %t/$DEFAULT_TRIPLE-gcc  %t/prefix || true
----------------
stevewan wrote:
> Maybe I'm not seeing something obvious here, but I'm not aware of the `file -E` usage, and on Linux I got `file: invalid option -- 'E'`.
I was looking for a way to mimic [! -f <file>], which worked on the command line but not in a test. From my system's file:
    -E      On filesystem errors (file not found etc), instead of handling the error as regu‐
             lar output as POSIX mandates and keep going, issue an error message and exit.

I didn't realise it was non-standard, so I've switched to mv || true with the error redirected so it won't confuse the verbose output.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83055





More information about the cfe-commits mailing list