From 479f791c935cfde0540729bee35ec0603ebcdc9e Mon Sep 17 00:00:00 2001 From: Lyupa Anastasia Date: Fri, 23 Jun 2023 18:23:17 +0300 Subject: [PATCH] [openmp][test] Fix tool_available_search on Darwin dlerror() returns different error strings on Darwin and Linux Signed-off-by: Lyupa Anastasia --- openmp/runtime/test/lit.cfg | 7 +++++++ .../tool_available_search/tool_available_search.c | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg index fe1886b711c8..45e65d9c3ef6 100644 --- a/openmp/runtime/test/lit.cfg +++ b/openmp/runtime/test/lit.cfg @@ -152,6 +152,13 @@ config.substitutions.append(("%flags", config.test_flags)) config.substitutions.append(("%python", '"%s"' % (sys.executable))) config.substitutions.append(("%not", config.test_not)) +# OHOS_LOCAL begin + +# Define CHECK-%os to check for OS-dependent output. +config.substitutions.append(('CHECK-%os', ("CHECK-" + config.operating_system))) + +# OHOS_LOCAL end + if config.has_ompt: config.substitutions.append(("FileCheck", "tee %%t.out | %s" % config.test_filecheck)) config.substitutions.append(("%sort-threads", "sort -n -s")) diff --git a/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c b/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c index e8823dfa3a3f..e2cb3877724a 100644 --- a/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c +++ b/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c @@ -3,7 +3,8 @@ // RUN: %clang %flags -DTOOL -DTHIRD_TOOL -shared -fPIC %s -o %T/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: OMP_TOOL_VERBOSE_INIT=stdout %libomp-run | FileCheck %s -DPARENTPATH=%T \ +// RUN: --check-prefix=CHECK-%os --check-prefix=CHECK // REQUIRES: ompt @@ -25,12 +26,14 @@ // CHECK-SAME: [[PARENTPATH]]/second_tool.so // CHECK-SAME: [[PARENTPATH]]/third_tool.so // CHECK-NEXT: Opening [[PARENTPATH]]/non_existing_file.so... Failed: -// CHECK-SAME: [[PARENTPATH]]/non_existing_file.so: cannot open shared object -// CHECK-SAME: file: No such file or directory +// CHECK-Linux-SAME: [[PARENTPATH]]/non_existing_file.so: cannot open shared object +// CHECK-Linux-SAME: file: No such file or directory +// CHECK-Darwin-SAME: dlopen([[PARENTPATH]]/non_existing_file.so, 1): image not found // CHECK-NEXT: Opening [[PARENTPATH]]/first_tool.so... Success. // CHECK-NEXT: Searching for ompt_start_tool in // CHECK-SAME: [[PARENTPATH]]/first_tool.so... Failed: -// CHECK-SAME: [[PARENTPATH]]/first_tool.so: undefined symbol: ompt_start_tool +// CHECK-Linux-SAME: [[PARENTPATH]]/first_tool.so: undefined symbol: ompt_start_tool +// CHECK-Darwin-SAME: dlsym({{0x[0-9a-f]+}}, ompt_start_tool): symbol not found // CHECK-NEXT: Opening [[PARENTPATH]]/second_tool.so... Success. // CHECK-NEXT: Searching for ompt_start_tool in // CHECK-SAME: [[PARENTPATH]]/second_tool.so... 0: Do not initialize tool -- Gitee