diff options
author | 2021-02-24 18:47:45 +0300 | |
---|---|---|
committer | 2021-02-25 09:59:30 +0300 | |
commit | 7508eb7c287d9f8a54175d304bd9775620f19cc3 (patch) | |
tree | f82a7cbb89e359aa4d0128c4db4df05ee16b974f | |
parent | Fix segmentation fault in the global scan functor (#139) (diff) | |
download | llvm-project-7508eb7c287d9f8a54175d304bd9775620f19cc3.tar.gz llvm-project-7508eb7c287d9f8a54175d304bd9775620f19cc3.tar.bz2 llvm-project-7508eb7c287d9f8a54175d304bd9775620f19cc3.zip |
Turn off strict aliasing optimization if used (#137)
* Turn off strict aliasing optimization when use icpc on Linux
* Fix usage of CMAKE_CXX_COMPILER and CMAKE_BUILD_TYPE variables
* Make changes affect only tests
* Get rid of nested if condition
-rw-r--r-- | test/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 42cb57efcee1..c9faa4894052 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,6 +30,13 @@ macro(onedpl_add_test test_source_file) if (MSVC) target_compile_options(${_test_name} PRIVATE /bigobj) endif() + + # oneDPL test harness may initialize a C++ iterator using iterator with different type + # that may break code when using Intel(R) C++ Compiler Classic with -O3 flag on Linux + if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_CXX_COMPILER_ID STREQUAL Intel) + target_compile_options(${_test_name} PRIVATE $<$<CONFIG:Release>:-fno-strict-aliasing>) + endif() + target_include_directories(${_test_name} PRIVATE "${CMAKE_CURRENT_LIST_DIR}") target_link_libraries(${_test_name} PRIVATE oneDPL) set_target_properties(${_test_name} PROPERTIES CXX_EXTENSIONS NO) |