From: zoecarver Date: Thu, 13 May 2021 17:09:15 +0000 (-0700) Subject: [pstl] Use logical operator for loop condition in tests X-Git-Tag: llvmorg-14-init~6783 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f607ac6af0e2ee8a7d721d3ba427536deffcd3f;p=platform%2Fupstream%2Fllvm.git [pstl] Use logical operator for loop condition in tests Fix a probable typo in two PSTL tests that causes warnings with GCC. Patch by Jonathan Wakely (jwakely). Reviewed By: zoecarver Differential Revision: https://reviews.llvm.org/D102327 --- diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp index c72d623..1e07a96 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp @@ -81,7 +81,7 @@ test(const std::size_t bits) for (auto r : res) { std::size_t i = r, isub = 0; - for (; i < n1 & isub < n2; ++i, ++isub) + for (; i < n1 && isub < n2; ++i, ++isub) in[i] = sub[isub]; invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, sub.begin(), sub.begin() + n2, std::equal_to()); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp index 3e7868a..d009df91 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp @@ -71,7 +71,7 @@ test() { Sequence in(n1, [](std::size_t) { return T(0); }); std::size_t i = r, isub = 0; - for (; i < n1 & isub < n2; ++i, ++isub) + for (; i < n1 && isub < n2; ++i, ++isub) in[i] = value; invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, n2, value, std::equal_to());