Updated util/test_llvm_versions.sh script

This commit is contained in:
Bartek Kryza
2024-06-19 17:56:40 +02:00
parent fdfd89ace8
commit 4b6e6717a5
3 changed files with 23 additions and 8 deletions

View File

@@ -1,9 +1,5 @@
message(STATUS "Checking for LLVM and Clang...")
if(LLVM_VERSION STREQUAL "18")
set(LLVM_VERSION "18.1")
endif()
# If user provided a path to llvm-config executable use it to detect
# LLVM Version and appropriate CMake module path
if(NOT "${LLVM_CONFIG_PATH}" STREQUAL "")
@@ -26,6 +22,10 @@ if(NOT "${LLVM_CONFIG_PATH}" STREQUAL "")
set(LLVM_VERSION ${CMAKE_MATCH_1})
endif()
if(LLVM_VERSION STREQUAL "18")
set(LLVM_VERSION "18.1")
endif()
find_package(LLVM ${LLVM_VERSION} CONFIG REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})

View File

@@ -32,8 +32,11 @@ TEST_CASE("t00075")
REQUIRE(IsEnum(src, {"ns1::ns2", "E"}));
REQUIRE(IsConcept(src, {"ns1::ns2", "C<T>"}));
#if (LLVM_VERSION_MAJOR == 13) || (LLVM_VERSION_MAJOR == 14)
REQUIRE(IsConceptRequirement(src, "C<T>", "T({})"));
#else
REQUIRE(IsConceptRequirement(src, "C<T>", "T{}"));
#endif
REQUIRE(IsConceptRequirement(src, "C<T>", "t.e()"));
REQUIRE(IsConceptParameterList(src, "C<T>", "(T t)"));
REQUIRE(!IsConceptParameterList(src, "C<T>", "(T ns1::ns2::t)"));

View File

@@ -1,16 +1,28 @@
#!/bin/bash
set -e
trap 'echo "Build failed!"' ERR
declare -a llvm_configs=("llvm-config-12"
"llvm-config-13"
"llvm-config-14"
"llvm-config-15"
"llvm-config-16"
"llvm-config-17")
"llvm-config-17"
"llvm-config-18")
# Test with GCC and different LLVM versions
for config_path in ${llvm_configs[@]}; do
echo "---------------------------------------------------------"
echo " Running clang-uml tests against LLVM $(${config_path} --version)"
echo "---------------------------------------------------------"
make clean
LLVM_CONFIG_PATH=$config_path NUMPROC=12 make test
CC=/usr/bin/gcc-11 CXX=/usr/bin/g++-11 LLVM_CONFIG_PATH=$config_path NUMPROC=16 make test
done
# Also check compilation with Clang
make clean
CC=/usr/bin/clang-17 CXX=/usr/bin/clang++-17 LLVM_VERSION=17 NUMPROC=16 CMAKE_GENERATOR=Ninja ENABLE_CXX_MODULES_TEST_CASES=ON ENABLE_CUDA_TEST_CASES=ON make test
make clean
CC=/usr/bin/clang-18 CXX=/usr/bin/clang++-18 LLVM_VERSION=18 NUMPROC=16 CMAKE_GENERATOR=Ninja ENABLE_CXX_MODULES_TEST_CASES=ON ENABLE_CUDA_TEST_CASES=ON make test
make clean