[PATCH] D148169: [compiler-rt] [test] [profile] Add an .exe suffix to some temp executables

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 13:39:57 PDT 2023


mstorsjo created this revision.
mstorsjo added reviewers: phosek, alvinhochun, vitalybuka.
Herald added subscribers: Enna1, dberris.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Mingw toolchains implicitly add an .exe suffix if the output linked
file doesn't have a suffix. In many cases the extra suffix doesn't
cause any issues, but in some tests, this discrepancy between expected
output file name and actual output file does cause issues.

In one test, a later rm command fails to remove the executable since it
doesn't have the expected name. (Alternatively the rm command could use
a wildcard.)

In another test, the executables that are run with a ./ prefix doesn't
manage to resolve the executable when it has an extra implicit .exe
suffix.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148169

Files:
  compiler-rt/test/profile/instrprof-basic.c
  compiler-rt/test/profile/instrprof-tmpdir.c


Index: compiler-rt/test/profile/instrprof-tmpdir.c
===================================================================
--- compiler-rt/test/profile/instrprof-tmpdir.c
+++ compiler-rt/test/profile/instrprof-tmpdir.c
@@ -1,18 +1,18 @@
 // RUN: rm -rf %t
 // RUN: mkdir -p %t
 // RUN: cd %t
-// RUN: %clang_profgen -o %t/binary %s
+// RUN: %clang_profgen -o %t/binary.exe %s
 //
 // Check that a dir separator is appended after %t is subsituted.
-// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%traw1.profraw" %run ./binary
+// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%traw1.profraw" %run ./binary.exe
 // RUN: llvm-profdata show ./raw1.profraw | FileCheck %s -check-prefix TMPDIR
 //
 // Check that substitution works even if a redundant dir separator is added.
-// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%t/raw2.profraw" %run ./binary
+// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%t/raw2.profraw" %run ./binary.exe
 // RUN: llvm-profdata show ./raw2.profraw | FileCheck %s -check-prefix TMPDIR
 //
 // Check that we fall back to the default path if TMPDIR is missing.
-// RUN: env -u TMPDIR LLVM_PROFILE_FILE="%%t/raw3.profraw" %run ./binary 2>&1 | FileCheck %s -check-prefix MISSING
+// RUN: env -u TMPDIR LLVM_PROFILE_FILE="%%t/raw3.profraw" %run ./binary.exe 2>&1 | FileCheck %s -check-prefix MISSING
 // RUN: llvm-profdata show ./default.profraw | FileCheck %s -check-prefix TMPDIR
 
 // TMPDIR: Maximum function count: 1
Index: compiler-rt/test/profile/instrprof-basic.c
===================================================================
--- compiler-rt/test/profile/instrprof-basic.c
+++ compiler-rt/test/profile/instrprof-basic.c
@@ -32,13 +32,13 @@
 // Test that merging is enabled by default with -fprofile-generate
 // RUN: rm -fr %t.dir4
 // RUN: mkdir -p %t.dir4
-// RUN: %clang_pgogen -o %t.dir4/merge4 -O0 %s
+// RUN: %clang_pgogen -o %t.dir4/merge4.exe -O0 %s
 // RUN: cd %t.dir4
-// RUN: %run %t.dir4/merge4
-// RUN: %run %t.dir4/merge4
-// RUN: %run %t.dir4/merge4
-// RUN: %run %t.dir4/merge4
-// RUN: rm -f %t.dir4/merge4
+// RUN: %run %t.dir4/merge4.exe
+// RUN: %run %t.dir4/merge4.exe
+// RUN: %run %t.dir4/merge4.exe
+// RUN: %run %t.dir4/merge4.exe
+// RUN: rm -f %t.dir4/merge4.exe
 // RUN: llvm-profdata merge -o %t.m4.profdata ./
 // RUN: %clang_profuse=%t.m4.profdata -O0 -o - -S -emit-llvm %s | FileCheck %s --check-prefix=COMMON  --check-prefix=PGOMERGE
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148169.512962.patch
Type: text/x-patch
Size: 2386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230412/48931857/attachment.bin>


More information about the llvm-commits mailing list