diff --git a/libcxx/test/libcxx/algorithms/equal.pass.cpp b/libcxx/test/libcxx/algorithms/equal.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/algorithms/equal.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++03, c++11 + +// + +// check that std::equal can accept iterators with cv-qualified types. + +#include + +template +void f() { + int a[3]{1, 2, 3}; + T1* x = a; + T2* y = a; + (void)std::equal(x, x + 3, y, y + 3); + (void)std::equal(y, y + 3, x, x + 3); +} + +int main(int, char**) { + f(); + f(); + f(); + f(); + f(); + f(); + f(); + return 0; +}