[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/algorithms/is_permutation_pred.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/algorithms/is_permutation_pred.pass.cpp:19: [ 0:01] In file included from /dios/libcxx/include/algorithm:639: [ 0:01] In file included from /dios/libcxx/include/initializer_list:46: [ 0:01] In file included from /dios/libcxx/include/cstddef:44: [ 0:01] In file included from /dios/include/stddef.h:10: [ 0:01] In file included from /dios/include/_PDCLIB/int.h:16: [ 0:01] /dios/include/_PDCLIB/cdefs.h:69:10: warning: Unsupported _ _cplusplus (__cplusplus) (too new) (supported: ISO/IEC 14882:1997, ISO/IEC 14882:2011). [ 0:01] #warning Unsupported _ _cplusplus (__cplusplus) (too new) (supported: ISO/IEC 14882:1997, ISO/IEC 14882:2011). [ 0:01] ^ [ 0:01] 1 warning generated. [ 0:01] compiling /dios/lib/config/seqklee.bc [ 0:01] setting up pass: functionmeta, options = [ 0:02] setting up pass: fuse-ctors, options = [ 0:02] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.4/_klee_out" [ 0:04] KLEE: Using Z3 solver backend [ 0:04] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:04] warning: Linking two modules of different target triples: klee_div_zero_check.bc' is 'x86_64-unknown-linux-gnu' whereas 'klee.bc' is 'x86_64-unknown-none-elf' [ 0:04] [ 0:04] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:07] KLEE: WARNING: undefined reference to function: klee_free [ 0:07] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:07] i:1 [ 0:07] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:07] about to __boot:0 [ 0:07] about to run the scheduler:0 [ 0:07] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:07] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:07] KLEE: NOTE: now ignoring this error at this location [ 0:07] KLEE: ERROR: EXITING ON ERROR: [ 0:07] Error: failed external call: __dios_tainted_init [ 0:07] File: /dios/libc/sys/start.cpp [ 0:07] Line: 87 [ 0:07] assembly.ll line: 36643 [ 0:07] Stack: [ 0:07] #000036643 in __dios_start (l=2, argc=1, argv=94555095282184, envp=94555095351304) at /dios/libc/sys/start.cpp:87 [ 0:07] #100012652 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:07] #200044891 in klee_boot (argc=2, argv=94555069053696) at /dios/arch/klee/boot.c:41 [ 0:07] [ 0:07] [ 0:07] 1 /* TAGS: c++ fin */ [ 0:07] 2 /* CC_OPTS: -std=c++2a */ [ 0:07] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:07] 4 //===----------------------------------------------------------------------===// [ 0:07] 5 // [ 0:07] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:07] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:07] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:07] 9 // [ 0:07] 10 //===----------------------------------------------------------------------===// [ 0:07] 11 [ 0:07] 12 // [ 0:07] 13 [ 0:07] 14 // template [ 0:07] 15 // constexpr bool // constexpr after C++17 [ 0:07] 16 // is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, [ 0:07] 17 // ForwardIterator2 first2, BinaryPredicate pred); [ 0:07] 18 [ 0:07] 19 #include [ 0:07] 20 #include [ 0:07] 21 #include [ 0:07] 22 [ 0:07] 23 #include "test_macros.h" [ 0:07] 24 #include "test_iterators.h" [ 0:07] 25 [ 0:07] 26 int comparison_count = 0; [ 0:07] 27 template [ 0:07] 28 bool counting_equals ( const T &a, const T &b ) { [ 0:07] 29 ++comparison_count; [ 0:07] 30 return a == b; [ 0:07] 31 } [ 0:07] 32 [ 0:07] 33 #if TEST_STD_VER > 17 [ 0:07] 34 constexpr bool test_constexpr() { [ 0:07] 35 int ia[] = {0, 0, 0}; [ 0:07] 36 int ib[] = {1, 1, 0}; [ 0:07] 37 int ic[] = {1, 0, 1}; [ 0:07] 38 int id[] = {1}; [ 0:07] 39 std::equal_to c{}; [ 0:07] 40 return !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib) , c) [ 0:07] 41 && !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), c) [ 0:07] 42 && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic) , c) [ 0:07] 43 && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), c) [ 0:07] 44 && !std::is_permutation(std::begin(ic), std::end(ic), std::begin(id), std::end(id), c) [ 0:07] 45 ; [ 0:07] 46 } [ 0:07] 47 #endif [ 0:07] 48 [ 0:07] 49 [ 0:07] 50 struct S { [ 0:07] 51 S(int i) : i_(i) {} [ 0:07] 52 bool operator==(const S& other) = delete; [ 0:07] 53 int i_; [ 0:07] 54 }; [ 0:07] 55 [ 0:07] 56 struct eq { [ 0:07] 57 bool operator()(const S& a, const S&b) { return a.i_ == b.i_; } [ 0:07] 58 }; [ 0:07] 59 [ 0:07] 60 [ 0:07] 61 int main(int, char**) [ 0:07] 62 { [ 0:07] 63 { [ 0:07] 64 const int ia[] = {0}; [ 0:07] 65 const int ib[] = {0}; [ 0:07] 66 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 67 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 68 forward_iterator(ia + 0), [ 0:07] 69 forward_iterator(ib), [ 0:07] 70 std::equal_to()) == true); [ 0:07] 71 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 72 forward_iterator(ia + sa), [ 0:07] 73 forward_iterator(ib), [ 0:07] 74 std::equal_to()) == true); [ 0:07] 75 #if TEST_STD_VER >= 14 [ 0:07] 76 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 77 forward_iterator(ia + sa), [ 0:07] 78 forward_iterator(ib), [ 0:07] 79 forward_iterator(ib + sa), [ 0:07] 80 std::equal_to()) == true); [ 0:07] 81 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 82 forward_iterator(ia + sa), [ 0:07] 83 forward_iterator(ib), [ 0:07] 84 forward_iterator(ib + sa - 1), [ 0:07] 85 std::equal_to()) == false); [ 0:07] 86 #endif [ 0:07] 87 } [ 0:07] 88 { [ 0:07] 89 const int ia[] = {0}; [ 0:07] 90 const int ib[] = {1}; [ 0:07] 91 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 92 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 93 forward_iterator(ia + sa), [ 0:07] 94 forward_iterator(ib), [ 0:07] 95 std::equal_to()) == false); [ 0:07] 96 #if TEST_STD_VER >= 14 [ 0:07] 97 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 98 forward_iterator(ia + sa), [ 0:07] 99 forward_iterator(ib), [ 0:07] 100 forward_iterator(ib + sa), [ 0:07] 101 std::equal_to()) == false); [ 0:07] 102 #endif [ 0:07] 103 } [ 0:07] 104 [ 0:07] 105 { [ 0:07] 106 const int ia[] = {0, 0}; [ 0:07] 107 const int ib[] = {0, 0}; [ 0:07] 108 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 109 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 110 forward_iterator(ia + sa), [ 0:07] 111 forward_iterator(ib), [ 0:07] 112 std::equal_to()) == true); [ 0:07] 113 #if TEST_STD_VER >= 14 [ 0:07] 114 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 115 forward_iterator(ia + sa), [ 0:07] 116 forward_iterator(ib), [ 0:07] 117 forward_iterator(ib + sa), [ 0:07] 118 std::equal_to()) == true); [ 0:07] 119 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 120 forward_iterator(ia + sa), [ 0:07] 121 forward_iterator(ib), [ 0:07] 122 forward_iterator(ib + sa - 1), [ 0:07] 123 std::equal_to()) == false); [ 0:07] 124 #endif [ 0:07] 125 } [ 0:07] 126 { [ 0:07] 127 const int ia[] = {0, 0}; [ 0:07] 128 const int ib[] = {0, 1}; [ 0:07] 129 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 130 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 131 forward_iterator(ia + sa), [ 0:07] 132 forward_iterator(ib), [ 0:07] 133 std::equal_to()) == false); [ 0:07] 134 #if TEST_STD_VER >= 14 [ 0:07] 135 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 136 forward_iterator(ia + sa), [ 0:07] 137 forward_iterator(ib), [ 0:07] 138 forward_iterator(ib + sa), [ 0:07] 139 std::equal_to()) == false); [ 0:07] 140 #endif [ 0:07] 141 } [ 0:07] 142 { [ 0:07] 143 const int ia[] = {0, 0}; [ 0:07] 144 const int ib[] = {1, 0}; [ 0:07] 145 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 146 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 147 forward_iterator(ia + sa), [ 0:07] 148 forward_iterator(ib), [ 0:07] 149 std::equal_to()) == false); [ 0:07] 150 #if TEST_STD_VER >= 14 [ 0:07] 151 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 152 forward_iterator(ia + sa), [ 0:07] 153 forward_iterator(ib), [ 0:07] 154 forward_iterator(ib + sa), [ 0:07] 155 std::equal_to()) == false); [ 0:07] 156 #endif [ 0:07] 157 } [ 0:07] 158 { [ 0:07] 159 const int ia[] = {0, 0}; [ 0:07] 160 const int ib[] = {1, 1}; [ 0:07] 161 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 162 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 163 forward_iterator(ia + sa), [ 0:07] 164 forward_iterator(ib), [ 0:07] 165 std::equal_to()) == false); [ 0:07] 166 #if TEST_STD_VER >= 14 [ 0:07] 167 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 168 forward_iterator(ia + sa), [ 0:07] 169 forward_iterator(ib), [ 0:07] 170 forward_iterator(ib + sa), [ 0:07] 171 std::equal_to()) == false); [ 0:07] 172 #endif [ 0:07] 173 } [ 0:07] 174 { [ 0:07] 175 const int ia[] = {0, 1}; [ 0:07] 176 const int ib[] = {0, 0}; [ 0:07] 177 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 178 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 179 forward_iterator(ia + sa), [ 0:07] 180 forward_iterator(ib), [ 0:07] 181 std::equal_to()) == false); [ 0:07] 182 #if TEST_STD_VER >= 14 [ 0:07] 183 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 184 forward_iterator(ia + sa), [ 0:07] 185 forward_iterator(ib), [ 0:07] 186 forward_iterator(ib + sa), [ 0:07] 187 std::equal_to()) == false); [ 0:07] 188 #endif [ 0:07] 189 } [ 0:07] 190 { [ 0:07] 191 const int ia[] = {0, 1}; [ 0:07] 192 const int ib[] = {0, 1}; [ 0:07] 193 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 194 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 195 forward_iterator(ia + sa), [ 0:07] 196 forward_iterator(ib), [ 0:07] 197 std::equal_to()) == true); [ 0:07] 198 #if TEST_STD_VER >= 14 [ 0:07] 199 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 200 forward_iterator(ia + sa), [ 0:07] 201 forward_iterator(ib), [ 0:07] 202 forward_iterator(ib + sa), [ 0:07] 203 std::equal_to()) == true); [ 0:07] 204 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 205 forward_iterator(ia + sa), [ 0:07] 206 forward_iterator(ib), [ 0:07] 207 forward_iterator(ib + sa - 1), [ 0:07] 208 std::equal_to()) == false); [ 0:07] 209 #endif [ 0:07] 210 } [ 0:07] 211 { [ 0:07] 212 const int ia[] = {0, 1}; [ 0:07] 213 const int ib[] = {1, 0}; [ 0:07] 214 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 215 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 216 forward_iterator(ia + sa), [ 0:07] 217 forward_iterator(ib), [ 0:07] 218 std::equal_to()) == true); [ 0:07] 219 #if TEST_STD_VER >= 14 [ 0:07] 220 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 221 forward_iterator(ia + sa), [ 0:07] 222 forward_iterator(ib), [ 0:07] 223 forward_iterator(ib + sa), [ 0:07] 224 std::equal_to()) == true); [ 0:07] 225 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 226 forward_iterator(ia + sa), [ 0:07] 227 forward_iterator(ib), [ 0:07] 228 forward_iterator(ib + sa - 1), [ 0:07] 229 std::equal_to()) == false); [ 0:07] 230 #endif [ 0:07] 231 } [ 0:07] 232 { [ 0:07] 233 const int ia[] = {0, 1}; [ 0:07] 234 const int ib[] = {1, 1}; [ 0:07] 235 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 236 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 237 forward_iterator(ia + sa), [ 0:07] 238 forward_iterator(ib), [ 0:07] 239 std::equal_to()) == false); [ 0:07] 240 #if TEST_STD_VER >= 14 [ 0:07] 241 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 242 forward_iterator(ia + sa), [ 0:07] 243 forward_iterator(ib), [ 0:07] 244 forward_iterator(ib + sa), [ 0:07] 245 std::equal_to()) == false); [ 0:07] 246 #endif [ 0:07] 247 } [ 0:07] 248 { [ 0:07] 249 const int ia[] = {1, 0}; [ 0:07] 250 const int ib[] = {0, 0}; [ 0:07] 251 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 252 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 253 forward_iterator(ia + sa), [ 0:07] 254 forward_iterator(ib), [ 0:07] 255 std::equal_to()) == false); [ 0:07] 256 #if TEST_STD_VER >= 14 [ 0:07] 257 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 258 forward_iterator(ia + sa), [ 0:07] 259 forward_iterator(ib), [ 0:07] 260 forward_iterator(ib + sa), [ 0:07] 261 std::equal_to()) == false); [ 0:07] 262 #endif [ 0:07] 263 } [ 0:07] 264 { [ 0:07] 265 const int ia[] = {1, 0}; [ 0:07] 266 const int ib[] = {0, 1}; [ 0:07] 267 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 268 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 269 forward_iterator(ia + sa), [ 0:07] 270 forward_iterator(ib), [ 0:07] 271 std::equal_to()) == true); [ 0:07] 272 #if TEST_STD_VER >= 14 [ 0:07] 273 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 274 forward_iterator(ia + sa), [ 0:07] 275 forward_iterator(ib), [ 0:07] 276 forward_iterator(ib + sa), [ 0:07] 277 std::equal_to()) == true); [ 0:07] 278 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 279 forward_iterator(ia + sa), [ 0:07] 280 forward_iterator(ib), [ 0:07] 281 forward_iterator(ib + sa - 1), [ 0:07] 282 std::equal_to()) == false); [ 0:07] 283 #endif [ 0:07] 284 } [ 0:07] 285 { [ 0:07] 286 const int ia[] = {1, 0}; [ 0:07] 287 const int ib[] = {1, 0}; [ 0:07] 288 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 289 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 290 forward_iterator(ia + sa), [ 0:07] 291 forward_iterator(ib), [ 0:07] 292 std::equal_to()) == true); [ 0:07] 293 #if TEST_STD_VER >= 14 [ 0:07] 294 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 295 forward_iterator(ia + sa), [ 0:07] 296 forward_iterator(ib), [ 0:07] 297 forward_iterator(ib + sa), [ 0:07] 298 std::equal_to()) == true); [ 0:07] 299 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 300 forward_iterator(ia + sa), [ 0:07] 301 forward_iterator(ib), [ 0:07] 302 forward_iterator(ib + sa - 1), [ 0:07] 303 std::equal_to()) == false); [ 0:07] 304 #endif [ 0:07] 305 } [ 0:07] 306 { [ 0:07] 307 const int ia[] = {1, 0}; [ 0:07] 308 const int ib[] = {1, 1}; [ 0:07] 309 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 310 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 311 forward_iterator(ia + sa), [ 0:07] 312 forward_iterator(ib), [ 0:07] 313 std::equal_to()) == false); [ 0:07] 314 #if TEST_STD_VER >= 14 [ 0:07] 315 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 316 forward_iterator(ia + sa), [ 0:07] 317 forward_iterator(ib), [ 0:07] 318 forward_iterator(ib + sa), [ 0:07] 319 std::equal_to()) == false); [ 0:07] 320 #endif [ 0:07] 321 } [ 0:07] 322 { [ 0:07] 323 const int ia[] = {1, 1}; [ 0:07] 324 const int ib[] = {0, 0}; [ 0:07] 325 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 326 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 327 forward_iterator(ia + sa), [ 0:07] 328 forward_iterator(ib), [ 0:07] 329 std::equal_to()) == false); [ 0:07] 330 #if TEST_STD_VER >= 14 [ 0:07] 331 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 332 forward_iterator(ia + sa), [ 0:07] 333 forward_iterator(ib), [ 0:07] 334 forward_iterator(ib + sa), [ 0:07] 335 std::equal_to()) == false); [ 0:07] 336 #endif [ 0:07] 337 } [ 0:07] 338 { [ 0:07] 339 const int ia[] = {1, 1}; [ 0:07] 340 const int ib[] = {0, 1}; [ 0:07] 341 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 342 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 343 forward_iterator(ia + sa), [ 0:07] 344 forward_iterator(ib), [ 0:07] 345 std::equal_to()) == false); [ 0:07] 346 #if TEST_STD_VER >= 14 [ 0:07] 347 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 348 forward_iterator(ia + sa), [ 0:07] 349 forward_iterator(ib), [ 0:07] 350 forward_iterator(ib + sa), [ 0:07] 351 std::equal_to()) == false); [ 0:07] 352 #endif [ 0:07] 353 } [ 0:07] 354 { [ 0:07] 355 const int ia[] = {1, 1}; [ 0:07] 356 const int ib[] = {1, 0}; [ 0:07] 357 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 358 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 359 forward_iterator(ia + sa), [ 0:07] 360 forward_iterator(ib), [ 0:07] 361 std::equal_to()) == false); [ 0:07] 362 #if TEST_STD_VER >= 14 [ 0:07] 363 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 364 forward_iterator(ia + sa), [ 0:07] 365 forward_iterator(ib), [ 0:07] 366 forward_iterator(ib + sa), [ 0:07] 367 std::equal_to()) == false); [ 0:07] 368 #endif [ 0:07] 369 } [ 0:07] 370 { [ 0:07] 371 const int ia[] = {1, 1}; [ 0:07] 372 const int ib[] = {1, 1}; [ 0:07] 373 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 374 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 375 forward_iterator(ia + sa), [ 0:07] 376 forward_iterator(ib), [ 0:07] 377 std::equal_to()) == true); [ 0:07] 378 #if TEST_STD_VER >= 14 [ 0:07] 379 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 380 forward_iterator(ia + sa), [ 0:07] 381 forward_iterator(ib), [ 0:07] 382 forward_iterator(ib + sa), [ 0:07] 383 std::equal_to()) == true); [ 0:07] 384 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 385 forward_iterator(ia + sa), [ 0:07] 386 forward_iterator(ib), [ 0:07] 387 forward_iterator(ib + sa - 1), [ 0:07] 388 std::equal_to()) == false); [ 0:07] 389 #endif [ 0:07] 390 } [ 0:07] 391 [ 0:07] 392 { [ 0:07] 393 const int ia[] = {0, 0, 0}; [ 0:07] 394 const int ib[] = {1, 0, 0}; [ 0:07] 395 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 396 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 397 forward_iterator(ia + sa), [ 0:07] 398 forward_iterator(ib), [ 0:07] 399 std::equal_to()) == false); [ 0:07] 400 #if TEST_STD_VER >= 14 [ 0:07] 401 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 402 forward_iterator(ia + sa), [ 0:07] 403 forward_iterator(ib), [ 0:07] 404 forward_iterator(ib + sa), [ 0:07] 405 std::equal_to()) == false); [ 0:07] 406 #endif [ 0:07] 407 } [ 0:07] 408 { [ 0:07] 409 const int ia[] = {0, 0, 0}; [ 0:07] 410 const int ib[] = {1, 0, 1}; [ 0:07] 411 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 412 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 413 forward_iterator(ia + sa), [ 0:07] 414 forward_iterator(ib), [ 0:07] 415 std::equal_to()) == false); [ 0:07] 416 #if TEST_STD_VER >= 14 [ 0:07] 417 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 418 forward_iterator(ia + sa), [ 0:07] 419 forward_iterator(ib), [ 0:07] 420 forward_iterator(ib + sa), [ 0:07] 421 std::equal_to()) == false); [ 0:07] 422 #endif [ 0:07] 423 } [ 0:07] 424 { [ 0:07] 425 const int ia[] = {0, 0, 0}; [ 0:07] 426 const int ib[] = {1, 0, 2}; [ 0:07] 427 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 428 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 429 forward_iterator(ia + sa), [ 0:07] 430 forward_iterator(ib), [ 0:07] 431 std::equal_to()) == false); [ 0:07] 432 #if TEST_STD_VER >= 14 [ 0:07] 433 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 434 forward_iterator(ia + sa), [ 0:07] 435 forward_iterator(ib), [ 0:07] 436 forward_iterator(ib + sa), [ 0:07] 437 std::equal_to()) == false); [ 0:07] 438 #endif [ 0:07] 439 } [ 0:07] 440 { [ 0:07] 441 const int ia[] = {0, 0, 0}; [ 0:07] 442 const int ib[] = {1, 1, 0}; [ 0:07] 443 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 444 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 445 forward_iterator(ia + sa), [ 0:07] 446 forward_iterator(ib), [ 0:07] 447 std::equal_to()) == false); [ 0:07] 448 #if TEST_STD_VER >= 14 [ 0:07] 449 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 450 forward_iterator(ia + sa), [ 0:07] 451 forward_iterator(ib), [ 0:07] 452 forward_iterator(ib + sa), [ 0:07] 453 std::equal_to()) == false); [ 0:07] 454 #endif [ 0:07] 455 } [ 0:07] 456 { [ 0:07] 457 const int ia[] = {0, 0, 0}; [ 0:07] 458 const int ib[] = {1, 1, 1}; [ 0:07] 459 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 460 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 461 forward_iterator(ia + sa), [ 0:07] 462 forward_iterator(ib), [ 0:07] 463 std::equal_to()) == false); [ 0:07] 464 #if TEST_STD_VER >= 14 [ 0:07] 465 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 466 forward_iterator(ia + sa), [ 0:07] 467 forward_iterator(ib), [ 0:07] 468 forward_iterator(ib + sa), [ 0:07] 469 std::equal_to()) == false); [ 0:07] 470 #endif [ 0:07] 471 } [ 0:07] 472 { [ 0:07] 473 const int ia[] = {0, 0, 0}; [ 0:07] 474 const int ib[] = {1, 1, 2}; [ 0:07] 475 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 476 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 477 forward_iterator(ia + sa), [ 0:07] 478 forward_iterator(ib), [ 0:07] 479 std::equal_to()) == false); [ 0:07] 480 #if TEST_STD_VER >= 14 [ 0:07] 481 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 482 forward_iterator(ia + sa), [ 0:07] 483 forward_iterator(ib), [ 0:07] 484 forward_iterator(ib + sa), [ 0:07] 485 std::equal_to()) == false); [ 0:07] 486 #endif [ 0:07] 487 } [ 0:07] 488 { [ 0:07] 489 const int ia[] = {0, 0, 0}; [ 0:07] 490 const int ib[] = {1, 2, 0}; [ 0:07] 491 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 492 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 493 forward_iterator(ia + sa), [ 0:07] 494 forward_iterator(ib), [ 0:07] 495 std::equal_to()) == false); [ 0:07] 496 #if TEST_STD_VER >= 14 [ 0:07] 497 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 498 forward_iterator(ia + sa), [ 0:07] 499 forward_iterator(ib), [ 0:07] 500 forward_iterator(ib + sa), [ 0:07] 501 std::equal_to()) == false); [ 0:07] 502 #endif [ 0:07] 503 } [ 0:07] 504 { [ 0:07] 505 const int ia[] = {0, 0, 0}; [ 0:07] 506 const int ib[] = {1, 2, 1}; [ 0:07] 507 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 508 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 509 forward_iterator(ia + sa), [ 0:07] 510 forward_iterator(ib), [ 0:07] 511 std::equal_to()) == false); [ 0:07] 512 #if TEST_STD_VER >= 14 [ 0:07] 513 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 514 forward_iterator(ia + sa), [ 0:07] 515 forward_iterator(ib), [ 0:07] 516 forward_iterator(ib + sa), [ 0:07] 517 std::equal_to()) == false); [ 0:07] 518 #endif [ 0:07] 519 } [ 0:07] 520 { [ 0:07] 521 const int ia[] = {0, 0, 0}; [ 0:07] 522 const int ib[] = {1, 2, 2}; [ 0:07] 523 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 524 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 525 forward_iterator(ia + sa), [ 0:07] 526 forward_iterator(ib), [ 0:07] 527 std::equal_to()) == false); [ 0:07] 528 #if TEST_STD_VER >= 14 [ 0:07] 529 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 530 forward_iterator(ia + sa), [ 0:07] 531 forward_iterator(ib), [ 0:07] 532 forward_iterator(ib + sa), [ 0:07] 533 std::equal_to()) == false); [ 0:07] 534 #endif [ 0:07] 535 } [ 0:07] 536 { [ 0:07] 537 const int ia[] = {0, 0, 1}; [ 0:07] 538 const int ib[] = {1, 0, 0}; [ 0:07] 539 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 540 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 541 forward_iterator(ia + sa), [ 0:07] 542 forward_iterator(ib), [ 0:07] 543 std::equal_to()) == true); [ 0:07] 544 #if TEST_STD_VER >= 14 [ 0:07] 545 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 546 forward_iterator(ia + sa), [ 0:07] 547 forward_iterator(ib), [ 0:07] 548 forward_iterator(ib + sa), [ 0:07] 549 std::equal_to()) == true); [ 0:07] 550 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 551 forward_iterator(ia + sa), [ 0:07] 552 forward_iterator(ib), [ 0:07] 553 forward_iterator(ib + sa - 1), [ 0:07] 554 std::equal_to()) == false); [ 0:07] 555 #endif [ 0:07] 556 } [ 0:07] 557 { [ 0:07] 558 const int ia[] = {0, 0, 1}; [ 0:07] 559 const int ib[] = {1, 0, 1}; [ 0:07] 560 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 561 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 562 forward_iterator(ia + sa), [ 0:07] 563 forward_iterator(ib), [ 0:07] 564 std::equal_to()) == false); [ 0:07] 565 #if TEST_STD_VER >= 14 [ 0:07] 566 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 567 forward_iterator(ia + sa), [ 0:07] 568 forward_iterator(ib), [ 0:07] 569 forward_iterator(ib + sa), [ 0:07] 570 std::equal_to()) == false); [ 0:07] 571 #endif [ 0:07] 572 } [ 0:07] 573 { [ 0:07] 574 const int ia[] = {0, 1, 2}; [ 0:07] 575 const int ib[] = {1, 0, 2}; [ 0:07] 576 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 577 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 578 forward_iterator(ia + sa), [ 0:07] 579 forward_iterator(ib), [ 0:07] 580 std::equal_to()) == true); [ 0:07] 581 #if TEST_STD_VER >= 14 [ 0:07] 582 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 583 forward_iterator(ia + sa), [ 0:07] 584 forward_iterator(ib), [ 0:07] 585 forward_iterator(ib + sa), [ 0:07] 586 std::equal_to()) == true); [ 0:07] 587 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 588 forward_iterator(ia + sa), [ 0:07] 589 forward_iterator(ib), [ 0:07] 590 forward_iterator(ib + sa - 1), [ 0:07] 591 std::equal_to()) == false); [ 0:07] 592 #endif [ 0:07] 593 } [ 0:07] 594 { [ 0:07] 595 const int ia[] = {0, 1, 2}; [ 0:07] 596 const int ib[] = {1, 2, 0}; [ 0:07] 597 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 598 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 599 forward_iterator(ia + sa), [ 0:07] 600 forward_iterator(ib), [ 0:07] 601 std::equal_to()) == true); [ 0:07] 602 #if TEST_STD_VER >= 14 [ 0:07] 603 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 604 forward_iterator(ia + sa), [ 0:07] 605 forward_iterator(ib), [ 0:07] 606 forward_iterator(ib + sa), [ 0:07] 607 std::equal_to()) == true); [ 0:07] 608 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 609 forward_iterator(ia + sa), [ 0:07] 610 forward_iterator(ib), [ 0:07] 611 forward_iterator(ib + sa - 1), [ 0:07] 612 std::equal_to()) == false); [ 0:07] 613 #endif [ 0:07] 614 } [ 0:07] 615 { [ 0:07] 616 const int ia[] = {0, 1, 2}; [ 0:07] 617 const int ib[] = {2, 1, 0}; [ 0:07] 618 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 619 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 620 forward_iterator(ia + sa), [ 0:07] 621 forward_iterator(ib), [ 0:07] 622 std::equal_to()) == true); [ 0:07] 623 #if TEST_STD_VER >= 14 [ 0:07] 624 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 625 forward_iterator(ia + sa), [ 0:07] 626 forward_iterator(ib), [ 0:07] 627 forward_iterator(ib + sa), [ 0:07] 628 std::equal_to()) == true); [ 0:07] 629 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 630 forward_iterator(ia + sa), [ 0:07] 631 forward_iterator(ib), [ 0:07] 632 forward_iterator(ib + sa - 1), [ 0:07] 633 std::equal_to()) == false); [ 0:07] 634 #endif [ 0:07] 635 } [ 0:07] 636 { [ 0:07] 637 const int ia[] = {0, 1, 2}; [ 0:07] 638 const int ib[] = {2, 0, 1}; [ 0:07] 639 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 640 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 641 forward_iterator(ia + sa), [ 0:07] 642 forward_iterator(ib), [ 0:07] 643 std::equal_to()) == true); [ 0:07] 644 #if TEST_STD_VER >= 14 [ 0:07] 645 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 646 forward_iterator(ia + sa), [ 0:07] 647 forward_iterator(ib), [ 0:07] 648 forward_iterator(ib + sa), [ 0:07] 649 std::equal_to()) == true); [ 0:07] 650 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 651 forward_iterator(ia + sa), [ 0:07] 652 forward_iterator(ib), [ 0:07] 653 forward_iterator(ib + sa - 1), [ 0:07] 654 std::equal_to()) == false); [ 0:07] 655 #endif [ 0:07] 656 } [ 0:07] 657 { [ 0:07] 658 const int ia[] = {0, 0, 1}; [ 0:07] 659 const int ib[] = {1, 0, 1}; [ 0:07] 660 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 661 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 662 forward_iterator(ia + sa), [ 0:07] 663 forward_iterator(ib), [ 0:07] 664 std::equal_to()) == false); [ 0:07] 665 #if TEST_STD_VER >= 14 [ 0:07] 666 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 667 forward_iterator(ia + sa), [ 0:07] 668 forward_iterator(ib), [ 0:07] 669 forward_iterator(ib + sa), [ 0:07] 670 std::equal_to()) == false); [ 0:07] 671 #endif [ 0:07] 672 } [ 0:07] 673 { [ 0:07] 674 const int ia[] = {0, 0, 1}; [ 0:07] 675 const int ib[] = {1, 0, 0}; [ 0:07] 676 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 677 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 678 forward_iterator(ia + sa), [ 0:07] 679 forward_iterator(ib), [ 0:07] 680 std::equal_to()) == true); [ 0:07] 681 #if TEST_STD_VER >= 14 [ 0:07] 682 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 683 forward_iterator(ia + sa), [ 0:07] 684 forward_iterator(ib), [ 0:07] 685 forward_iterator(ib + sa), [ 0:07] 686 std::equal_to()) == true); [ 0:07] 687 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 688 forward_iterator(ia + sa), [ 0:07] 689 forward_iterator(ib + 1), [ 0:07] 690 forward_iterator(ib + sa), [ 0:07] 691 std::equal_to()) == false); [ 0:07] 692 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 693 forward_iterator(ia + sa), [ 0:07] 694 forward_iterator(ib), [ 0:07] 695 forward_iterator(ib + sa - 1), [ 0:07] 696 std::equal_to()) == false); [ 0:07] 697 #endif [ 0:07] 698 } [ 0:07] 699 { [ 0:07] 700 const int ia[] = {0, 1, 2, 3, 0, 5, 6, 2, 4, 4}; [ 0:07] 701 const int ib[] = {4, 2, 3, 0, 1, 4, 0, 5, 6, 2}; [ 0:07] 702 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 703 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 704 forward_iterator(ia + sa), [ 0:07] 705 forward_iterator(ib), [ 0:07] 706 std::equal_to()) == true); [ 0:07] 707 #if TEST_STD_VER >= 14 [ 0:07] 708 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 709 forward_iterator(ia + sa), [ 0:07] 710 forward_iterator(ib), [ 0:07] 711 forward_iterator(ib + sa), [ 0:07] 712 std::equal_to()) == true); [ 0:07] 713 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 714 forward_iterator(ia + sa), [ 0:07] 715 forward_iterator(ib + 1), [ 0:07] 716 forward_iterator(ib + sa), [ 0:07] 717 std::equal_to()) == false); [ 0:07] 718 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 719 forward_iterator(ia + sa), [ 0:07] 720 forward_iterator(ib), [ 0:07] 721 forward_iterator(ib + sa - 1), [ 0:07] 722 std::equal_to()) == false); [ 0:07] 723 comparison_count = 0; [ 0:07] 724 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 725 forward_iterator(ia + sa), [ 0:07] 726 forward_iterator(ib), [ 0:07] 727 forward_iterator(ib + sa - 1), [ 0:07] 728 counting_equals) == false); [ 0:07] 729 assert ( comparison_count > 0 ); [ 0:07] 730 comparison_count = 0; [ 0:07] 731 assert(std::is_permutation(random_access_iterator(ia), [ 0:07] 732 random_access_iterator(ia + sa), [ 0:07] 733 random_access_iterator(ib), [ 0:07] 734 random_access_iterator(ib + sa - 1), [ 0:07] 735 counting_equals) == false); [ 0:07] 736 assert ( comparison_count == 0 ); [ 0:07] 737 #endif [ 0:07] 738 } [ 0:07] 739 { [ 0:07] 740 const int ia[] = {0, 1, 2, 3, 0, 5, 6, 2, 4, 4}; [ 0:07] 741 const int ib[] = {4, 2, 3, 0, 1, 4, 0, 5, 6, 0}; [ 0:07] 742 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:07] 743 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 744 forward_iterator(ia + sa), [ 0:07] 745 forward_iterator(ib), [ 0:07] 746 std::equal_to()) == false); [ 0:07] 747 #if TEST_STD_VER >= 14 [ 0:07] 748 assert(std::is_permutation(forward_iterator(ia), [ 0:07] 749 forward_iterator(ia + sa), [ 0:07] 750 forward_iterator(ib), [ 0:07] 751 forward_iterator(ib + sa), [ 0:07] 752 std::equal_to()) == false); [ 0:07] 753 #endif [ 0:07] 754 } [ 0:07] 755 { [ 0:07] 756 const S a[] = {S(0), S(1)}; [ 0:07] 757 const S b[] = {S(1), S(0)}; [ 0:07] 758 const unsigned sa = sizeof(a)/sizeof(a[0]); [ 0:07] 759 assert(std::is_permutation(forward_iterator(a), [ 0:07] 760 forward_iterator(a + sa), [ 0:07] 761 forward_iterator(b), [ 0:07] 762 eq())); [ 0:07] 763 #if TEST_STD_VER >= 14 [ 0:07] 764 assert(std::is_permutation(forward_iterator(a), [ 0:07] 765 forward_iterator(a + sa), [ 0:07] 766 forward_iterator(b), [ 0:07] 767 forward_iterator(b + sa), [ 0:07] 768 eq())); [ 0:07] 769 #endif [ 0:07] 770 } [ 0:07] 771 [ 0:07] 772 #if TEST_STD_VER > 17 [ 0:07] 773 static_assert(test_constexpr()); [ 0:07] 774 #endif [ 0:07] 775 [ 0:07] 776 return 0; [ 0:07] 777 } [ 0:07] # no errors were expected but one was found anyway