endif()
set(LIBOMP_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
"Compiler to use for testing OpenMP library")
+ set(LIBOMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING
+ "Compiler to use for testing OpenMP library")
set(LIBOMP_TEST_OPENMP_FLAG -fopenmp CACHE STRING
"OpenMP compiler flag to use for testing OpenMP library")
find_program(LIBOMP_LLVM_LIT_EXECUTABLE
# LLVM source tree build, test just-built clang
if(NOT MSVC)
set(LIBOMP_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+ set(LIBOMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
else()
set(LIBOMP_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe)
+ set(LIBOMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe)
endif()
set(LIBOMP_TEST_OPENMP_FLAG -fopenmp=libomp)
set(FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
config.name = 'libomp'
# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c']
+config.suffixes = ['.c', '.cpp']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
config.substitutions.append(("%libomp-compile-and-run", \
"%libomp-compile && %libomp-run"))
+config.substitutions.append(("%libomp-cxx-compile-and-run", \
+ "%libomp-cxx-compile && %libomp-run"))
+config.substitutions.append(("%libomp-cxx-compile", \
+ "%clangXX %cflags -std=c++11 %s -o %t" + libs))
config.substitutions.append(("%libomp-compile", \
"%clang %cflags %s -o %t" + libs))
config.substitutions.append(("%libomp-run", "%t"))
+config.substitutions.append(("%clangXX", config.test_cxx_compiler))
config.substitutions.append(("%clang", config.test_compiler))
config.substitutions.append(("%openmp_flag", config.test_openmp_flag))
config.substitutions.append(("%cflags", config.test_cflags))
@AUTO_GEN_COMMENT@
config.test_compiler = "@LIBOMP_TEST_COMPILER@"
+config.test_cxx_compiler = "@LIBOMP_TEST_CXX_COMPILER@"
config.test_filecheck = "@FILECHECK_EXECUTABLE@"
config.test_openmp_flag = "@LIBOMP_TEST_OPENMP_FLAG@"
config.test_extra_cflags = "@LIBOMP_TEST_CFLAGS@"