1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
18 #include "test_macros.h"
19 #include "min_allocator.h"
25 typedef std::set
<int> M
;
32 assert(m1
== m2_save
);
33 assert(m2
== m1_save
);
48 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
52 assert(m1
== m2_save
);
53 assert(m2
== m1_save
);
63 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
68 assert(m1
== m2_save
);
69 assert(m2
== m1_save
);
90 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
91 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
95 assert(m1
== m2_save
);
96 assert(m2
== m1_save
);
99 #if TEST_STD_VER >= 11
102 typedef std::set
<int, std::less
<int>, min_allocator
<int>> M
;
109 assert(m1
== m2_save
);
110 assert(m2
== m1_save
);
125 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
129 assert(m1
== m2_save
);
130 assert(m2
== m1_save
);
140 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
145 assert(m1
== m2_save
);
146 assert(m2
== m1_save
);
167 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
168 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
172 assert(m1
== m2_save
);
173 assert(m2
== m1_save
);