[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/containers/insert_or_assign.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/containers/insert_or_assign.pass.cpp:27: [ 0:01] In file included from /dios/libcxx/include/map:479: [ 0:01] In file included from /dios/libcxx/include/__tree:14: [ 0:01] In file included from /dios/libcxx/include/iterator:420: [ 0:01] In file included from /dios/libcxx/include/iosfwd:95: [ 0:01] In file included from /dios/libcxx/include/wchar.h:118: [ 0:01] In file included from /dios/include/wchar.h:9: [ 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.20/_klee_out" [ 0:08] KLEE: Using Z3 solver backend [ 0:08] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:08] 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:09] [ 0:09] KLEE: WARNING: undefined reference to function: _Z10klee_abortv [ 0:13] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:13] KLEE: WARNING: undefined reference to function: klee_free [ 0:13] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:13] KLEE: WARNING ONCE: Using zero size array fix for landingpad instruction filter [ 0:13] i:1 [ 0:13] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:13] about to __boot:0 [ 0:13] about to run the scheduler:0 [ 0:13] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:13] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:13] KLEE: NOTE: now ignoring this error at this location [ 0:13] KLEE: ERROR: EXITING ON ERROR: [ 0:14] Error: failed external call: __dios_tainted_init [ 0:14] File: /dios/libc/sys/start.cpp [ 0:14] Line: 87 [ 0:14] assembly.ll line: 86588 [ 0:14] Stack: [ 0:14] #000086588 in __dios_start (l=2, argc=1, argv=93986868179464, envp=93986868256776) at /dios/libc/sys/start.cpp:87 [ 0:14] #100034417 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:14] #200095168 in klee_boot (argc=2, argv=93986837319040) at /dios/arch/klee/boot.c:41 [ 0:14] [ 0:14] [ 0:14] 1 /* TAGS: c++ fin */ [ 0:14] 2 /* CC_OPTS: -std=c++2a */ [ 0:14] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:14] 4 //===----------------------------------------------------------------------===// [ 0:14] 5 // [ 0:14] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:14] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:14] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:14] 9 // [ 0:14] 10 //===----------------------------------------------------------------------===// [ 0:14] 11 // [ 0:14] 12 // UNSUPPORTED: c++98, c++03, c++11, c++14 [ 0:14] 13 [ 0:14] 14 // [ 0:14] 15 [ 0:14] 16 // class map [ 0:14] 17 [ 0:14] 18 // template [ 0:14] 19 // pair insert_or_assign(const key_type& k, M&& obj); // C++17 [ 0:14] 20 // template [ 0:14] 21 // pair insert_or_assign(key_type&& k, M&& obj); // C++17 [ 0:14] 22 // template [ 0:14] 23 // iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17 [ 0:14] 24 // template [ 0:14] 25 // iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17 [ 0:14] 26 [ 0:14] 27 #include [ 0:14] 28 #include [ 0:14] 29 #include [ 0:14] 30 [ 0:14] 31 #include [ 0:14] 32 [ 0:14] 33 #include "test_macros.h" [ 0:14] 34 [ 0:14] 35 class Moveable [ 0:14] 36 { [ 0:14] 37 Moveable(const Moveable&); [ 0:14] 38 Moveable& operator=(const Moveable&); [ 0:14] 39 [ 0:14] 40 int int_; [ 0:14] 41 double double_; [ 0:14] 42 public: [ 0:14] 43 Moveable() : int_(0), double_(0) {} [ 0:14] 44 Moveable(int i, double d) : int_(i), double_(d) {} [ 0:14] 45 Moveable(Moveable&& x) [ 0:14] 46 : int_(x.int_), double_(x.double_) [ 0:14] 47 {x.int_ = -1; x.double_ = -1;} [ 0:14] 48 Moveable& operator=(Moveable&& x) [ 0:14] 49 {int_ = x.int_; x.int_ = -1; [ 0:14] 50 double_ = x.double_; x.double_ = -1; [ 0:14] 51 return *this; [ 0:14] 52 } [ 0:14] 53 [ 0:14] 54 bool operator==(const Moveable& x) const [ 0:14] 55 {return int_ == x.int_ && double_ == x.double_;} [ 0:14] 56 bool operator<(const Moveable& x) const [ 0:14] 57 {return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);} [ 0:14] 58 [ 0:14] 59 int get() const {return int_;} [ 0:14] 60 bool moved() const {return int_ == -1;} [ 0:14] 61 }; [ 0:14] 62 [ 0:14] 63 [ 0:14] 64 int main(int, char**) [ 0:14] 65 { [ 0:14] 66 { // pair insert_or_assign(const key_type& k, M&& obj); [ 0:14] 67 typedef std::map M; [ 0:14] 68 typedef std::pair R; [ 0:14] 69 M m; [ 0:14] 70 R r; [ 0:14] 71 for ( int i = 0; i < 20; i += 2 ) [ 0:14] 72 m.emplace ( i, Moveable(i, (double) i)); [ 0:14] 73 assert(m.size() == 10); [ 0:14] 74 [ 0:14] 75 for (int i=0; i < 20; i += 2) [ 0:14] 76 { [ 0:14] 77 Moveable mv(i+1, i+1); [ 0:14] 78 r = m.insert_or_assign(i, std::move(mv)); [ 0:14] 79 assert(m.size() == 10); [ 0:14] 80 assert(!r.second); // was not inserted [ 0:14] 81 assert(mv.moved()); // was moved from [ 0:14] 82 assert(r.first->first == i); // key [ 0:14] 83 assert(r.first->second.get() == i+1); // value [ 0:14] 84 } [ 0:14] 85 [ 0:14] 86 Moveable mv1(5, 5.0); [ 0:14] 87 r = m.insert_or_assign(-1, std::move(mv1)); [ 0:14] 88 assert(m.size() == 11); [ 0:14] 89 assert(r.second); // was inserted [ 0:14] 90 assert(mv1.moved()); // was moved from [ 0:14] 91 assert(r.first->first == -1); // key [ 0:14] 92 assert(r.first->second.get() == 5); // value [ 0:14] 93 [ 0:14] 94 Moveable mv2(9, 9.0); [ 0:14] 95 r = m.insert_or_assign(3, std::move(mv2)); [ 0:14] 96 assert(m.size() == 12); [ 0:14] 97 assert(r.second); // was inserted [ 0:14] 98 assert(mv2.moved()); // was moved from [ 0:14] 99 assert(r.first->first == 3); // key [ 0:14] 100 assert(r.first->second.get() == 9); // value [ 0:14] 101 [ 0:14] 102 Moveable mv3(-1, 5.0); [ 0:14] 103 r = m.insert_or_assign(117, std::move(mv3)); [ 0:14] 104 assert(m.size() == 13); [ 0:14] 105 assert(r.second); // was inserted [ 0:14] 106 assert(mv3.moved()); // was moved from [ 0:14] 107 assert(r.first->first == 117); // key [ 0:14] 108 assert(r.first->second.get() == -1); // value [ 0:14] 109 } [ 0:14] 110 { // pair insert_or_assign(key_type&& k, M&& obj); [ 0:14] 111 typedef std::map M; [ 0:14] 112 typedef std::pair R; [ 0:14] 113 M m; [ 0:14] 114 R r; [ 0:14] 115 for ( int i = 0; i < 20; i += 2 ) [ 0:14] 116 m.emplace ( Moveable(i, (double) i), Moveable(i+1, (double) i+1)); [ 0:14] 117 assert(m.size() == 10); [ 0:14] 118 [ 0:14] 119 Moveable mvkey1(2, 2.0); [ 0:14] 120 Moveable mv1(4, 4.0); [ 0:14] 121 r = m.insert_or_assign(std::move(mvkey1), std::move(mv1)); [ 0:14] 122 assert(m.size() == 10); [ 0:14] 123 assert(!r.second); // was not inserted [ 0:14] 124 assert(!mvkey1.moved()); // was not moved from [ 0:14] 125 assert(mv1.moved()); // was moved from [ 0:14] 126 assert(r.first->first == mvkey1); // key [ 0:14] 127 assert(r.first->second.get() == 4); // value [ 0:14] 128 [ 0:14] 129 Moveable mvkey2(3, 3.0); [ 0:14] 130 Moveable mv2(5, 5.0); [ 0:14] 131 r = m.try_emplace(std::move(mvkey2), std::move(mv2)); [ 0:14] 132 assert(m.size() == 11); [ 0:14] 133 assert(r.second); // was inserted [ 0:14] 134 assert(mv2.moved()); // was moved from [ 0:14] 135 assert(mvkey2.moved()); // was moved from [ 0:14] 136 assert(r.first->first.get() == 3); // key [ 0:14] 137 assert(r.first->second.get() == 5); // value [ 0:14] 138 } [ 0:14] 139 { // iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); [ 0:14] 140 typedef std::map M; [ 0:14] 141 M m; [ 0:14] 142 M::iterator r; [ 0:14] 143 for ( int i = 0; i < 20; i += 2 ) [ 0:14] 144 m.emplace ( i, Moveable(i, (double) i)); [ 0:14] 145 assert(m.size() == 10); [ 0:14] 146 M::const_iterator it = m.find(2); [ 0:14] 147 [ 0:14] 148 Moveable mv1(3, 3.0); [ 0:14] 149 r = m.insert_or_assign(it, 2, std::move(mv1)); [ 0:14] 150 assert(m.size() == 10); [ 0:14] 151 assert(mv1.moved()); // was moved from [ 0:14] 152 assert(r->first == 2); // key [ 0:14] 153 assert(r->second.get() == 3); // value [ 0:14] 154 [ 0:14] 155 Moveable mv2(5, 5.0); [ 0:14] 156 r = m.insert_or_assign(it, 3, std::move(mv2)); [ 0:14] 157 assert(m.size() == 11); [ 0:14] 158 assert(mv2.moved()); // was moved from [ 0:14] 159 assert(r->first == 3); // key [ 0:14] 160 assert(r->second.get() == 5); // value [ 0:14] 161 } [ 0:14] 162 { // iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); [ 0:14] 163 typedef std::map M; [ 0:14] 164 M m; [ 0:14] 165 M::iterator r; [ 0:14] 166 for ( int i = 0; i < 20; i += 2 ) [ 0:14] 167 m.emplace ( Moveable(i, (double) i), Moveable(i+1, (double) i+1)); [ 0:14] 168 assert(m.size() == 10); [ 0:14] 169 M::const_iterator it = std::next(m.cbegin()); [ 0:14] 170 [ 0:14] 171 Moveable mvkey1(2, 2.0); [ 0:14] 172 Moveable mv1(4, 4.0); [ 0:14] 173 r = m.insert_or_assign(it, std::move(mvkey1), std::move(mv1)); [ 0:14] 174 assert(m.size() == 10); [ 0:14] 175 assert(mv1.moved()); // was moved from [ 0:14] 176 assert(!mvkey1.moved()); // was not moved from [ 0:14] 177 assert(r->first == mvkey1); // key [ 0:14] 178 assert(r->second.get() == 4); // value [ 0:14] 179 [ 0:14] 180 Moveable mvkey2(3, 3.0); [ 0:14] 181 Moveable mv2(5, 5.0); [ 0:14] 182 r = m.insert_or_assign(it, std::move(mvkey2), std::move(mv2)); [ 0:14] 183 assert(m.size() == 11); [ 0:14] 184 assert(mv2.moved()); // was moved from [ 0:14] 185 assert(mvkey2.moved()); // was moved from [ 0:14] 186 assert(r->first.get() == 3); // key [ 0:14] 187 assert(r->second.get() == 5); // value [ 0:14] 188 } [ 0:14] 189 [ 0:14] 190 return 0; [ 0:14] 191 } [ 0:14] # no errors were expected but one was found anyway