|
87 | 87 |
|
88 | 88 | /// <default-triple>-gcc has lowest priority so <triple>-gcc
|
89 | 89 | /// on PATH beats default triple in program path
|
90 |
| -// RUN: DEFAULT_TRIPLE=`%t/clang --version | grep "Target:" | cut -d ' ' -f2` |
91 |
| -// RUN: touch %t/$DEFAULT_TRIPLE-gcc && chmod +x %t/$DEFAULT_TRIPLE-gcc |
| 90 | +// RUN: %t/clang --version | grep "Target:" | cut -d ' ' -f2 > %t.default_triple |
| 91 | +// RUN: touch %t/%{readfile:%t.default_triple}-gcc && chmod +x %t/%{readfile:%t.default_triple}-gcc |
92 | 92 | // RUN: touch %t/%target_triple-gcc && chmod +x %t/%target_triple-gcc
|
93 | 93 | // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
|
94 | 94 | // RUN: FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
|
|
101 | 101 | // DEFAULT_TRIPLE_NO_NOTREAL: env/gcc"
|
102 | 102 | // DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc"
|
103 | 103 |
|
104 |
| -/// Pick "gcc" as a fallback. Don't pick $DEFAULT_TRIPLE-gcc. |
| 104 | +/// Pick "gcc" as a fallback. Don't pick DEFAULT_TRIPLE-gcc. |
105 | 105 | // RUN: rm %t/env/gcc
|
106 | 106 | // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
|
107 | 107 | // RUN: FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
|
|
110 | 110 | /// -B paths are searched separately so default triple will win
|
111 | 111 | /// if put in one of those even if other paths have higher priority names
|
112 | 112 | // RUN: mkdir -p %t/prefix
|
113 |
| -/// One of these will fail when $DEFAULT_TRIPLE == %target_triple |
114 |
| -// RUN: test -f %t/$DEFAULT_TRIPLE-gcc && \ |
115 |
| -// RUN: mv %t/$DEFAULT_TRIPLE-gcc %t/prefix || true |
| 113 | +/// One of these will fail when %{readfile:%t.default_triple} == %target_triple |
| 114 | +// RUN: test -f %t/%{readfile:%t.default_triple}-gcc && \ |
| 115 | +// RUN: mv %t/%{readfile:%t.default_triple}-gcc %t/prefix || true |
116 | 116 | // RUN: test -f %t/%target_triple-gcc && \
|
117 | 117 | // RUN: mv %t/%target_triple-gcc %t/prefix || true
|
118 | 118 | // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
|
|
123 | 123 | // DEFAULT_TRIPLE_IN_PREFIX-NOT: notreal-none-elf-gcc"
|
124 | 124 |
|
125 | 125 | /// Only if there is nothing in the prefix will we search other paths
|
126 |
| -/// -f in case $DEFAULT_TRIPLE == %target_triple |
127 |
| -// RUN: rm -f %t/prefix/$DEFAULT_TRIPLE-gcc %t/prefix/%target_triple-gcc %t/prefix/gcc |
| 126 | +/// -f in case %{readfile:%t.default_triple} == %target_triple |
| 127 | +// RUN: rm -f %t/prefix/%{readfile:%t.default_triple}-gcc %t/prefix/%target_triple-gcc %t/prefix/gcc |
128 | 128 | // RUN: env "PATH=" %t/clang -### -canonical-prefixes --target=notreal-none-elf %s -B %t/prefix 2>&1 | \
|
129 | 129 | // RUN: FileCheck --check-prefix=EMPTY_PREFIX_DIR1 %s
|
130 | 130 | // EMPTY_PREFIX_DIR1: gcc"
|
|
0 commit comments