diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-15 18:37:59 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-09-23 16:05:39 (GMT) |
commit | f5c928f73cdb35b4cc0ea052f663071ec590624e (patch) | |
tree | 7c3f2303c04e98a8623232dc4a04395c7702e6e5 /Tests/TryCompile | |
parent | d827fdb6f99e58e4dfc6fdda3816ed2862e00a95 (diff) | |
download | CMake-f5c928f73cdb35b4cc0ea052f663071ec590624e.zip CMake-f5c928f73cdb35b4cc0ea052f663071ec590624e.tar.gz CMake-f5c928f73cdb35b4cc0ea052f663071ec590624e.tar.bz2 |
Add a test to verify '\' handling in CHECK_CXX_SOURCE_COMPILES
Diffstat (limited to 'Tests/TryCompile')
-rw-r--r-- | Tests/TryCompile/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index df921d8..0c6b938 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -283,11 +283,15 @@ TEST_ASSERT(C_RUN_SHOULD_WORK "CHECK_C_SOURCE_RUNS() failed") CHECK_CXX_SOURCE_COMPILES("I don't build" CXX_BUILD_SHOULD_FAIL) CHECK_CXX_SOURCE_COMPILES("int main() {return 0;}" CXX_BUILD_SHOULD_WORK) +CHECK_CXX_SOURCE_COMPILES("void l(char const (&x)[2]){}; int main() { l(\"\\\\n\"); return 0;}" + CXX_BUILD_SHOULD_WORK_COMPLEX) + CHECK_CXX_SOURCE_RUNS("int main() {return 2;}" CXX_RUN_SHOULD_FAIL) CHECK_CXX_SOURCE_RUNS("int main() {return 0;}" CXX_RUN_SHOULD_WORK) TEST_FAIL(CXX_BUILD_SHOULD_FAIL "CHECK_CXX_SOURCE_COMPILES() succeeded, but should have failed") TEST_ASSERT(CXX_BUILD_SHOULD_WORK "CHECK_CXX_SOURCE_COMPILES() failed") +TEST_ASSERT(CXX_BUILD_SHOULD_WORK_COMPLEX "CHECK_CXX_SOURCE_COMPILES() failed") TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should have failed") TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed") |