Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// The OpenMP standard defines 3 ways of providing ompt_start_tool:

// RUN: mkdir -p %t.tool_dir

// 1. "statically-linking the tool’s definition of ompt_start_tool into an
// OpenMP application"

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

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

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

// 2.1 Link with tool during compilation

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

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

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

Expand All @@ -39,36 +41,36 @@
// 3.1 OMP_TOOL_VERBOSE_INIT not set

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

// 3.2 OMP_TOOL_VERBOSE_INIT disabled

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

// 3.3 OMP_TOOL_VERBOSE_INIT to stdout

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

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

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

// 3.5 OMP_TOOL_VERBOSE_INIT to stderr, check just stderr

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

// 3.6 OMP_TOOL_VERBOSE_INIT to file "init.log"

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


// REQUIRES: ompt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// RUN: %clang %flags -shared -fPIC %s -o %T/first_tool.so
// RUN: %clang %flags -DTOOL -DSECOND_TOOL -shared -fPIC %s -o %T/second_tool.so
// RUN: %clang %flags -DTOOL -DTHIRD_TOOL -shared -fPIC %s -o %T/third_tool.so
// RUN: mkdir -p %t.tool_dir
// RUN: %clang %flags -shared -fPIC %s -o %t.tool_dir/first_tool.so
// RUN: %clang %flags -DTOOL -DSECOND_TOOL -shared -fPIC %s -o %t.tool_dir/second_tool.so
// RUN: %clang %flags -DTOOL -DTHIRD_TOOL -shared -fPIC %s -o %t.tool_dir/third_tool.so
// RUN: %libomp-compile -DCODE
// RUN: env OMP_TOOL_LIBRARIES=%T/non_existing_file.so:%T/first_tool.so:%T/second_tool.so:%T/third_tool.so \
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s -DPARENTPATH=%T
// 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 \
// RUN: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s -DPARENTPATH=%t.tool_dir

// REQUIRES: ompt
// XFAIL: darwin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// The OpenMP standard defines 3 ways of providing ompt_start_tool:

// RUN: mkdir -p %t.tool_dir

// 1. "statically-linking the tool’s definition of ompt_start_tool into an
// OpenMP application"

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

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

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

// 2.1 Link with tool during compilation

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

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

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

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

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

// REQUIRES: ompt

Expand Down
Loading