| 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 |
| 13 | // |
| 14 | // Check that we fall back to the default path if TMPDIR is missing. |
| 15 | // RUN: %if system-aix %{ unset TMPDIR %} |
| 16 | // RUN: env %if !system-aix %{ -u TMPDIR %} LLVM_PROFILE_FILE="%%t/raw3.profraw" %run %t/binary 2>&1 | FileCheck %s -check-prefix MISSING |
| 17 | // RUN: llvm-profdata show ./default.profraw | FileCheck %s -check-prefix TMPDIR |
| 18 | |
| 19 | // TMPDIR: Maximum function count: 1 |
| 20 | |
| 21 | // MISSING: Unable to get the TMPDIR environment variable, referenced in {{.*}}raw3.profraw. Using the default path. |
| 22 | |
| 23 | int main() { return 0; } |
| 24 | |