diff options
author | Brad King <brad.king@kitware.com> | 2020-09-21 12:55:21 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-21 08:55:29 -0400 |
commit | c9bc062632c04e199a9a9e0cfc4fb16ccfcdc151 (patch) | |
tree | e1ba76a0360cd58e195b51d52a4b204c1e39ef3b /Tests | |
parent | f332b05666701e956c54518c1ca756252a69aa18 (diff) | |
parent | 0412b55b838fd337dfa510db1b9be3a44f4f7de2 (diff) | |
download | cmake-c9bc062632c04e199a9a9e0cfc4fb16ccfcdc151.tar.gz |
Merge topic 'foreach-int-parse-range-check' into release-3.18
0412b55b83 foreach: Fix crash parsing integer out of range
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5239
Diffstat (limited to 'Tests')
4 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake index 22a0a753d1..d3f7c231c6 100644 --- a/Tests/RunCMake/foreach/RunCMakeTest.cmake +++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake @@ -19,3 +19,4 @@ run_cmake(foreach-RANGE-non-int-test-3-1) run_cmake(foreach-RANGE-non-int-test-3-2) run_cmake(foreach-RANGE-non-int-test-3-3) run_cmake(foreach-RANGE-invalid-test) +run_cmake(foreach-RANGE-out-of-range-test) diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt new file mode 100644 index 0000000000..f05f864d04 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-out-of-range-test\.cmake:[0-9]+ \(foreach\): + foreach Integer out of range: '10000000000000000000' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake new file mode 100644 index 0000000000..3099ca957c --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake @@ -0,0 +1,3 @@ +foreach(a RANGE 10000000000000000000) + break() +endforeach() |