llvm-project/compiler-rt/test/profile/instrprof-tmpdir.c
Aiden Grossman 5321f5c0b2
[compiler-rt][Profile] Temporarily Disable Test on AIX
This was very hackily patched in
16ef893e9fdec2b08dafc82f5450b41834e09039 to not use env -u. The internal
shell does not support unset, but does supprt env -u. Disable the test
for now so we can enable the internal shell with a TODO to enable it
after the internal shell landing has stuck.

Reviewers: fmayer, vitalybuka, w2yehia, daltenty, mingmingl-llvm, madanial0

Reviewed By: mingmingl-llvm

Pull Request: https://github.com/llvm/llvm-project/pull/166637
2025-11-05 17:58:57 -08:00

28 lines
1.1 KiB
C

// AIX does not support env -u.
// TODO(boomanaiden154): Reenable AIX support once we use the internal shell by
// default.
// UNSUPPORTED: system-aix
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: cd %t
// RUN: %clang_profgen -o %t/binary %s
//
// Check that a dir separator is appended after %t is subsituted.
// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%traw1.profraw" %run %t/binary
// 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 %t/binary
// 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 %t/binary 2>&1 | FileCheck %s -check-prefix MISSING
// RUN: llvm-profdata show ./default.profraw | FileCheck %s -check-prefix TMPDIR
// TMPDIR: Maximum function count: 1
// MISSING: Unable to get the TMPDIR environment variable, referenced in {{.*}}raw3.profraw. Using the default path.
int main() { return 0; }