[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/algorithms/stable_partition.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/algorithms/stable_partition.pass.cpp:20: [ 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:02] compiling /dios/lib/config/seqklee.bc [ 0:02] setting up pass: functionmeta, options = [ 0:04] setting up pass: fuse-ctors, options = [ 0:04] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.8/_klee_out" [ 0:09] KLEE: Using Z3 solver backend [ 0:09] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:09] 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:10] [ 0:10] KLEE: WARNING: undefined reference to function: _Z10klee_abortv [ 0:15] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:15] KLEE: WARNING: undefined reference to function: klee_free [ 0:15] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:15] KLEE: WARNING ONCE: Using zero size array fix for landingpad instruction filter [ 0:16] i:1 [ 0:16] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:16] about to __boot:0 [ 0:16] about to run the scheduler:0 [ 0:16] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:16] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:16] KLEE: NOTE: now ignoring this error at this location [ 0:16] KLEE: ERROR: EXITING ON ERROR: [ 0:16] Error: failed external call: __dios_tainted_init [ 0:16] File: /dios/libc/sys/start.cpp [ 0:16] Line: 87 [ 0:16] assembly.ll line: 104611 [ 0:16] Stack: [ 0:16] #000104611 in __dios_start (l=2, argc=1, argv=94416810415624, envp=94416810501128) at /dios/libc/sys/start.cpp:87 [ 0:16] #100052613 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:16] #200113191 in klee_boot (argc=2, argv=94416776007040) at /dios/arch/klee/boot.c:41 [ 0:16] [ 0:16] [ 0:16] 1 /* TAGS: c++ fin */ [ 0:16] 2 /* CC_OPTS: -std=c++2a */ [ 0:16] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:16] 4 //===----------------------------------------------------------------------===// [ 0:16] 5 // [ 0:16] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:16] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:16] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:16] 9 // [ 0:16] 10 //===----------------------------------------------------------------------===// [ 0:16] 11 [ 0:16] 12 // [ 0:16] 13 [ 0:16] 14 // template Pred> [ 0:16] 15 // requires ShuffleIterator [ 0:16] 16 // && CopyConstructible [ 0:16] 17 // Iter [ 0:16] 18 // stable_partition(Iter first, Iter last, Pred pred); [ 0:16] 19 [ 0:16] 20 #include [ 0:16] 21 #include [ 0:16] 22 #include [ 0:16] 23 [ 0:16] 24 #include "test_macros.h" [ 0:16] 25 #include "test_iterators.h" [ 0:16] 26 [ 0:16] 27 struct is_odd [ 0:16] 28 { [ 0:16] 29 bool operator()(const int& i) const {return i & 1;} [ 0:16] 30 }; [ 0:16] 31 [ 0:16] 32 struct odd_first [ 0:16] 33 { [ 0:16] 34 bool operator()(const std::pair& p) const [ 0:16] 35 {return p.first & 1;} [ 0:16] 36 }; [ 0:16] 37 [ 0:16] 38 template [ 0:16] 39 void [ 0:16] 40 test() [ 0:16] 41 { [ 0:16] 42 { // check mixed [ 0:16] 43 typedef std::pair P; [ 0:16] 44 P array[] = [ 0:16] 45 { [ 0:16] 46 P(0, 1), [ 0:16] 47 P(0, 2), [ 0:16] 48 P(1, 1), [ 0:16] 49 P(1, 2), [ 0:16] 50 P(2, 1), [ 0:16] 51 P(2, 2), [ 0:16] 52 P(3, 1), [ 0:16] 53 P(3, 2), [ 0:16] 54 P(4, 1), [ 0:16] 55 P(4, 2) [ 0:16] 56 }; [ 0:16] 57 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 58 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 59 assert(base(r) == array + 4); [ 0:16] 60 assert(array[0] == P(1, 1)); [ 0:16] 61 assert(array[1] == P(1, 2)); [ 0:16] 62 assert(array[2] == P(3, 1)); [ 0:16] 63 assert(array[3] == P(3, 2)); [ 0:16] 64 assert(array[4] == P(0, 1)); [ 0:16] 65 assert(array[5] == P(0, 2)); [ 0:16] 66 assert(array[6] == P(2, 1)); [ 0:16] 67 assert(array[7] == P(2, 2)); [ 0:16] 68 assert(array[8] == P(4, 1)); [ 0:16] 69 assert(array[9] == P(4, 2)); [ 0:16] 70 } [ 0:16] 71 { [ 0:16] 72 typedef std::pair P; [ 0:16] 73 P array[] = [ 0:16] 74 { [ 0:16] 75 P(0, 1), [ 0:16] 76 P(0, 2), [ 0:16] 77 P(1, 1), [ 0:16] 78 P(1, 2), [ 0:16] 79 P(2, 1), [ 0:16] 80 P(2, 2), [ 0:16] 81 P(3, 1), [ 0:16] 82 P(3, 2), [ 0:16] 83 P(4, 1), [ 0:16] 84 P(4, 2) [ 0:16] 85 }; [ 0:16] 86 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 87 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 88 assert(base(r) == array + 4); [ 0:16] 89 assert(array[0] == P(1, 1)); [ 0:16] 90 assert(array[1] == P(1, 2)); [ 0:16] 91 assert(array[2] == P(3, 1)); [ 0:16] 92 assert(array[3] == P(3, 2)); [ 0:16] 93 assert(array[4] == P(0, 1)); [ 0:16] 94 assert(array[5] == P(0, 2)); [ 0:16] 95 assert(array[6] == P(2, 1)); [ 0:16] 96 assert(array[7] == P(2, 2)); [ 0:16] 97 assert(array[8] == P(4, 1)); [ 0:16] 98 assert(array[9] == P(4, 2)); [ 0:16] 99 // check empty [ 0:16] 100 r = std::stable_partition(Iter(array), Iter(array), odd_first()); [ 0:16] 101 assert(base(r) == array); [ 0:16] 102 // check one true [ 0:16] 103 r = std::stable_partition(Iter(array), Iter(array+1), odd_first()); [ 0:16] 104 assert(base(r) == array+1); [ 0:16] 105 assert(array[0] == P(1, 1)); [ 0:16] 106 // check one false [ 0:16] 107 r = std::stable_partition(Iter(array+4), Iter(array+5), odd_first()); [ 0:16] 108 assert(base(r) == array+4); [ 0:16] 109 assert(array[4] == P(0, 1)); [ 0:16] 110 } [ 0:16] 111 { // check all false [ 0:16] 112 typedef std::pair P; [ 0:16] 113 P array[] = [ 0:16] 114 { [ 0:16] 115 P(0, 1), [ 0:16] 116 P(0, 2), [ 0:16] 117 P(2, 1), [ 0:16] 118 P(2, 2), [ 0:16] 119 P(4, 1), [ 0:16] 120 P(4, 2), [ 0:16] 121 P(6, 1), [ 0:16] 122 P(6, 2), [ 0:16] 123 P(8, 1), [ 0:16] 124 P(8, 2) [ 0:16] 125 }; [ 0:16] 126 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 127 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 128 assert(base(r) == array); [ 0:16] 129 assert(array[0] == P(0, 1)); [ 0:16] 130 assert(array[1] == P(0, 2)); [ 0:16] 131 assert(array[2] == P(2, 1)); [ 0:16] 132 assert(array[3] == P(2, 2)); [ 0:16] 133 assert(array[4] == P(4, 1)); [ 0:16] 134 assert(array[5] == P(4, 2)); [ 0:16] 135 assert(array[6] == P(6, 1)); [ 0:16] 136 assert(array[7] == P(6, 2)); [ 0:16] 137 assert(array[8] == P(8, 1)); [ 0:16] 138 assert(array[9] == P(8, 2)); [ 0:16] 139 } [ 0:16] 140 { // check all true [ 0:16] 141 typedef std::pair P; [ 0:16] 142 P array[] = [ 0:16] 143 { [ 0:16] 144 P(1, 1), [ 0:16] 145 P(1, 2), [ 0:16] 146 P(3, 1), [ 0:16] 147 P(3, 2), [ 0:16] 148 P(5, 1), [ 0:16] 149 P(5, 2), [ 0:16] 150 P(7, 1), [ 0:16] 151 P(7, 2), [ 0:16] 152 P(9, 1), [ 0:16] 153 P(9, 2) [ 0:16] 154 }; [ 0:16] 155 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 156 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 157 assert(base(r) == array + size); [ 0:16] 158 assert(array[0] == P(1, 1)); [ 0:16] 159 assert(array[1] == P(1, 2)); [ 0:16] 160 assert(array[2] == P(3, 1)); [ 0:16] 161 assert(array[3] == P(3, 2)); [ 0:16] 162 assert(array[4] == P(5, 1)); [ 0:16] 163 assert(array[5] == P(5, 2)); [ 0:16] 164 assert(array[6] == P(7, 1)); [ 0:16] 165 assert(array[7] == P(7, 2)); [ 0:16] 166 assert(array[8] == P(9, 1)); [ 0:16] 167 assert(array[9] == P(9, 2)); [ 0:16] 168 } [ 0:16] 169 { // check all false but first true [ 0:16] 170 typedef std::pair P; [ 0:16] 171 P array[] = [ 0:16] 172 { [ 0:16] 173 P(1, 1), [ 0:16] 174 P(0, 2), [ 0:16] 175 P(2, 1), [ 0:16] 176 P(2, 2), [ 0:16] 177 P(4, 1), [ 0:16] 178 P(4, 2), [ 0:16] 179 P(6, 1), [ 0:16] 180 P(6, 2), [ 0:16] 181 P(8, 1), [ 0:16] 182 P(8, 2) [ 0:16] 183 }; [ 0:16] 184 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 185 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 186 assert(base(r) == array + 1); [ 0:16] 187 assert(array[0] == P(1, 1)); [ 0:16] 188 assert(array[1] == P(0, 2)); [ 0:16] 189 assert(array[2] == P(2, 1)); [ 0:16] 190 assert(array[3] == P(2, 2)); [ 0:16] 191 assert(array[4] == P(4, 1)); [ 0:16] 192 assert(array[5] == P(4, 2)); [ 0:16] 193 assert(array[6] == P(6, 1)); [ 0:16] 194 assert(array[7] == P(6, 2)); [ 0:16] 195 assert(array[8] == P(8, 1)); [ 0:16] 196 assert(array[9] == P(8, 2)); [ 0:16] 197 } [ 0:16] 198 { // check all false but last true [ 0:16] 199 typedef std::pair P; [ 0:16] 200 P array[] = [ 0:16] 201 { [ 0:16] 202 P(0, 1), [ 0:16] 203 P(0, 2), [ 0:16] 204 P(2, 1), [ 0:16] 205 P(2, 2), [ 0:16] 206 P(4, 1), [ 0:16] 207 P(4, 2), [ 0:16] 208 P(6, 1), [ 0:16] 209 P(6, 2), [ 0:16] 210 P(8, 1), [ 0:16] 211 P(1, 2) [ 0:16] 212 }; [ 0:16] 213 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 214 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 215 assert(base(r) == array + 1); [ 0:16] 216 assert(array[0] == P(1, 2)); [ 0:16] 217 assert(array[1] == P(0, 1)); [ 0:16] 218 assert(array[2] == P(0, 2)); [ 0:16] 219 assert(array[3] == P(2, 1)); [ 0:16] 220 assert(array[4] == P(2, 2)); [ 0:16] 221 assert(array[5] == P(4, 1)); [ 0:16] 222 assert(array[6] == P(4, 2)); [ 0:16] 223 assert(array[7] == P(6, 1)); [ 0:16] 224 assert(array[8] == P(6, 2)); [ 0:16] 225 assert(array[9] == P(8, 1)); [ 0:16] 226 } [ 0:16] 227 { // check all true but first false [ 0:16] 228 typedef std::pair P; [ 0:16] 229 P array[] = [ 0:16] 230 { [ 0:16] 231 P(0, 1), [ 0:16] 232 P(1, 2), [ 0:16] 233 P(3, 1), [ 0:16] 234 P(3, 2), [ 0:16] 235 P(5, 1), [ 0:16] 236 P(5, 2), [ 0:16] 237 P(7, 1), [ 0:16] 238 P(7, 2), [ 0:16] 239 P(9, 1), [ 0:16] 240 P(9, 2) [ 0:16] 241 }; [ 0:16] 242 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 243 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 244 assert(base(r) == array + size-1); [ 0:16] 245 assert(array[0] == P(1, 2)); [ 0:16] 246 assert(array[1] == P(3, 1)); [ 0:16] 247 assert(array[2] == P(3, 2)); [ 0:16] 248 assert(array[3] == P(5, 1)); [ 0:16] 249 assert(array[4] == P(5, 2)); [ 0:16] 250 assert(array[5] == P(7, 1)); [ 0:16] 251 assert(array[6] == P(7, 2)); [ 0:16] 252 assert(array[7] == P(9, 1)); [ 0:16] 253 assert(array[8] == P(9, 2)); [ 0:16] 254 assert(array[9] == P(0, 1)); [ 0:16] 255 } [ 0:16] 256 { // check all true but last false [ 0:16] 257 typedef std::pair P; [ 0:16] 258 P array[] = [ 0:16] 259 { [ 0:16] 260 P(1, 1), [ 0:16] 261 P(1, 2), [ 0:16] 262 P(3, 1), [ 0:16] 263 P(3, 2), [ 0:16] 264 P(5, 1), [ 0:16] 265 P(5, 2), [ 0:16] 266 P(7, 1), [ 0:16] 267 P(7, 2), [ 0:16] 268 P(9, 1), [ 0:16] 269 P(0, 2) [ 0:16] 270 }; [ 0:16] 271 const unsigned size = sizeof(array)/sizeof(array[0]); [ 0:16] 272 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); [ 0:16] 273 assert(base(r) == array + size-1); [ 0:16] 274 assert(array[0] == P(1, 1)); [ 0:16] 275 assert(array[1] == P(1, 2)); [ 0:16] 276 assert(array[2] == P(3, 1)); [ 0:16] 277 assert(array[3] == P(3, 2)); [ 0:16] 278 assert(array[4] == P(5, 1)); [ 0:16] 279 assert(array[5] == P(5, 2)); [ 0:16] 280 assert(array[6] == P(7, 1)); [ 0:16] 281 assert(array[7] == P(7, 2)); [ 0:16] 282 assert(array[8] == P(9, 1)); [ 0:16] 283 assert(array[9] == P(0, 2)); [ 0:16] 284 } [ 0:16] 285 } [ 0:16] 286 [ 0:16] 287 #if TEST_STD_VER >= 11 [ 0:16] 288 [ 0:16] 289 struct is_null [ 0:16] 290 { [ 0:16] 291 template [ 0:16] 292 bool operator()(const P& p) {return p == 0;} [ 0:16] 293 }; [ 0:16] 294 [ 0:16] 295 template [ 0:16] 296 void [ 0:16] 297 test1() [ 0:16] 298 { [ 0:16] 299 const unsigned size = 5; [ 0:16] 300 std::unique_ptr array[size]; [ 0:16] 301 Iter r = std::stable_partition(Iter(array), Iter(array+size), is_null()); [ 0:16] 302 assert(r == Iter(array+size)); [ 0:16] 303 } [ 0:16] 304 [ 0:16] 305 #endif // TEST_STD_VER >= 11 [ 0:16] 306 [ 0:16] 307 int main(int, char**) [ 0:16] 308 { [ 0:16] 309 test*> >(); [ 0:16] 310 test*> >(); [ 0:16] 311 test*>(); [ 0:16] 312 [ 0:16] 313 #if TEST_STD_VER >= 11 [ 0:16] 314 test1*> >(); [ 0:16] 315 #endif [ 0:16] 316 [ 0:16] 317 return 0; [ 0:16] 318 } [ 0:16] # no errors were expected but one was found anyway