[compiler-rt] [compiler-rt][test] Move tmp dir creation with env to where dir is run (PR #106252)

Connie Zhu via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 10:21:53 PDT 2024


https://github.com/connieyzhu created https://github.com/llvm/llvm-project/pull/106252

The original test used env to set the LLVM_PROFILE_FILE variable, but because it does not have a subcommand, this is only temporary and does not propogate to the following RUN lines.

NOTE: the original patch DOES NOT work.

>From 6a2d43fc78746fddb70c4409975e2b5f3f86c284 Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Tue, 27 Aug 2024 17:08:55 +0000
Subject: [PATCH] [compiler-rt][test] Move tmp dir creation with env to where
 dir is run

The original test used env to set the LLVM_PROFILE_FILE variable, but
because it does not have a subcommand, this is only temporary and does
not propogate to the following RUN lines.
---
 compiler-rt/test/profile/Linux/instrprof-dir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/compiler-rt/test/profile/Linux/instrprof-dir.c b/compiler-rt/test/profile/Linux/instrprof-dir.c
index 9d9af6daf51381..9e051167633ca6 100644
--- a/compiler-rt/test/profile/Linux/instrprof-dir.c
+++ b/compiler-rt/test/profile/Linux/instrprof-dir.c
@@ -1,7 +1,6 @@
 // RUN: %clang_pgogen -o %t %s
-// RUN: env LLVM_PROFILE_FILE="%t.d/%m.profraw"
 // RUN: rm -fr %t.d
-// RUN: %run %t %t.d
+// RUN: env LLVM_PROFILE_FILE="%t.d/%m.profraw" %run %t %t.d
 
 #include <errno.h>
 #include <unistd.h>



More information about the llvm-commits mailing list