Skip to content

Commit 2bd2734

Browse files
committed
Reapply [openmp] [test] XFAIL many-microtask-args.c on ARM
On ARM, a C fallback version of __kmp_invoke_microtask is used, which only handles up to a fixed number of arguments - while many-microtask-args.c tests that the function can handle an arbitrarily large number of arguments (the testcase produces 17 arguments). On the CMake level, we can't add ${LIBOMP_ARCH} directly to OPENMP_TEST_COMPILER_FEATURES in OpenMPTesting.cmake, since that file is parsed before LIBOMP_ARCH is set. Instead convert the feature list into a proper CMake list, and append ${LIBOMP_ARCH} into it before serializing it to an Python array. Reapply: Make sure OPENMP_TEST_COMPILER_FEATURES is defined properly in all other test subdirectories other than runtime/test too. Differential Revision: https://reviews.llvm.org/D138738
1 parent 98454e3 commit 2bd2734

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

openmp/cmake/OpenMPTesting.cmake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,20 @@ else()
159159
endif()
160160

161161
# Function to set compiler features for use in lit.
162+
function(update_test_compiler_features)
163+
set(FEATURES "[")
164+
set(first TRUE)
165+
foreach(feat IN LISTS OPENMP_TEST_COMPILER_FEATURE_LIST)
166+
if (NOT first)
167+
string(APPEND FEATURES ", ")
168+
endif()
169+
set(first FALSE)
170+
string(APPEND FEATURES "'${feat}'")
171+
endforeach()
172+
string(APPEND FEATURES "]")
173+
set(OPENMP_TEST_COMPILER_FEATURES ${FEATURES} PARENT_SCOPE)
174+
endfunction()
175+
162176
function(set_test_compiler_features)
163177
if ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "GNU")
164178
set(comp "gcc")
@@ -168,9 +182,10 @@ function(set_test_compiler_features)
168182
# Just use the lowercase of the compiler ID as fallback.
169183
string(TOLOWER "${OPENMP_TEST_COMPILER_ID}" comp)
170184
endif()
171-
set(OPENMP_TEST_COMPILER_FEATURES "['${comp}', '${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR}', '${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR}', '${comp}-${OPENMP_TEST_COMPILER_VERSION}']" PARENT_SCOPE)
185+
set(OPENMP_TEST_COMPILER_FEATURE_LIST ${comp} ${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR} ${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR} ${comp}-${OPENMP_TEST_COMPILER_VERSION} PARENT_SCOPE)
172186
endfunction()
173187
set_test_compiler_features()
188+
update_test_compiler_features()
174189

175190
# Function to add a testsuite for an OpenMP runtime library.
176191
function(add_openmp_testsuite target comment)

openmp/runtime/test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ macro(pythonize_bool var)
2424
endif()
2525
endmacro()
2626

27+
list(APPEND OPENMP_TEST_COMPILER_FEATURE_LIST "${LIBOMP_ARCH}")
28+
update_test_compiler_features()
29+
2730
pythonize_bool(LIBOMP_USE_HWLOC)
2831
pythonize_bool(LIBOMP_OMPT_SUPPORT)
2932
pythonize_bool(LIBOMP_OMPT_OPTIONAL)

openmp/runtime/test/misc_bugs/many-microtask-args.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// RUN: %libomp-compile-and-run
22
#include <stdio.h>
33

4+
// This test fails with Clang unless __kmp_invoke_microtask supports at least
5+
// 17 arguments. On ARM, the fallback C implementation of __kmp_invoke_microtask
6+
// is used, and that one only currently supports up to 15 arguments.
7+
// XFAIL: arm
8+
49
int main()
510
{
611

0 commit comments

Comments
 (0)