Skip to content

Commit 7b78c1e

Browse files
boomanaiden154mahesh-attarde
authored andcommitted
[OpenMP] Remove uses of %T from lit tests (llvm#150723)
This patch removes all uses of %T from lit tests in OpenMP. %T has been deprecated for years and is not reccomended given it does not create a unique dir per test, allowing for race conditions. Remove uses of %T in OpenMP so we can eventually remove support for it in llvm-lit.
1 parent 5617587 commit 7b78c1e

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// The OpenMP standard defines 3 ways of providing ompt_start_tool:
22

3+
// RUN: mkdir -p %t.tool_dir
4+
35
// 1. "statically-linking the tool’s definition of ompt_start_tool into an
46
// OpenMP application"
57

@@ -9,20 +11,20 @@
911
// Note: We should compile the tool without -fopenmp as other tools developer
1012
// would do. Otherwise this test may pass for the wrong reasons on Darwin.
1113

12-
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %T/tool.so
14+
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %t.tool_dir/tool.so
1315

1416
// 2. "introducing a dynamically-linked library that includes the tool’s
1517
// definition of ompt_start_tool into the application’s address space"
1618

1719
// 2.1 Link with tool during compilation
1820

19-
// RUN: %libomp-compile -DCODE %no-as-needed-flag %T/tool.so && \
21+
// RUN: %libomp-compile -DCODE %no-as-needed-flag %t.tool_dir/tool.so && \
2022
// RUN: env OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s \
2123
// RUN: --check-prefixes CHECK,ADDRSPACE
2224

2325
// 2.2 Link with tool during compilation, but AFTER the runtime
2426

25-
// RUN: %libomp-compile -DCODE -lomp %no-as-needed-flag %T/tool.so && \
27+
// RUN: %libomp-compile -DCODE -lomp %no-as-needed-flag %t.tool_dir/tool.so && \
2628
// RUN: env OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s \
2729
// RUN: --check-prefixes CHECK,ADDRSPACE
2830

@@ -39,36 +41,36 @@
3941
// 3.1 OMP_TOOL_VERBOSE_INIT not set
4042

4143
// RUN: %libomp-compile -DCODE && \
42-
// RUN: env OMP_TOOL_LIBRARIES=%T/tool.so %libomp-run | FileCheck %s
44+
// RUN: env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so %libomp-run | FileCheck %s
4345

4446
// 3.2 OMP_TOOL_VERBOSE_INIT disabled
4547

46-
// RUN: env OMP_TOOL_LIBRARIES=%T/tool.so OMP_TOOL_VERBOSE_INIT=disabled \
48+
// RUN: env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so OMP_TOOL_VERBOSE_INIT=disabled \
4749
// RUN: %libomp-run | FileCheck %s
4850

4951
// 3.3 OMP_TOOL_VERBOSE_INIT to stdout
5052

51-
// RUN: %libomp-compile -DCODE && env OMP_TOOL_LIBRARIES=%T/tool.so \
53+
// RUN: %libomp-compile -DCODE && env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so \
5254
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | \
53-
// RUN: FileCheck %s -DPARENTPATH=%T --check-prefixes CHECK,TOOLLIB
55+
// RUN: FileCheck %s -DPARENTPATH=%t.tool_dir --check-prefixes CHECK,TOOLLIB
5456

5557
// 3.4 OMP_TOOL_VERBOSE_INIT to stderr, check merged stdout and stderr
5658

57-
// RUN: env OMP_TOOL_LIBRARIES=%T/tool.so OMP_TOOL_VERBOSE_INIT=stderr \
59+
// RUN: env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so OMP_TOOL_VERBOSE_INIT=stderr \
5860
// RUN: %libomp-run 2>&1 | \
59-
// RUN: FileCheck %s -DPARENTPATH=%T --check-prefixes CHECK,TOOLLIB
61+
// RUN: FileCheck %s -DPARENTPATH=%t.tool_dir --check-prefixes CHECK,TOOLLIB
6062

6163
// 3.5 OMP_TOOL_VERBOSE_INIT to stderr, check just stderr
6264

63-
// RUN: env OMP_TOOL_LIBRARIES=%T/tool.so OMP_TOOL_VERBOSE_INIT=stderr \
65+
// RUN: env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so OMP_TOOL_VERBOSE_INIT=stderr \
6466
// RUN: %libomp-run 2>&1 >/dev/null | \
65-
// RUN: FileCheck %s -DPARENTPATH=%T --check-prefixes TOOLLIB
67+
// RUN: FileCheck %s -DPARENTPATH=%t.tool_dir --check-prefixes TOOLLIB
6668

6769
// 3.6 OMP_TOOL_VERBOSE_INIT to file "init.log"
6870

69-
// RUN: env OMP_TOOL_LIBRARIES=%T/tool.so OMP_TOOL_VERBOSE_INIT=%T/init.log \
70-
// RUN: %libomp-run | FileCheck %s && cat %T/init.log | \
71-
// RUN: FileCheck %s -DPARENTPATH=%T --check-prefixes TOOLLIB
71+
// RUN: env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so OMP_TOOL_VERBOSE_INIT=%t.tool_dir/init.log \
72+
// RUN: %libomp-run | FileCheck %s && cat %t.tool_dir/init.log | \
73+
// RUN: FileCheck %s -DPARENTPATH=%t.tool_dir --check-prefixes TOOLLIB
7274

7375

7476
// REQUIRES: ompt

openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// RUN: %clang %flags -shared -fPIC %s -o %T/first_tool.so
2-
// RUN: %clang %flags -DTOOL -DSECOND_TOOL -shared -fPIC %s -o %T/second_tool.so
3-
// RUN: %clang %flags -DTOOL -DTHIRD_TOOL -shared -fPIC %s -o %T/third_tool.so
1+
// RUN: mkdir -p %t.tool_dir
2+
// RUN: %clang %flags -shared -fPIC %s -o %t.tool_dir/first_tool.so
3+
// RUN: %clang %flags -DTOOL -DSECOND_TOOL -shared -fPIC %s -o %t.tool_dir/second_tool.so
4+
// RUN: %clang %flags -DTOOL -DTHIRD_TOOL -shared -fPIC %s -o %t.tool_dir/third_tool.so
45
// RUN: %libomp-compile -DCODE
5-
// RUN: env OMP_TOOL_LIBRARIES=%T/non_existing_file.so:%T/first_tool.so:%T/second_tool.so:%T/third_tool.so \
6-
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s -DPARENTPATH=%T
6+
// RUN: env OMP_TOOL_LIBRARIES=%t.tool_dir/non_existing_file.so:%t.tool_dir/first_tool.so:%t.tool_dir/second_tool.so:%t.tool_dir/third_tool.so \
7+
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s -DPARENTPATH=%t.tool_dir
78

89
// REQUIRES: ompt
910
// XFAIL: darwin

openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// The OpenMP standard defines 3 ways of providing ompt_start_tool:
22

3+
// RUN: mkdir -p %t.tool_dir
4+
35
// 1. "statically-linking the tool’s definition of ompt_start_tool into an
46
// OpenMP application"
57

@@ -10,20 +12,20 @@
1012
// Note: We should compile the tool without -fopenmp as other tools developer
1113
// would do. Otherwise this test may pass for the wrong reasons on Darwin.
1214

13-
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %T/tool.so
15+
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %t.tool_dir/tool.so
1416

1517
// 2. "introducing a dynamically-linked library that includes the tool’s
1618
// definition of ompt_start_tool into the application’s address space"
1719

1820
// 2.1 Link with tool during compilation
1921

20-
// RUN: %libomp-compile -DCODE %no-as-needed-flag %T/tool.so && \
22+
// RUN: %libomp-compile -DCODE %no-as-needed-flag %t.tool_dir/tool.so && \
2123
// RUN: env OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | \
2224
// RUN: FileCheck %s --check-prefixes CHECK,ADDRSPACE
2325

2426
// 2.2 Link with tool during compilation, but AFTER the runtime
2527

26-
// RUN: %libomp-compile -DCODE -lomp %no-as-needed-flag %T/tool.so && \
28+
// RUN: %libomp-compile -DCODE -lomp %no-as-needed-flag %t.tool_dir/tool.so && \
2729
// RUN: env OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | \
2830
// RUN: FileCheck %s --check-prefixes CHECK,ADDRSPACE
2931

@@ -37,9 +39,9 @@
3739
// architecture and operating system used by the application in the
3840
// tool-libraries-var ICV"
3941

40-
// RUN: %libomp-compile -DCODE && env OMP_TOOL_LIBRARIES=%T/tool.so \
42+
// RUN: %libomp-compile -DCODE && env OMP_TOOL_LIBRARIES=%t.tool_dir/tool.so \
4143
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | \
42-
// RUN: FileCheck %s -DPARENTPATH=%T --check-prefixes CHECK,TOOLLIB
44+
// RUN: FileCheck %s -DPARENTPATH=%t.tool_dir --check-prefixes CHECK,TOOLLIB
4345

4446
// REQUIRES: ompt
4547

0 commit comments

Comments
 (0)