diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake --- a/openmp/cmake/OpenMPTesting.cmake +++ b/openmp/cmake/OpenMPTesting.cmake @@ -133,8 +133,18 @@ set(OPENMP_TEST_COMPILER_ID "Clang") # Cannot use CLANG_VERSION because we are not guaranteed that this is already set. set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}") - set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}") - set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_MAJOR_VERSION}.${LLVM_MINOR_VERSION}") + + # Determine major version in case llvm major version is not set. + if(${LLVM_MAJOR_VERSION}) + set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}") + set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_MAJOR_VERSION}.${LLVM_MINOR_VERSION}") + else() + string(REGEX MATCH "[0-9]+" major "${LLVM_VERSION}") + string(REGEX MATCH "[0-9]+\\.[0-9]+" majorminor "${LLVM_VERSION}") + set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${major}") + set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${majorminor}") + endif() + # Unfortunately the top-level cmake/config-ix.cmake file mangles CMake's # CMAKE_THREAD_LIBS_INIT variable from the FindThreads package, so work # around that, until it is fixed there. diff --git a/openmp/runtime/test/env/kmp_set_dispatch_buf.c b/openmp/runtime/test/env/kmp_set_dispatch_buf.c --- a/openmp/runtime/test/env/kmp_set_dispatch_buf.c +++ b/openmp/runtime/test/env/kmp_set_dispatch_buf.c @@ -1,9 +1,15 @@ -// RUN: %libomp-compile && env KMP_DISP_NUM_BUFFERS=0 %libomp-run -// RUN: env KMP_DISP_NUM_BUFFERS=1 %libomp-run && env KMP_DISP_NUM_BUFFERS=3 %libomp-run -// RUN: env KMP_DISP_NUM_BUFFERS=4 %libomp-run && env KMP_DISP_NUM_BUFFERS=7 %libomp-run -// RUN: %libomp-compile -DMY_SCHEDULE=guided && env KMP_DISP_NUM_BUFFERS=1 %libomp-run -// RUN: env KMP_DISP_NUM_BUFFERS=3 %libomp-run && env KMP_DISP_NUM_BUFFERS=4 %libomp-run +// RUN: %libomp-compile +// RUN: env KMP_DISP_NUM_BUFFERS=0 %libomp-run +// RUN: env KMP_DISP_NUM_BUFFERS=1 %libomp-run +// RUN: env KMP_DISP_NUM_BUFFERS=3 %libomp-run +// RUN: env KMP_DISP_NUM_BUFFERS=4 %libomp-run // RUN: env KMP_DISP_NUM_BUFFERS=7 %libomp-run +// RUN: %libomp-compile -DMY_SCHEDULE=guided +// RUN: env KMP_DISP_NUM_BUFFERS=1 %libomp-run +// RUN: env KMP_DISP_NUM_BUFFERS=3 %libomp-run +// RUN: env KMP_DISP_NUM_BUFFERS=4 %libomp-run +// RUN: env KMP_DISP_NUM_BUFFERS=7 %libomp-run +// UNSUPPORTED: clang-11 #include #include #include diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg --- a/openmp/runtime/test/lit.cfg +++ b/openmp/runtime/test/lit.cfg @@ -111,7 +111,6 @@ if 'INTEL_LICENSE_FILE' in os.environ: config.environment['INTEL_LICENSE_FILE'] = os.environ['INTEL_LICENSE_FILE'] - # substitutions config.substitutions.append(("%libomp-compile-and-run", \ "%libomp-compile && %libomp-run")) diff --git a/openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c b/openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c --- a/openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c +++ b/openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c @@ -3,6 +3,7 @@ // RUN: %libomp-run 1 && %libomp-run 2 && %libomp-run 5 // RUN: %libomp-compile -DMY_SCHEDULE=guided && %libomp-run 7 // RUN: %libomp-run 1 && %libomp-run 2 && %libomp-run 5 +// UNSUPPORTED: clang-11 #include #include #include