Index: openmp/libomptarget/test/CMakeLists.txt =================================================================== --- openmp/libomptarget/test/CMakeLists.txt +++ openmp/libomptarget/test/CMakeLists.txt @@ -12,8 +12,15 @@ set(LIBOMPTARGET_DEBUG False) endif() -add_openmp_testsuite(check-libomptarget "Running libomptarget tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}) +string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}") +foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS) + string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET) + add_openmp_testsuite(check-libomptarget-${CURRENT_TARGET} "Running libomptarget tests" ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET} DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}) + list(APPEND LIBOMPTARGET_LIT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}) -# Configure the lit.site.cfg.in file -set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!") -configure_file(lit.site.cfg.in lit.site.cfg @ONLY) + # Configure the lit.site.cfg.in file + set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!") + configure_file(lit.site.cfg.in ${CURRENT_TARGET}/lit.site.cfg @ONLY) +endforeach() + +add_openmp_testsuite(check-libomptarget "Running libomptarget tests" ${LIBOMPTARGET_LIT_TESTSUITES} EXCLUDE_FROM_CHECK_ALL DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}) \ No newline at end of file Index: openmp/libomptarget/test/lit.cfg =================================================================== --- openmp/libomptarget/test/lit.cfg +++ openmp/libomptarget/test/lit.cfg @@ -24,7 +24,7 @@ config.environment[name] = value # name: The name of this test suite. -config.name = 'libomptarget' +config.name = 'libomptarget :: ' + config.libomptarget_current_target # suffixes: A list of file extensions to treat as test files. config.suffixes = ['.c', '.cpp', '.cc'] @@ -57,6 +57,8 @@ if config.libomptarget_debug: config.available_features.add('libomptarget-debug') +config.available_features.add(config.libomptarget_current_target) + # Setup environment to find dynamic library at runtime if config.operating_system == 'Windows': append_dynamic_library_path('PATH', config.library_dir, ";") @@ -84,7 +86,31 @@ for libomptarget_target in config.libomptarget_all_targets: # Is this target in the current system? If so create a compile, run and test # command. Otherwise create command that return false. - if libomptarget_target in config.libomptarget_system_targets: + if libomptarget_target == config.libomptarget_current_target: + config.substitutions.append(("%libomptarget-compilexx-run-and-check-generic", + "%libomptarget-compilexx-run-and-check-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-compile-run-and-check-generic", + "%libomptarget-compile-run-and-check-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-compilexx-and-run-generic", + "%libomptarget-compilexx-and-run-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-compile-and-run-generic", + "%libomptarget-compile-and-run-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-compilexx-generic", + "%libomptarget-compilexx-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-compile-generic", + "%libomptarget-compile-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-run-generic", + "%libomptarget-run-" + libomptarget_target)) + config.substitutions.append(("%libomptarget-run-fail-generic", + "%libomptarget-run-fail-" + libomptarget_target)) + config.substitutions.append(("%clangxx-generic", + "%clangxx-" + libomptarget_target)) + config.substitutions.append(("%clang-generic", + "%clang-" + libomptarget_target)) + config.substitutions.append(("%fcheck-generic", + config.libomptarget_filecheck + " %s")) + + config.substitutions.append(("%libomptarget-compilexx-run-and-check-" + \ libomptarget_target, \ "%libomptarget-compilexx-and-run-" + libomptarget_target + \ Index: openmp/libomptarget/test/lit.site.cfg.in =================================================================== --- openmp/libomptarget/test/lit.site.cfg.in +++ openmp/libomptarget/test/lit.site.cfg.in @@ -5,13 +5,13 @@ config.test_compiler_features = @OPENMP_TEST_COMPILER_FEATURES@ config.test_openmp_flags = "@OPENMP_TEST_OPENMP_FLAGS@" config.test_extra_flags = "@OPENMP_TEST_FLAGS@" -config.libomptarget_obj_root = "@CMAKE_CURRENT_BINARY_DIR@" +config.libomptarget_obj_root = "@CMAKE_CURRENT_BINARY_DIR@/@CURRENT_TARGET@" config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@" config.omp_header_directory = "@LIBOMPTARGET_OPENMP_HEADER_FOLDER@" config.omp_host_rtl_directory = "@LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER@" config.operating_system = "@CMAKE_SYSTEM_NAME@" config.libomptarget_all_targets = "@LIBOMPTARGET_ALL_TARGETS@".split() -config.libomptarget_system_targets = "@LIBOMPTARGET_SYSTEM_TARGETS@".split() +config.libomptarget_current_target = "@CURRENT_TARGET@" config.libomptarget_filecheck = "@OPENMP_FILECHECK_EXECUTABLE@" config.libomptarget_not = "@OPENMP_NOT_EXECUTABLE@" config.libomptarget_debug = @LIBOMPTARGET_DEBUG@ Index: openmp/libomptarget/test/mapping/private_mapping.c =================================================================== --- openmp/libomptarget/test/mapping/private_mapping.c +++ openmp/libomptarget/test/mapping/private_mapping.c @@ -1,8 +1,4 @@ -// RUN: %libomptarget-compile-run-and-check-aarch64-unknown-linux-gnu -// RUN: %libomptarget-compile-run-and-check-powerpc64-ibm-linux-gnu -// RUN: %libomptarget-compile-run-and-check-powerpc64le-ibm-linux-gnu -// RUN: %libomptarget-compile-run-and-check-x86_64-pc-linux-gnu -// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda +// RUN: %libomptarget-compile-run-and-check-generic #include #include