4 // RUN: %clang_profgen -o %t/binary %s
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
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; }