Skip to content

Commit b7b501e

Browse files
Reapply "[clang] Remove %T from tests (#151614)"
This reverts commit 4c80193. This relands the commit. The issues have theoretically been fixed.
1 parent bb3cd62 commit b7b501e

15 files changed

+105
-98
lines changed

clang/test/Analysis/undef-call.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: rm -rf %T/ctudir
2-
// RUN: mkdir %T/ctudir
3-
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=%T/ctudir -verify %s
1+
// RUN: rm -rf %t.dir/ctudir
2+
// RUN: mkdir -p %t.dir/ctudir
3+
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=%t.dir/ctudir -verify %s
44
// expected-no-diagnostics
55

66
struct S {

clang/test/CodeGen/thinlto_backend.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
; Ensure f2 was imported. Check for all 3 flavors of -save-temps[=cwd|obj].
3030
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=obj
3131
; RUN: llvm-dis %t1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
32-
; RUN: mkdir -p %T/dir1
33-
; RUN: cd %T/dir1
32+
; RUN: mkdir -p %t.dir/dir1
33+
; RUN: cd %t.dir/dir1
3434
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=cwd
3535
; RUN: cd ../..
36-
; RUN: llvm-dis %T/dir1/*1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
37-
; RUN: mkdir -p %T/dir2
38-
; RUN: cd %T/dir2
36+
; RUN: llvm-dis %t.dir/dir1/*1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
37+
; RUN: mkdir -p %t.dir/dir2
38+
; RUN: cd %t.dir/dir2
3939
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps
4040
; RUN: cd ../..
41-
; RUN: llvm-dis %T/dir2/*1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
41+
; RUN: llvm-dis %t.dir/dir2/*1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
4242
; CHECK-IMPORT: define available_externally void @f2()
4343
; RUN: llvm-nm %t3.o | FileCheck --check-prefix=CHECK-OBJ %s
4444
; CHECK-OBJ: T f1

clang/test/CodeGenCXX/module-intializer-pmf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %s \
3-
// RUN: -emit-module-interface -o %T/HasPMF.pcm
4-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %T/HasPMF.pcm \
3+
// RUN: -emit-module-interface -o %t.HasPMF.pcm
4+
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t.HasPMF.pcm \
55
// RUN: -emit-llvm -o - | FileCheck %s
66

77
module;

clang/test/CodeGenCXX/profile-remap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// REQUIRES: x86-registered-target
22
//
33
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap.map -O2 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SAMPLES
4-
// RUN: llvm-profdata merge -output %T.profdata %S/Inputs/profile-remap.proftext
5-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fprofile-instrument-use-path=%T.profdata -fprofile-remapping-file=%S/Inputs/profile-remap.map -O2 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INSTR
6-
// RUN: llvm-profdata merge -output %T.profdata %S/Inputs/profile-remap_entry.proftext
7-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fprofile-instrument-use-path=%T.profdata -fprofile-remapping-file=%S/Inputs/profile-remap.map -O2 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INSTR
4+
// RUN: llvm-profdata merge -output %t.profdata %S/Inputs/profile-remap.proftext
5+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fprofile-instrument-use-path=%t.profdata -fprofile-remapping-file=%S/Inputs/profile-remap.map -O2 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INSTR
6+
// RUN: llvm-profdata merge -output %t.profdata %S/Inputs/profile-remap_entry.proftext
7+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fprofile-instrument-use-path=%t.profdata -fprofile-remapping-file=%S/Inputs/profile-remap.map -O2 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INSTR
88

99
namespace Foo {
1010
struct X {};

clang/test/Driver/HLSL/metal-converter.hlsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
// RUN: echo "dxv" > %T/dxv && chmod 754 %T/dxv
1+
// RUN: mkdir -p %t.dir
2+
// RUN: echo "dxv" > %t.dir/dxv && chmod 754 %t.dir/dxv
23

34
// RUN: env PATH="" %clang_dxc -T cs_6_0 %s -metal -Fo %t.mtl -### 2>&1 | FileCheck --check-prefix=NO_DXV %s
45
// RUN: env PATH="" %clang_dxc -T cs_6_0 %s -metal -Vd -Fo %t.mtl -### 2>&1 | FileCheck --check-prefix=NO_DXV %s
5-
// RUN: env PATH="" %clang_dxc -T cs_6_0 %s --dxv-path=%T -metal -Vd -Fo %t.mtl -### 2>&1 | FileCheck --check-prefix=NO_DXV %s
6+
// RUN: env PATH="" %clang_dxc -T cs_6_0 %s --dxv-path=%t.dir -metal -Vd -Fo %t.mtl -### 2>&1 | FileCheck --check-prefix=NO_DXV %s
67
// NO_DXV: "{{.*}}metal-shaderconverter{{(.exe)?}}" "{{.*}}.obj" "-o" "{{.*}}.mtl"
78

89
// RUN: %clang_dxc -T cs_6_0 %s -metal -### 2>&1 | FileCheck --check-prefix=NO_MTL %s
910
// NO_MTL-NOT: metal-shaderconverter
1011

11-
// RUN: %clang_dxc -T cs_6_0 %s --dxv-path=%T -metal -Fo %t.mtl -### 2>&1 | FileCheck --check-prefix=DXV %s
12+
// RUN: %clang_dxc -T cs_6_0 %s --dxv-path=%t.dir -metal -Fo %t.mtl -### 2>&1 | FileCheck --check-prefix=DXV %s
1213
// DXV: "{{.*}}dxv{{(.exe)?}}" "{{.*}}.obj" "-o" "{{.*}}.dxo"
1314
// DXV: "{{.*}}metal-shaderconverter{{(.exe)?}}" "{{.*}}.dxo" "-o" "{{.*}}.mtl"
1415

clang/test/Driver/baremetal-sysroot.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
// Test that when a --sysroot is not provided, driver picks the default
55
// ___location correctly if available.
66

7-
// RUN: rm -rf %T/baremetal_default_sysroot
8-
// RUN: mkdir -p %T/baremetal_default_sysroot/bin
9-
// RUN: mkdir -p %T/baremetal_default_sysroot/lib/clang-runtimes/armv6m-none-eabi
10-
// RUN: ln -s %clang %T/baremetal_default_sysroot/bin/clang
7+
// RUN: rm -rf %t.dir/baremetal_default_sysroot
8+
// RUN: mkdir -p %t.dir/baremetal_default_sysroot/bin
9+
// RUN: mkdir -p %t.dir/baremetal_default_sysroot/lib/clang-runtimes/armv6m-none-eabi
10+
// RUN: ln -s %clang %t.dir/baremetal_default_sysroot/bin/clang
1111

12-
// RUN: %T/baremetal_default_sysroot/bin/clang -no-canonical-prefixes %s -### -o %t.out 2>&1 \
12+
// RUN: %t.dir/baremetal_default_sysroot/bin/clang -no-canonical-prefixes %s -### -o %t.out 2>&1 \
1313
// RUN: -target armv6m-none-eabi --sysroot= \
1414
// RUN: | FileCheck --check-prefix=CHECK-V6M-C %s
1515
// CHECK-V6M-C: "{{.*}}clang{{.*}}" "-cc1" "-triple" "thumbv6m-unknown-none-eabi"

clang/test/Driver/baremetal.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@
126126
// CHECK-V6M-NDL: "-Bstatic" "-m" "armelf" "-EL"
127127
// CHECK-V6M-NDL-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
128128

129-
// RUN: rm -rf %T/baremetal_cxx_sysroot
130-
// RUN: mkdir -p %T/baremetal_cxx_sysroot/usr/include/c++/v1
129+
// RUN: rm -rf %t.dir/baremetal_cxx_sysroot
130+
// RUN: mkdir -p %t.dir/baremetal_cxx_sysroot/usr/include/c++/v1
131131
// RUN: %clangxx %s -### 2>&1 \
132132
// RUN: --target=armv6m-none-eabi \
133-
// RUN: --sysroot=%T/baremetal_cxx_sysroot \
133+
// RUN: --sysroot=%t.dir/baremetal_cxx_sysroot \
134134
// RUN: -stdlib=libc++ \
135135
// RUN: | FileCheck --check-prefix=CHECK-V6M-LIBCXX-USR %s
136136
// CHECK-V6M-LIBCXX-USR: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
@@ -568,24 +568,24 @@
568568

569569
// Check that compiler-rt library without the arch filename suffix will
570570
// be used if present.
571-
// RUN: rm -rf %T/baremetal_clang_rt_noarch
572-
// RUN: mkdir -p %T/baremetal_clang_rt_noarch/lib
573-
// RUN: touch %T/baremetal_clang_rt_noarch/lib/libclang_rt.builtins.a
571+
// RUN: rm -rf %t.dir/baremetal_clang_rt_noarch
572+
// RUN: mkdir -p %t.dir/baremetal_clang_rt_noarch/lib
573+
// RUN: touch %t.dir/baremetal_clang_rt_noarch/lib/libclang_rt.builtins.a
574574
// RUN: %clang %s -### 2>&1 \
575575
// RUN: --target=armv6m-none-eabi \
576-
// RUN: --sysroot=%T/baremetal_clang_rt_noarch \
576+
// RUN: --sysroot=%t.dir/baremetal_clang_rt_noarch \
577577
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-NOARCH %s
578578
// CHECK-CLANGRT-NOARCH: "{{[^"]*}}libclang_rt.builtins.a"
579579
// CHECK-CLANGRT-NOARCH-NOT: "{{[^"]*}}libclang_rt.builtins.a"
580580

581581
// Check that compiler-rt library with the arch filename suffix will be
582582
// used if present.
583-
// RUN: rm -rf %T/baremetal_clang_rt_arch
584-
// RUN: mkdir -p %T/baremetal_clang_rt_arch/lib
585-
// RUN: touch %T/baremetal_clang_rt_arch/lib/libclang_rt.builtins-armv6m.a
583+
// RUN: rm -rf %t.dir/baremetal_clang_rt_arch
584+
// RUN: mkdir -p %t.dir/baremetal_clang_rt_arch/lib
585+
// RUN: touch %t.dir/baremetal_clang_rt_arch/lib/libclang_rt.builtins-armv6m.a
586586
// RUN: %clang %s -### 2>&1 \
587587
// RUN: --target=armv6m-none-eabi \
588-
// RUN: --sysroot=%T/baremetal_clang_rt_arch \
588+
// RUN: --sysroot=%t.dir/baremetal_clang_rt_arch \
589589
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARCH %s
590590
// CHECK-CLANGRT-ARCH: "{{[^"]*}}libclang_rt.builtins.a"
591591
// CHECK-CLANGRT-ARCH-NOT: "{{[^"]*}}libclang_rt.builtins.a"

clang/test/Driver/check-time-trace-ParseDeclarationOrFunctionDefinition.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %T/check-time-trace-ParseDeclarationOrFunctionDefinition %s
2-
// RUN: cat %T/check-time-trace-ParseDeclarationOrFunctionDefinition.json \
1+
// RUN: mkdir -p %t.dir
2+
// RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %t.dir/check-time-trace-ParseDeclarationOrFunctionDefinition %s
3+
// RUN: cat %t.dir/check-time-trace-ParseDeclarationOrFunctionDefinition.json \
34
// RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
45
// RUN: | FileCheck %s
56

67
// CHECK-DAG: "name": "ParseDeclarationOrFunctionDefinition"
7-
// CHECK-DAG: "detail": "{{.*}}check-time-trace-ParseDeclarationOrFunctionDefinition.cpp:15:1"
8+
// CHECK-DAG: "detail": "{{.*}}check-time-trace-ParseDeclarationOrFunctionDefinition.cpp:16:1"
89
// CHECK-DAG: "name": "ParseFunctionDefinition"
910
// CHECK-DAG: "detail": "foo"
1011
// CHECK-DAG: "name": "ParseFunctionDefinition"

clang/test/Driver/cl-showfilenames.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
// There is currently a discussion of this going on at:
1111
// https://reviews.llvm.org/D69825
1212

13-
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s 2>&1 | FileCheck -check-prefix=show %s
14-
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s %S/Inputs/wildcard*.c 2>&1 | FileCheck -check-prefix=multiple %s
13+
// RUN: mkdir -p %t.dir
14+
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%t.dir/ /showFilenames -- %s 2>&1 | FileCheck -check-prefix=show %s
15+
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%t.dir/ /showFilenames -- %s %S/Inputs/wildcard*.c 2>&1 | FileCheck -check-prefix=multiple %s
1516

16-
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ -- %s 2>&1 | FileCheck -check-prefix=noshow %s
17-
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ /showFilenames /showFilenames- -- %s 2>&1 | FileCheck -check-prefix=noshow %s
17+
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%t.dir/ -- %s 2>&1 | FileCheck -check-prefix=noshow %s
18+
// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%t.dir/ /showFilenames /showFilenames- -- %s 2>&1 | FileCheck -check-prefix=noshow %s
1819

1920

2021
#pragma message "Hello"

clang/test/Driver/clang-offload-bundler.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,16 @@
413413
// bundle and archives them. Therefore for each target, the output is an
414414
// archive of unbundled bitcodes.
415415
//
416+
// RUN: mkdir -p %t.dir
416417
// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \
417-
// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%T/hip_bundle1.bc
418+
// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%t.dir/hip_bundle1.bc
418419
// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \
419-
// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%T/hip_bundle2.bc
420-
// RUN: llvm-ar cr %T/hip_archive.a %T/hip_bundle1.bc %T/hip_bundle2.bc
420+
// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%t.dir/hip_bundle2.bc
421+
// RUN: llvm-ar cr %t.dir/hip_archive.a %t.dir/hip_bundle1.bc %t.dir/hip_bundle2.bc
421422
// RUN: clang-offload-bundler -unbundle -type=a -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \
422-
// RUN: -output=%T/hip_900.a -output=%T/hip_906.a -input=%T/hip_archive.a
423-
// RUN: llvm-ar t %T/hip_900.a | FileCheck -check-prefix=HIP-AR-900 %s
424-
// RUN: llvm-ar t %T/hip_906.a | FileCheck -check-prefix=HIP-AR-906 %s
423+
// RUN: -output=%t.dir/hip_900.a -output=%t.dir/hip_906.a -input=%t.dir/hip_archive.a
424+
// RUN: llvm-ar t %t.dir/hip_900.a | FileCheck -check-prefix=HIP-AR-900 %s
425+
// RUN: llvm-ar t %t.dir/hip_906.a | FileCheck -check-prefix=HIP-AR-906 %s
425426
// HIP-AR-900-DAG: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx900
426427
// HIP-AR-900-DAG: hip_bundle2-hip-amdgcn-amd-amdhsa--gfx900
427428
// HIP-AR-906-DAG: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx906
@@ -553,14 +554,14 @@
553554

554555
// Check compatibility of HIP code objects found in the heterogeneous archive library with OpenMP code objects of the target
555556
// RUN: clang-offload-bundler -unbundle -type=a -targets=openmp-amdgcn-amd-amdhsa--gfx906 \
556-
// RUN: -output=%T/hip-openmp_906.a -input=%T/hip_archive.a -hip-openmp-compatible
557-
// RUN: llvm-ar t %T/hip-openmp_906.a | FileCheck -check-prefix=OPENMPHIPCOMPAT %s
557+
// RUN: -output=%t.dir/hip-openmp_906.a -input=%t.dir/hip_archive.a -hip-openmp-compatible
558+
// RUN: llvm-ar t %t.dir/hip-openmp_906.a | FileCheck -check-prefix=OPENMPHIPCOMPAT %s
558559
// OPENMPHIPCOMPAT: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx906
559560

560561
// Check if a malformat bundle id can be detected and an error can be emitted.
561-
// RUN: not clang-offload-bundler -unbundle -type=a -targets=openmp-amdgcn-amd-amdhsa -output=%T/hip-openmp_906.a -input=%T/hip_archive.a -hip-openmp-compatible 2>&1 | FileCheck %s -check-prefix=ERROR-WRONG-FORMAT
562+
// RUN: not clang-offload-bundler -unbundle -type=a -targets=openmp-amdgcn-amd-amdhsa -output=%t.dir/hip-openmp_906.a -input=%t.dir/hip_archive.a -hip-openmp-compatible 2>&1 | FileCheck %s -check-prefix=ERROR-WRONG-FORMAT
562563
// ERROR-WRONG-FORMAT: error: Targets need to follow the format '<offload kind>-<target triple>', where '<target triple>' follows the format '<kind>-<arch>-<vendor>-<os>-<env>[-<target id>[:target features]]'.
563-
// RUN: not clang-offload-bundler -unbundle -type=a -targets=openmp-amdgcn-amd-amdhsa-gfx906 -output=%T/hip-openmp_906.a -input=%T/hip_archive.a -hip-openmp-compatible 2>&1 | FileCheck %s -check-prefix=ERROR-NO-ENV
564+
// RUN: not clang-offload-bundler -unbundle -type=a -targets=openmp-amdgcn-amd-amdhsa-gfx906 -output=%t.dir/hip-openmp_906.a -input=%t.dir/hip_archive.a -hip-openmp-compatible 2>&1 | FileCheck %s -check-prefix=ERROR-NO-ENV
564565
// ERROR-NO-ENV: error: no compatible code object found for the target 'openmp-amdgcn-amd-amdhsa--'
565566

566567
// Some code so that we can create a binary out of this file.

0 commit comments

Comments
 (0)