Skip to content

Commit

Permalink
[llvm] Get rid of "%T" expansions
Browse files Browse the repository at this point in the history
The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t.

This patch removes %T in llvm.

Differential Revision: https://reviews.llvm.org/D36495

llvm-svn: 310953
  • Loading branch information
kubamracek committed Aug 15, 2017
1 parent cea6267 commit 17ee427
Show file tree
Hide file tree
Showing 68 changed files with 395 additions and 364 deletions.
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/analysis.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/analysis.ml
* RUN: %ocamlc -g -w +A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
* RUN: %t
* RUN: %ocamlopt -g -w +A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
* RUN: %t
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/analysis.ml
* RUN: %ocamlc -g -w +A -package llvm.analysis -linkpkg %t/analysis.ml -o %t/executable
* RUN: %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.analysis -linkpkg %t/analysis.ml -o %t/executable
* RUN: %t/executable
* XFAIL: vg_leak
*)

Expand Down
12 changes: 6 additions & 6 deletions llvm/test/Bindings/OCaml/bitreader.ml
@@ -1,9 +1,9 @@
(* RUN: cp %s %T/bitreader.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/bitreader.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitreader.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitreader.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: llvm-dis < %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
12 changes: 6 additions & 6 deletions llvm/test/Bindings/OCaml/bitwriter.ml
@@ -1,9 +1,9 @@
(* RUN: cp %s %T/bitwriter.ml
* RUN: %ocamlc -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/bitwriter.ml
* RUN: %ocamlc -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitwriter.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitwriter.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: llvm-dis < %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
16 changes: 8 additions & 8 deletions llvm/test/Bindings/OCaml/core.ml
@@ -1,12 +1,12 @@
(* RUN: cp %s %T/core.ml
* RUN: %ocamlc -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/core.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/core.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc > %t.ll
* RUN: FileCheck %s < %t.ll
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/core.ml
* RUN: %ocamlc -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %t/core.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %t/core.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: llvm-dis < %t/bitcode.bc > %t/dis.ll
* RUN: FileCheck %s < %t/dis.ll
* Do a second pass for things that shouldn't be anywhere.
* RUN: FileCheck -check-prefix=CHECK-NOWHERE %s < %t.ll
* RUN: FileCheck -check-prefix=CHECK-NOWHERE %s < %t/dis.ll
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/diagnostic_handler.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/diagnostic_handler.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %T/diagnostic_handler.ml -o %t
* RUN: %t %t.bc | FileCheck %s
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %T/diagnostic_handler.ml -o %t
* RUN: %t %t.bc | FileCheck %s
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/diagnostic_handler.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/diagnostic_handler.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc | FileCheck %s
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/diagnostic_handler.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc | FileCheck %s
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/executionengine.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/executionengine.ml
* RUN: %ocamlc -g -w +A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
* RUN: %t
* RUN: %ocamlopt -g -w +A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
* RUN: %t
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/executionengine.ml
* RUN: %ocamlc -g -w +A -package llvm.executionengine -linkpkg %t/executionengine.ml -o %t/executable
* RUN: %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.executionengine -linkpkg %t/executionengine.ml -o %t/executable
* RUN: %t/executable
* REQUIRES: native, object-emission
* XFAIL: vg_leak
*)
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/ext_exc.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/ext_exc.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
* RUN: %t
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
* RUN: %t
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/ext_exc.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable
* RUN: %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable
* RUN: %t/executable
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/ipo.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/ipo_opts.ml
* RUN: %ocamlc -g -w +A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w +A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
* RUN: %t %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/ipo_opts.ml
* RUN: %ocamlc -g -w +A -package llvm.ipo -linkpkg %t/ipo_opts.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w +A -package llvm.ipo -linkpkg %t/ipo_opts.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/irreader.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/irreader.ml
* RUN: %ocamlc -g -w +A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
* RUN: %t
* RUN: %ocamlopt -g -w +A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
* RUN: %t
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/irreader.ml
* RUN: %ocamlc -g -w +A -package llvm.irreader -linkpkg %t/irreader.ml -o %t/executable
* RUN: %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.irreader -linkpkg %t/irreader.ml -o %t/executable
* RUN: %t/executable
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/linker.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/linker.ml
* RUN: %ocamlc -g -w +A -package llvm.linker -linkpkg %T/linker.ml -o %t
* RUN: %t
* RUN: %ocamlopt -g -w +A -package llvm.linker -linkpkg %T/linker.ml -o %t
* RUN: %t
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/linker.ml
* RUN: %ocamlc -g -w +A -package llvm.linker -linkpkg %t/linker.ml -o %t/executable
* RUN: %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.linker -linkpkg %t/linker.ml -o %t/executable
* RUN: %t/executable
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/passmgr_builder.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/passmgr_builder.ml
* RUN: %ocamlc -g -w +A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w +A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
* RUN: %t %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/passmgr_builder.ml
* RUN: %ocamlc -g -w +A -package llvm.passmgr_builder -linkpkg %t/passmgr_builder.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w +A -package llvm.passmgr_builder -linkpkg %t/passmgr_builder.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/scalar_opts.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/scalar_opts.ml
* RUN: %ocamlc -g -w +A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w +A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
* RUN: %t %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/scalar_opts.ml
* RUN: %ocamlc -g -w +A -package llvm.scalar_opts -linkpkg %t/scalar_opts.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w +A -package llvm.scalar_opts -linkpkg %t/scalar_opts.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Bindings/OCaml/target.ml
@@ -1,7 +1,7 @@
(* RUN: cp %s %T/target.ml
* RUN: %ocamlc -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
* RUN: %ocamlopt -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
* RUN: %t %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/target.ml
* RUN: %ocamlc -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %t/target.ml -o %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %t/target.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/transform_utils.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/transform_utils.ml
* RUN: %ocamlc -g -w +A -package llvm.transform_utils -linkpkg %T/transform_utils.ml -o %t
* RUN: %t
* RUN: %ocamlopt -g -w +A -package llvm.transform_utils -linkpkg %T/transform_utils.ml -o %t
* RUN: %t
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/transform_utils.ml
* RUN: %ocamlc -g -w +A -package llvm.transform_utils -linkpkg %t/transform_utils.ml -o %t/executable
* RUN: %t/executable
* RUN: %ocamlopt -g -w +A -package llvm.transform_utils -linkpkg %t/transform_utils.ml -o %t/executable
* RUN: %t/executable
* XFAIL: vg_leak
*)

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Bindings/OCaml/vectorize.ml
@@ -1,8 +1,8 @@
(* RUN: cp %s %T/vectorize_opts.ml
* RUN: %ocamlc -g -w +A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
* RUN: %t %t.bc
* RUN: %ocamlopt -g -w +A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
* RUN: %t %t.bc
(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/vectorize_opts.ml
* RUN: %ocamlc -g -w +A -package llvm.vectorize -linkpkg %t/vectorize_opts.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* RUN: %ocamlopt -g -w +A -package llvm.vectorize -linkpkg %t/vectorize_opts.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc
* XFAIL: vg_leak
*)

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/DebugInfo/PDB/pdbdump-objfilename.yaml
@@ -1,5 +1,5 @@
# RUN: llvm-pdbdump yaml2pdb -pdb=%T/objfilename.pdb %s
# RUN: llvm-pdbdump pdb2yaml -dbi-module-info %T/objfilename.pdb \
# RUN: llvm-pdbdump yaml2pdb -pdb=%t %s
# RUN: llvm-pdbdump pdb2yaml -dbi-module-info %t \
# RUN: | FileCheck %s
#
# CHECK: DbiStream:
Expand Down
9 changes: 5 additions & 4 deletions llvm/test/DebugInfo/PDB/pdbdump-source-names.test
Expand Up @@ -6,11 +6,12 @@
# that differ by one byte, so that at least one of those will only
# pass if alignment is implemented correctly.

RUN: llvm-pdbutil yaml2pdb -pdb=%T/source-names-1.pdb %p/Inputs/source-names-1.yaml
RUN: llvm-pdbutil pdb2yaml -module-files %T/source-names-1.pdb \
RUN: rm -rf %t && mkdir -p %t
RUN: llvm-pdbutil yaml2pdb -pdb=%t/source-names-1.pdb %p/Inputs/source-names-1.yaml
RUN: llvm-pdbutil pdb2yaml -module-files %t/source-names-1.pdb \
RUN: | FileCheck -check-prefix=CHECK1 %s
RUN: llvm-pdbutil yaml2pdb -pdb=%T/source-names-2.pdb %p/Inputs/source-names-2.yaml
RUN: llvm-pdbutil pdb2yaml -module-files %T/source-names-2.pdb \
RUN: llvm-pdbutil yaml2pdb -pdb=%t/source-names-2.pdb %p/Inputs/source-names-2.yaml
RUN: llvm-pdbutil pdb2yaml -module-files %t/source-names-2.pdb \
RUN: | FileCheck -check-prefix=CHECK2 %s

CHECK1: SourceFiles:
Expand Down
7 changes: 4 additions & 3 deletions llvm/test/DebugInfo/X86/split-dwarf-multiple-cu-hash.ll
@@ -1,6 +1,7 @@
; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o %T/a.o
; RUN: %llc_dwarf -split-dwarf-file=bar.dwo %s -filetype=obj -o %T/b.o
; RUN: llvm-dwarfdump -debug-dump=info %T/a.o %T/b.o | FileCheck %s
; RUN: rm -rf %t && mkdir -p %t
; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o %t/a.o
; RUN: %llc_dwarf -split-dwarf-file=bar.dwo %s -filetype=obj -o %t/b.o
; RUN: llvm-dwarfdump -debug-dump=info %t/a.o %t/b.o | FileCheck %s

; CHECK: dwo_id {{.*}}([[HASH:.*]])
; CHECK-NOT: dwo_id {{.*}}([[HASH]])
Expand Down
5 changes: 3 additions & 2 deletions llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-empty.test
@@ -1,6 +1,7 @@
REQUIRES: shell
RUN: cd %T
RUN: cp %p/Inputs/split-dwarf-empty.dwo %T
RUN: rm -rf %t && mkdir -p %t
RUN: cd %t
RUN: cp %p/Inputs/split-dwarf-empty.dwo %t
RUN: echo "%p/Inputs/split-dwarf-empty.o 0xdeadbeef" > %t.input

RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
Expand Down

0 comments on commit 17ee427

Please sign in to comment.