Files
clang-p2996/clang/test/Driver/hip-temps-linux.hip
Yaxun (Sam) Liu 1f8a3ce325 [HIP] Fix temporary files
Currently HIP toolchain uses Driver::GetTemporaryDirectory to
create a temporary directory for some temporary files during
compilation. The temporary directories are not automatically
deleted after compilation. This slows down compilation
on Windows.

Switch to use GetTemporaryPath which only creates temporay
files which will be deleted automatically.

Keep the original input file name convention for Darwin host
toolchain since it is needed for deterministic binary
(https://reviews.llvm.org/D111269)

Fixes: SWDEV-386058

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D145509
2023-03-09 21:41:58 -05:00

19 lines
652 B
Plaintext

// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target
// REQUIRES: system-linux
// Check no temporary files or directores are left after compilation.
// RUN: rm -rf %t/mytmp
// RUN: mkdir -p %t/mytmp
// RUN: env TMPDIR="%t/mytmp" %clang --target=x86_64-linux-gnu -nogpulib -nogpuinc \
// RUN: --rocm-path=%S/Inputs/rocm -nostdinc -nostdlib -c \
// RUN: --offload-arch=gfx1030 -emit-llvm -v %s 2>&1 | \
// RUN: FileCheck -check-prefixes=CHECK %s
// RUN: ls %t/mytmp >%t/mytmp.txt 2>&1
// RUN: touch %t/empty.txt
// RUN: diff %t/mytmp.txt %t/empty.txt
// CHECK: -o {{.*}}/mytmp/hip-temps-linux-gfx1030-{{.*}}.bc
int main() {}