[Openmp-commits] [PATCH] D138738: [openmp] [test] XFAIL many-microtask-args.c on ARM

Martin Storsjö via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 25 15:02:20 PST 2022


mstorsjo created this revision.
mstorsjo added reviewers: AndreyChurbanov, JonChesterfield, natgla, jdoerfert, Meinersbur, DavidSpickett.
Herald added subscribers: guansong, kristof.beyls, yaxunl.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138738

Files:
  openmp/cmake/OpenMPTesting.cmake
  openmp/runtime/test/CMakeLists.txt
  openmp/runtime/test/misc_bugs/many-microtask-args.c


Index: openmp/runtime/test/misc_bugs/many-microtask-args.c
===================================================================
--- openmp/runtime/test/misc_bugs/many-microtask-args.c
+++ openmp/runtime/test/misc_bugs/many-microtask-args.c
@@ -1,6 +1,11 @@
 // RUN: %libomp-compile-and-run
 #include <stdio.h>
 
+// This test fails with Clang unless __kmp_invoke_microtask supports at least
+// 17 arguments. On ARM, the fallback C implementation of __kmp_invoke_microtask
+// is used, and that one only currently supports up to 15 arguments.
+// XFAIL: arm
+
 int main()
 {
 
Index: openmp/runtime/test/CMakeLists.txt
===================================================================
--- openmp/runtime/test/CMakeLists.txt
+++ openmp/runtime/test/CMakeLists.txt
@@ -24,6 +24,18 @@
   endif()
 endmacro()
 
+list(APPEND OPENMP_TEST_COMPILER_FEATURE_LIST "${LIBOMP_ARCH}")
+set(OPENMP_TEST_COMPILER_FEATURES "[")
+set(first TRUE)
+foreach(feat IN LISTS OPENMP_TEST_COMPILER_FEATURE_LIST)
+  if (NOT first)
+    string(APPEND OPENMP_TEST_COMPILER_FEATURES ", ")
+  endif()
+  set(first FALSE)
+  string(APPEND OPENMP_TEST_COMPILER_FEATURES "'${feat}'")
+endforeach()
+string(APPEND OPENMP_TEST_COMPILER_FEATURES "]")
+
 pythonize_bool(LIBOMP_USE_HWLOC)
 pythonize_bool(LIBOMP_OMPT_SUPPORT)
 pythonize_bool(LIBOMP_OMPT_OPTIONAL)
Index: openmp/cmake/OpenMPTesting.cmake
===================================================================
--- openmp/cmake/OpenMPTesting.cmake
+++ openmp/cmake/OpenMPTesting.cmake
@@ -168,7 +168,7 @@
     # Just use the lowercase of the compiler ID as fallback.
     string(TOLOWER "${OPENMP_TEST_COMPILER_ID}" comp)
   endif()
-  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)
+  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)
 endfunction()
 set_test_compiler_features()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138738.478029.patch
Type: text/x-patch
Size: 2120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221125/89a1094b/attachment.bin>


More information about the Openmp-commits mailing list