Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
openmp/cmake/OpenMPTesting.cmake
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | else() | ||||
set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 0) | set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 0) | ||||
endif() | endif() | ||||
set(OPENMP_TEST_COMPILER_HAS_OMP_H 1) | set(OPENMP_TEST_COMPILER_HAS_OMP_H 1) | ||||
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS}") | set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS}") | ||||
set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) | set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) | ||||
endif() | endif() | ||||
# Function to set compiler features for use in lit. | # Function to set compiler features for use in lit. | ||||
function(update_test_compiler_features) | |||||
set(FEATURES "[") | |||||
set(first TRUE) | |||||
foreach(feat IN LISTS OPENMP_TEST_COMPILER_FEATURE_LIST) | |||||
if (NOT first) | |||||
string(APPEND FEATURES ", ") | |||||
endif() | |||||
set(first FALSE) | |||||
string(APPEND FEATURES "'${feat}'") | |||||
endforeach() | |||||
string(APPEND FEATURES "]") | |||||
set(OPENMP_TEST_COMPILER_FEATURES ${FEATURES} PARENT_SCOPE) | |||||
endfunction() | |||||
function(set_test_compiler_features) | function(set_test_compiler_features) | ||||
if ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "GNU") | if ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "GNU") | ||||
set(comp "gcc") | set(comp "gcc") | ||||
elseif ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "Intel") | elseif ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "Intel") | ||||
set(comp "icc") | set(comp "icc") | ||||
else() | else() | ||||
# Just use the lowercase of the compiler ID as fallback. | # Just use the lowercase of the compiler ID as fallback. | ||||
string(TOLOWER "${OPENMP_TEST_COMPILER_ID}" comp) | string(TOLOWER "${OPENMP_TEST_COMPILER_ID}" comp) | ||||
endif() | 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() | endfunction() | ||||
set_test_compiler_features() | set_test_compiler_features() | ||||
update_test_compiler_features() | |||||
# Function to add a testsuite for an OpenMP runtime library. | # Function to add a testsuite for an OpenMP runtime library. | ||||
function(add_openmp_testsuite target comment) | function(add_openmp_testsuite target comment) | ||||
if (NOT ENABLE_CHECK_TARGETS) | if (NOT ENABLE_CHECK_TARGETS) | ||||
add_custom_target(${target} | add_custom_target(${target} | ||||
COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, dependencies not found.") | COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, dependencies not found.") | ||||
message(STATUS "${target} does nothing.") | message(STATUS "${target} does nothing.") | ||||
return() | return() | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |