[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/algorithms/unique_copy_pred.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/algorithms/unique_copy_pred.pass.cpp:23: [ 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.9/_klee_out" [ 0:06] KLEE: Using Z3 solver backend [ 0:06] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:07] 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:07] [ 0:07] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:11] KLEE: WARNING: undefined reference to function: klee_free [ 0:11] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:11] i:1 [ 0:11] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:11] about to __boot:0 [ 0:11] about to run the scheduler:0 [ 0:11] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:11] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:11] KLEE: NOTE: now ignoring this error at this location [ 0:11] KLEE: ERROR: EXITING ON ERROR: [ 0:11] Error: failed external call: __dios_tainted_init [ 0:11] File: /dios/libc/sys/start.cpp [ 0:11] Line: 87 [ 0:11] assembly.ll line: 64729 [ 0:11] Stack: [ 0:11] #000064729 in __dios_start (l=2, argc=1, argv=94632140796424, envp=94632140873736) at /dios/libc/sys/start.cpp:87 [ 0:11] #100040738 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:11] #200072977 in klee_boot (argc=2, argv=94632103927296) at /dios/arch/klee/boot.c:41 [ 0:11] [ 0:11] [ 0:11] 1 /* TAGS: c++ fin */ [ 0:11] 2 /* CC_OPTS: -std=c++2a */ [ 0:11] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:11] 4 //===----------------------------------------------------------------------===// [ 0:11] 5 // [ 0:11] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:11] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:11] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:11] 9 // [ 0:11] 10 //===----------------------------------------------------------------------===// [ 0:11] 11 [ 0:11] 12 // [ 0:11] 13 [ 0:11] 14 // template Pred> [ 0:11] 16 // requires OutputIterator::type> [ 0:11] 17 // && HasAssign [ 0:11] 18 // && Constructible [ 0:11] 19 // && CopyConstructible [ 0:11] 20 // constexpr OutIter // constexpr after C++17 [ 0:11] 21 // unique_copy(InIter first, InIter last, OutIter result, Pred pred); [ 0:11] 22 [ 0:11] 23 #include [ 0:11] 24 #include [ 0:11] 25 [ 0:11] 26 #include "test_macros.h" [ 0:11] 27 #include "test_iterators.h" [ 0:11] 28 [ 0:11] 29 #if TEST_STD_VER > 17 [ 0:11] 30 TEST_CONSTEXPR bool test_constexpr() { [ 0:11] 31 int ia[] = {0, 1, 2, 2, 4}; [ 0:11] 32 int ib[] = {0, 0, 0, 0, 0}; [ 0:11] 33 const int expected[] = {0, 1, 2, 4}; [ 0:11] 34 [ 0:11] 35 auto it = std::unique_copy(std::begin(ia), std::end(ia), std::begin(ib), [ 0:11] 36 [](int a, int b) {return a == b; }); [ 0:11] 37 return it == (std::begin(ib) + std::size(expected)) [ 0:11] 38 && *it == 0 // don't overwrite final value in output [ 0:11] 39 && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected)) [ 0:11] 40 ; [ 0:11] 41 } [ 0:11] 42 #endif [ 0:11] 43 [ 0:11] 44 struct count_equal [ 0:11] 45 { [ 0:11] 46 static unsigned count; [ 0:11] 47 template [ 0:11] 48 bool operator()(const T& x, const T& y) [ 0:11] 49 {++count; return x == y;} [ 0:11] 50 }; [ 0:11] 51 [ 0:11] 52 unsigned count_equal::count = 0; [ 0:11] 53 [ 0:11] 54 template [ 0:11] 55 void [ 0:11] 56 test() [ 0:11] 57 { [ 0:11] 58 const int ia[] = {0}; [ 0:11] 59 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:11] 60 int ja[sa] = {-1}; [ 0:11] 61 count_equal::count = 0; [ 0:11] 62 OutIter r = std::unique_copy(InIter(ia), InIter(ia+sa), OutIter(ja), count_equal()); [ 0:11] 63 assert(base(r) == ja + sa); [ 0:11] 64 assert(ja[0] == 0); [ 0:11] 65 assert(count_equal::count == sa-1); [ 0:11] 66 [ 0:11] 67 const int ib[] = {0, 1}; [ 0:11] 68 const unsigned sb = sizeof(ib)/sizeof(ib[0]); [ 0:11] 69 int jb[sb] = {-1}; [ 0:11] 70 count_equal::count = 0; [ 0:11] 71 r = std::unique_copy(InIter(ib), InIter(ib+sb), OutIter(jb), count_equal()); [ 0:11] 72 assert(base(r) == jb + sb); [ 0:11] 73 assert(jb[0] == 0); [ 0:11] 74 assert(jb[1] == 1); [ 0:11] 75 assert(count_equal::count == sb-1); [ 0:11] 76 [ 0:11] 77 const int ic[] = {0, 0}; [ 0:11] 78 const unsigned sc = sizeof(ic)/sizeof(ic[0]); [ 0:11] 79 int jc[sc] = {-1}; [ 0:11] 80 count_equal::count = 0; [ 0:11] 81 r = std::unique_copy(InIter(ic), InIter(ic+sc), OutIter(jc), count_equal()); [ 0:11] 82 assert(base(r) == jc + 1); [ 0:11] 83 assert(jc[0] == 0); [ 0:11] 84 assert(count_equal::count == sc-1); [ 0:11] 85 [ 0:11] 86 const int id[] = {0, 0, 1}; [ 0:11] 87 const unsigned sd = sizeof(id)/sizeof(id[0]); [ 0:11] 88 int jd[sd] = {-1}; [ 0:11] 89 count_equal::count = 0; [ 0:11] 90 r = std::unique_copy(InIter(id), InIter(id+sd), OutIter(jd), count_equal()); [ 0:11] 91 assert(base(r) == jd + 2); [ 0:11] 92 assert(jd[0] == 0); [ 0:11] 93 assert(jd[1] == 1); [ 0:11] 94 assert(count_equal::count == sd-1); [ 0:11] 95 [ 0:11] 96 const int ie[] = {0, 0, 1, 0}; [ 0:11] 97 const unsigned se = sizeof(ie)/sizeof(ie[0]); [ 0:11] 98 int je[se] = {-1}; [ 0:11] 99 count_equal::count = 0; [ 0:11] 100 r = std::unique_copy(InIter(ie), InIter(ie+se), OutIter(je), count_equal()); [ 0:11] 101 assert(base(r) == je + 3); [ 0:11] 102 assert(je[0] == 0); [ 0:11] 103 assert(je[1] == 1); [ 0:11] 104 assert(je[2] == 0); [ 0:11] 105 assert(count_equal::count == se-1); [ 0:11] 106 [ 0:11] 107 const int ig[] = {0, 0, 1, 1}; [ 0:11] 108 const unsigned sg = sizeof(ig)/sizeof(ig[0]); [ 0:11] 109 int jg[sg] = {-1}; [ 0:11] 110 count_equal::count = 0; [ 0:11] 111 r = std::unique_copy(InIter(ig), InIter(ig+sg), OutIter(jg), count_equal()); [ 0:11] 112 assert(base(r) == jg + 2); [ 0:11] 113 assert(jg[0] == 0); [ 0:11] 114 assert(jg[1] == 1); [ 0:11] 115 assert(count_equal::count == sg-1); [ 0:11] 116 [ 0:11] 117 const int ih[] = {0, 1, 1}; [ 0:11] 118 const unsigned sh = sizeof(ih)/sizeof(ih[0]); [ 0:11] 119 int jh[sh] = {-1}; [ 0:11] 120 count_equal::count = 0; [ 0:11] 121 r = std::unique_copy(InIter(ih), InIter(ih+sh), OutIter(jh), count_equal()); [ 0:11] 122 assert(base(r) == jh + 2); [ 0:11] 123 assert(jh[0] == 0); [ 0:11] 124 assert(jh[1] == 1); [ 0:11] 125 assert(count_equal::count == sh-1); [ 0:11] 126 [ 0:11] 127 const int ii[] = {0, 1, 1, 1, 2, 2, 2}; [ 0:11] 128 const unsigned si = sizeof(ii)/sizeof(ii[0]); [ 0:11] 129 int ji[si] = {-1}; [ 0:11] 130 count_equal::count = 0; [ 0:11] 131 r = std::unique_copy(InIter(ii), InIter(ii+si), OutIter(ji), count_equal()); [ 0:11] 132 assert(base(r) == ji + 3); [ 0:11] 133 assert(ji[0] == 0); [ 0:11] 134 assert(ji[1] == 1); [ 0:11] 135 assert(ji[2] == 2); [ 0:11] 136 assert(count_equal::count == si-1); [ 0:11] 137 } [ 0:11] 138 [ 0:11] 139 int main(int, char**) [ 0:11] 140 { [ 0:11] 141 test, output_iterator >(); [ 0:11] 142 test, forward_iterator >(); [ 0:11] 143 test, bidirectional_iterator >(); [ 0:11] 144 test, random_access_iterator >(); [ 0:11] 145 test, int*>(); [ 0:11] 146 [ 0:11] 147 test, output_iterator >(); [ 0:11] 148 test, forward_iterator >(); [ 0:11] 149 test, bidirectional_iterator >(); [ 0:11] 150 test, random_access_iterator >(); [ 0:11] 151 test, int*>(); [ 0:11] 152 [ 0:11] 153 test, output_iterator >(); [ 0:11] 154 test, forward_iterator >(); [ 0:11] 155 test, bidirectional_iterator >(); [ 0:11] 156 test, random_access_iterator >(); [ 0:11] 157 test, int*>(); [ 0:11] 158 [ 0:11] 159 test, output_iterator >(); [ 0:11] 160 test, forward_iterator >(); [ 0:11] 161 test, bidirectional_iterator >(); [ 0:11] 162 test, random_access_iterator >(); [ 0:11] 163 test, int*>(); [ 0:11] 164 [ 0:11] 165 test >(); [ 0:11] 166 test >(); [ 0:11] 167 test >(); [ 0:11] 168 test >(); [ 0:11] 169 test(); [ 0:11] 170 [ 0:11] 171 #if TEST_STD_VER > 17 [ 0:11] 172 static_assert(test_constexpr()); [ 0:11] 173 #endif [ 0:11] 174 [ 0:11] 175 return 0; [ 0:11] 176 } [ 0:11] # no errors were expected but one was found anyway