Fangrui Song 4d53b99c5d [llvm-ar] Improve tool selection heuristic
If llvm-ar is installed at arm-pokymllib32-linux-gnueabi-llvm-ar, it may
think it is llvm-lib due to the "lib" substring.

Improve the heuristic to make all the following work as intended:

llvm-ar-9 (llvm-9 package on Debian)
llvm-ranlib.exe
Lib.exe (reported by D44808)
arm-pokymllib32-linux-gnueabi-llvm-ar (reported by D71030)

Reviewed By: raj.khem, rupprecht

Differential Revision: https://reviews.llvm.org/D71302
2019-12-10 17:32:50 -08:00

15 lines
348 B
Plaintext

## Don't make symlinks on Windows.
# UNSUPPORTED: system-windows
# RUN: rm -rf %t
# RUN: mkdir %t
## See D44808, MSBuild runs Lib.exe
# RUN: ln -s llvm-lib %t/Lib.exe
# RUN: ln -s llvm-lib %t/llvm-lib-10
# RUN: llvm-lib '/?' | FileCheck %s
# RUN: %t/Lib.exe '/?' | FileCheck %s
# RUN: %t/llvm-lib-10 '/?' | FileCheck %s
# CHECK: USAGE: llvm-lib