2011-04-29 14:27:02 +08:00
|
|
|
set(POLLY_TEST_DIRECTORIES
|
|
|
|
"AffineIterator"
|
2011-08-25 16:40:59 +08:00
|
|
|
"ScopInfo"
|
|
|
|
"ScheduleOptimizer"
|
2011-04-29 14:27:02 +08:00
|
|
|
"CodeGen"
|
2011-12-07 19:03:48 +08:00
|
|
|
"Cloog"
|
2011-04-29 14:27:02 +08:00
|
|
|
"OpenMP"
|
2011-08-02 15:22:05 +08:00
|
|
|
"polybench"
|
|
|
|
"vect")
|
2011-04-29 14:27:02 +08:00
|
|
|
|
2011-04-29 15:34:54 +08:00
|
|
|
|
2011-04-29 14:27:02 +08:00
|
|
|
set(POLLY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
|
|
set(POLLY_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
|
2011-11-23 03:40:38 +08:00
|
|
|
set(LLVM_SHLIBEXT "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
2011-04-29 14:27:02 +08:00
|
|
|
|
2011-04-29 15:34:54 +08:00
|
|
|
if (NOT DEFINED LLVM_MAIN_SRC_DIR)
|
|
|
|
# We are building polly out of tree, adjust the settings.
|
|
|
|
# FIXME: FileCheck is not available in llvm install directory at the moment.
|
|
|
|
set(LLVM_LIT ${LLVM_INSTALL_ROOT}/bin/llvm-lit)
|
|
|
|
set(POLLY_TEST_DEPS LLVMPolly)
|
|
|
|
|
|
|
|
set(LLVM_BINARY_DIR "${LLVM_INSTALL_ROOT}")
|
|
|
|
set(LLVM_TOOLS_DIR "${LLVM_INSTALL_ROOT}/bin")
|
|
|
|
set(LLVM_LIBS_DIR "${LLVM_INSTALL_ROOT}/lib")
|
2012-03-16 22:34:20 +08:00
|
|
|
set(POLLY_LIB_DIR "${POLLY_BINARY_DIR}/lib")
|
2011-04-29 15:34:54 +08:00
|
|
|
else (NOT DEFINED LLVM_MAIN_SRC_DIR)
|
|
|
|
set(LLVM_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit)
|
2011-11-29 22:50:47 +08:00
|
|
|
set(POLLY_TEST_DEPS opt lli LLVMPolly FileCheck not)
|
2011-04-29 15:34:54 +08:00
|
|
|
|
|
|
|
set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
|
|
|
|
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/")
|
|
|
|
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib")
|
2012-03-16 22:34:20 +08:00
|
|
|
set(POLLY_LIB_DIR "${LLVM_LIBS_DIR}")
|
2011-04-29 15:34:54 +08:00
|
|
|
endif (NOT DEFINED LLVM_MAIN_SRC_DIR)
|
|
|
|
|
2011-04-29 14:27:02 +08:00
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
|
|
|
|
|
|
|
include(FindPythonInterp)
|
|
|
|
if(PYTHONINTERP_FOUND)
|
2012-03-16 17:04:09 +08:00
|
|
|
option(POLLY_TEST_DISABLE_BAR "Run Polly tests with --no-progress-bar" OFF)
|
2011-04-29 14:27:02 +08:00
|
|
|
set(POLLY_TEST_EXTRA_ARGS)
|
2012-03-16 17:04:09 +08:00
|
|
|
if (MSVC OR XCODE OR POLLY_TEST_DISABLE_BAR)
|
2011-04-29 14:27:02 +08:00
|
|
|
set(POLLY_TEST_EXTRA_ARGS "--no-progress-bar")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(POLLY_TEST_USE_VG "Run Polly tests under Valgrind" OFF)
|
|
|
|
if(POLLY_TEST_USE_VG)
|
|
|
|
set(POLLY_TEST_EXTRA_ARGS ${POLLY_TEST_EXTRA_ARGS} "--vg")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
foreach(testdir ${POLLY_TEST_DIRECTORIES})
|
|
|
|
add_custom_target(polly-test-${testdir}
|
2011-04-29 15:34:54 +08:00
|
|
|
COMMAND ${LLVM_LIT}
|
2011-04-29 14:27:02 +08:00
|
|
|
--param polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
--param build_config=${CMAKE_CFG_INTDIR}
|
|
|
|
-sv ${POLLY_TEST_EXTRA_ARGS}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${testdir}
|
2011-04-29 15:34:54 +08:00
|
|
|
DEPENDS ${POLLY_TEST_DEPS}
|
2011-04-29 14:27:02 +08:00
|
|
|
COMMENT "Running Polly regression tests in ${testdir}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(polly-test
|
2011-04-29 15:34:54 +08:00
|
|
|
COMMAND ${LLVM_LIT}
|
2011-04-29 14:27:02 +08:00
|
|
|
--param polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
--param build_config=${CMAKE_CFG_INTDIR}
|
|
|
|
-sv ${POLLY_TEST_EXTRA_ARGS}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2011-04-29 15:34:54 +08:00
|
|
|
DEPENDS ${POLLY_TEST_DEPS}
|
2011-04-29 14:27:02 +08:00
|
|
|
COMMENT "Running Polly regression tests")
|
|
|
|
endif()
|