[llvm] Get rid of "%T" expansions
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
diff --git a/llvm/test/Object/archive-delete.test b/llvm/test/Object/archive-delete.test
index c8530be..6bf8b51 100644
--- a/llvm/test/Object/archive-delete.test
+++ b/llvm/test/Object/archive-delete.test
@@ -1,6 +1,6 @@
Test the 'd' operation in llvm-ar
-RUN: cd %T
+RUN: cd `dirname %t`
RUN: rm -f %t.a
RUN: cp %p/Inputs/GNU.a %t.a
diff --git a/llvm/test/Object/archive-extract.test b/llvm/test/Object/archive-extract.test
index 664529d..33e064a 100644
--- a/llvm/test/Object/archive-extract.test
+++ b/llvm/test/Object/archive-extract.test
@@ -1,7 +1,7 @@
; This test just makes sure that llvm-ar can extract bytecode members
; from various style archives.
-; RUN: cd %T
+; RUN: cd `dirname %t`
; RUN: rm -f very_long_bytecode_file_name.bc
; RUN: llvm-ar p %p/Inputs/GNU.a very_long_bytecode_file_name.bc | \
diff --git a/llvm/test/Object/archive-move.test b/llvm/test/Object/archive-move.test
index adc1149..d1d4f3d 100644
--- a/llvm/test/Object/archive-move.test
+++ b/llvm/test/Object/archive-move.test
@@ -1,6 +1,6 @@
Test the 'm' operation in llvm-ar
-RUN: cd %T
+RUN: cd `dirname %t`
RUN: rm -f %t.a
RUN: cp %p/Inputs/GNU.a %t.a
diff --git a/llvm/test/Object/archive-thin-paths.test b/llvm/test/Object/archive-thin-paths.test
index 21788b4..f5a6d96 100644
--- a/llvm/test/Object/archive-thin-paths.test
+++ b/llvm/test/Object/archive-thin-paths.test
@@ -1,6 +1,6 @@
REQUIRES: system-windows
-RUN: cd %T
+RUN: cd `dirname %t`
RUN: mkdir -p archive-thin-paths.dir
RUN: echo foo > archive-thin-paths.dir/foo.o
diff --git a/llvm/test/Object/archive-update.test b/llvm/test/Object/archive-update.test
index fd1ea41..6fa6662 100644
--- a/llvm/test/Object/archive-update.test
+++ b/llvm/test/Object/archive-update.test
@@ -1,6 +1,6 @@
Test the 'u' option of llvm-ar
-RUN: cd %T
+RUN: cd `dirname %t`
RUN: rm -f %t.a
Create a file named evenlen that is newer than the evenlen on the source dir.
diff --git a/llvm/test/Object/directory.ll b/llvm/test/Object/directory.ll
index c4b0bbf..3e9ac2c 100644
--- a/llvm/test/Object/directory.ll
+++ b/llvm/test/Object/directory.ll
@@ -1,12 +1,12 @@
-;RUN: rm -f %T/test.a
-;RUN: not llvm-ar r %T/test.a . 2>&1 | FileCheck %s
+;RUN: rm -rf %t && mkdir -p %t
+;RUN: not llvm-ar r %t/test.a . 2>&1 | FileCheck %s
;CHECK: .: {{I|i}}s a directory
-;RUN: rm -f %T/test.a
-;RUN: touch %T/a-very-long-file-name
-;RUN: llvm-ar r %T/test.a %s %T/a-very-long-file-name
-;RUN: llvm-ar r %T/test.a %T/a-very-long-file-name
-;RUN: llvm-ar t %T/test.a | FileCheck -check-prefix=MEMBERS %s
+;RUN: rm -f %t/test.a
+;RUN: touch %t/a-very-long-file-name
+;RUN: llvm-ar r %t/test.a %s %t/a-very-long-file-name
+;RUN: llvm-ar r %t/test.a %t/a-very-long-file-name
+;RUN: llvm-ar t %t/test.a | FileCheck -check-prefix=MEMBERS %s
;MEMBERS-NOT: /
;MEMBERS: directory.ll
;MEMBERS: a-very-long-file-name