Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / profile / instrprof-tmpdir.c
blob6f323e7e6a01a547339a3724160fe467f45d25fe
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: cd %t
4 // RUN: %clang_profgen -o %t/binary %s
5 //
6 // Check that a dir separator is appended after %t is subsituted.
7 // RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%traw1.profraw" %run %t/binary
8 // RUN: llvm-profdata show ./raw1.profraw | FileCheck %s -check-prefix TMPDIR
9 //
10 // Check that substitution works even if a redundant dir separator is added.
11 // RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%t/raw2.profraw" %run %t/binary
12 // RUN: llvm-profdata show ./raw2.profraw | FileCheck %s -check-prefix TMPDIR
14 // Check that we fall back to the default path if TMPDIR is missing.
15 // RUN: env -u TMPDIR LLVM_PROFILE_FILE="%%t/raw3.profraw" %run %t/binary 2>&1 | FileCheck %s -check-prefix MISSING
16 // RUN: llvm-profdata show ./default.profraw | FileCheck %s -check-prefix TMPDIR
18 // TMPDIR: Maximum function count: 1
20 // MISSING: Unable to get the TMPDIR environment variable, referenced in {{.*}}raw3.profraw. Using the default path.
22 int main() { return 0; }