[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / algorithms / robust_against_adl_on_new.pass.cpp
blob333f11deed24ea53a63e5d0898b769152b9f8e81
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <algorithm>
13 #include <algorithm>
15 #include "test_macros.h"
17 struct A {
18 int i;
19 A(int v) : i(v) {}
20 bool operator<(const A& rhs) const { return i < rhs.i; }
21 static bool isEven(const A& a) { return a.i % 2 == 0; }
24 void *operator new(size_t, A*) = delete;
26 int main(int, char**)
28 A a[4] = { 1,2,3,4 };
29 std::sort(a, a+4);
30 std::partition(a, a+4, A::isEven);
31 std::stable_sort(a, a+4);
32 std::stable_partition(a, a+4, A::isEven);
34 return 0;