|
1 | 1 | // The OpenMP standard defines 3 ways of providing ompt_start_tool:
|
2 | 2 |
|
| 3 | +// RUN: mkdir -p %t.tool_dir |
| 4 | + |
3 | 5 | // 1. "statically-linking the tool’s definition of ompt_start_tool into an
|
4 | 6 | // OpenMP application"
|
5 | 7 |
|
|
9 | 11 | // Note: We should compile the tool without -fopenmp as other tools developer
|
10 | 12 | // would do. Otherwise this test may pass for the wrong reasons on Darwin.
|
11 | 13 |
|
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 |
13 | 15 |
|
14 | 16 | // 2. "introducing a dynamically-linked library that includes the tool’s
|
15 | 17 | // definition of ompt_start_tool into the application’s address space"
|
16 | 18 |
|
17 | 19 | // 2.1 Link with tool during compilation
|
18 | 20 |
|
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 && \ |
20 | 22 | // RUN: env OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s \
|
21 | 23 | // RUN: --check-prefixes CHECK,ADDRSPACE
|
22 | 24 |
|
23 | 25 | // 2.2 Link with tool during compilation, but AFTER the runtime
|
24 | 26 |
|
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 && \ |
26 | 28 | // RUN: env OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s \
|
27 | 29 | // RUN: --check-prefixes CHECK,ADDRSPACE
|
28 | 30 |
|
|
39 | 41 | // 3.1 OMP_TOOL_VERBOSE_INIT not set
|
40 | 42 |
|
41 | 43 | // 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 |
43 | 45 |
|
44 | 46 | // 3.2 OMP_TOOL_VERBOSE_INIT disabled
|
45 | 47 |
|
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 \ |
47 | 49 | // RUN: %libomp-run | FileCheck %s
|
48 | 50 |
|
49 | 51 | // 3.3 OMP_TOOL_VERBOSE_INIT to stdout
|
50 | 52 |
|
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 \ |
52 | 54 | // 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 |
54 | 56 |
|
55 | 57 | // 3.4 OMP_TOOL_VERBOSE_INIT to stderr, check merged stdout and stderr
|
56 | 58 |
|
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 \ |
58 | 60 | // 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 |
60 | 62 |
|
61 | 63 | // 3.5 OMP_TOOL_VERBOSE_INIT to stderr, check just stderr
|
62 | 64 |
|
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 \ |
64 | 66 | // 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 |
66 | 68 |
|
67 | 69 | // 3.6 OMP_TOOL_VERBOSE_INIT to file "init.log"
|
68 | 70 |
|
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 |
72 | 74 |
|
73 | 75 |
|
74 | 76 | // REQUIRES: ompt
|
|
0 commit comments