[clang] [llvm-lit] Use lit Syntax for Environment Variables in Clang subproject (PR #102647)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 14:04:45 PDT 2024


================
@@ -87,12 +87,13 @@
 
 /// <default-triple>-gcc has lowest priority so <triple>-gcc
 /// on PATH beats default triple in program path
-// RUN: DEFAULT_TRIPLE=`%t/clang --version | grep "Target:" | cut -d ' ' -f2`
-// RUN: touch %t/$DEFAULT_TRIPLE-gcc && chmod +x %t/$DEFAULT_TRIPLE-gcc
-// RUN: touch %t/%target_triple-gcc && chmod +x %t/%target_triple-gcc
-// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
-// RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
-// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc"
+// RUN: %clang --version | grep "Target:" | cut -d ' ' -f2 > %t/default-triple.txt 
+// RUN: env DEFAULT_TRIPLE=%{readfile:%t/default-triple.txt} 
+// RUN: touch %t/%{env:DEFAULT_TRIPLE}-gcc && chmod +x %t/%{env:DEFAULT_TRIPLE}-gcc 
+// RUN: touch %t/%target_triple-gcc && chmod +x %t/%target_triple-gcc && 
+// RUN: env "PATH=%t:$PATH" %t/clang -### -target notreal-none-elf %s 2>&1 | \
----------------
Harini0924 wrote:

Thank you for catching this. You're absolutely right—the `PATH` setting and the check shouldn't have been changed. I was experimenting with a different implementation, and I mistakenly left those changes in before committing. However, I reverted these changes back to their original state in my latest patch, which restored the correct behavior.

https://github.com/llvm/llvm-project/pull/102647


More information about the cfe-commits mailing list