[compiler-rt] [test] [profile] Avoid issues with an implicit .exe suffix
authorMartin Storsjö <martin@martin.st>
Wed, 12 Apr 2023 11:17:48 +0000 (11:17 +0000)
committerMartin Storsjö <martin@martin.st>
Wed, 19 Apr 2023 21:35:20 +0000 (00:35 +0300)
commit3125af2b6b8a5a502d8cef480a874474b55efef1
tree8d4770672dd189c127885bda7e92af997716753b
parenta72bcc1252e3d6c566a8ca470c20d9f9f3e93156
[compiler-rt] [test] [profile] Avoid issues with an implicit .exe suffix

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 affect the tests.

In one test, a rm command fails to remove the executable since it
doesn't have the expected name. By failing to remove the executable, the
later llvm-profdata command tries to read the executable as if it was
a profile data file.

In another test, when the Python executor executes commands, it can
resolve executable names without the extra .exe suffix for absolute
paths (when most binaries are executed as e.g. "%t/foo"), but it fails
to resolve the executables for relative paths such as "./foo". Making
the paths absolute by using %t here shouldn't affect what the test tries
to validate.

Differential Revision: https://reviews.llvm.org/D148169
compiler-rt/test/profile/instrprof-basic.c
compiler-rt/test/profile/instrprof-tmpdir.c