diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp index 5f594400e8321..574e96dea46a0 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp @@ -173,6 +173,7 @@ constexpr bool test() { auto end = adl::Iterator::TrackSwaps(in.data() + in.size(), swaps); for (std::size_t mid = 0; mid != input.size(); ++mid) { + swaps = 0; std::ranges::rotate(begin, begin + mid, end); assert(swaps <= expected); } @@ -186,6 +187,7 @@ constexpr bool test() { auto range = std::ranges::subrange(begin, end); for (std::size_t mid = 0; mid != input.size(); ++mid) { + swaps = 0; std::ranges::rotate(range, begin + mid); assert(swaps <= expected); }