[ 0:00] compiling /home/xrockai/src/divine/nightly/test/libcxx/containers/try.emplace.pass.cpp [ 0:00] In file included from /home/xrockai/src/divine/nightly/test/libcxx/containers/try.emplace.pass.cpp:27: [ 0:00] In file included from /dios/libcxx/include/map:479: [ 0:00] In file included from /dios/libcxx/include/__tree:14: [ 0:00] In file included from /dios/libcxx/include/iterator:420: [ 0:00] In file included from /dios/libcxx/include/iosfwd:95: [ 0:00] In file included from /dios/libcxx/include/wchar.h:118: [ 0:00] In file included from /dios/include/wchar.h:9: [ 0:00] In file included from /dios/include/_PDCLIB/int.h:16: [ 0:00] /dios/include/_PDCLIB/cdefs.h:69:10: warning: Unsupported _ _cplusplus (__cplusplus) (too new) (supported: ISO/IEC 14882:1997, ISO/IEC 14882:2011). [ 0:00] #warning Unsupported _ _cplusplus (__cplusplus) (too new) (supported: ISO/IEC 14882:1997, ISO/IEC 14882:2011). [ 0:00] ^ [ 0:00] 1 warning generated. [ 0:01] compiling /dios/lib/config/seqklee.bc [ 0:01] setting up pass: functionmeta, options = [ 0:03] setting up pass: fuse-ctors, options = [ 0:03] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.10/_klee_out" [ 0:06] KLEE: Using Z3 solver backend [ 0:06] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:06] 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:06] [ 0:06] KLEE: WARNING: undefined reference to function: _Z10klee_abortv [ 0:11] 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] KLEE: WARNING ONCE: Using zero size array fix for landingpad instruction filter [ 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: 83669 [ 0:11] Stack: [ 0:11] #000083669 in __dios_start (l=2, argc=1, argv=94323948007944, envp=94323948068872) at /dios/libc/sys/start.cpp:87 [ 0:11] #100031498 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:11] #200092249 in klee_boot (argc=2, argv=94323917696384) 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 // UNSUPPORTED: c++98, c++03, c++11, c++14 [ 0:11] 13 [ 0:11] 14 // [ 0:11] 15 [ 0:11] 16 // class map [ 0:11] 17 [ 0:11] 18 // template [ 0:11] 19 // pair try_emplace(const key_type& k, Args&&... args); // C++17 [ 0:11] 20 // template [ 0:11] 21 // pair try_emplace(key_type&& k, Args&&... args); // C++17 [ 0:11] 22 // template [ 0:11] 23 // iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17 [ 0:11] 24 // template [ 0:11] 25 // iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17 [ 0:11] 26 [ 0:11] 27 #include [ 0:11] 28 #include [ 0:11] 29 #include [ 0:11] 30 [ 0:11] 31 #include "test_macros.h" [ 0:11] 32 [ 0:11] 33 class Moveable [ 0:11] 34 { [ 0:11] 35 Moveable(const Moveable&); [ 0:11] 36 Moveable& operator=(const Moveable&); [ 0:11] 37 [ 0:11] 38 int int_; [ 0:11] 39 double double_; [ 0:11] 40 public: [ 0:11] 41 Moveable() : int_(0), double_(0) {} [ 0:11] 42 Moveable(int i, double d) : int_(i), double_(d) {} [ 0:11] 43 Moveable(Moveable&& x) [ 0:11] 44 : int_(x.int_), double_(x.double_) [ 0:11] 45 {x.int_ = -1; x.double_ = -1;} [ 0:11] 46 Moveable& operator=(Moveable&& x) [ 0:11] 47 {int_ = x.int_; x.int_ = -1; [ 0:11] 48 double_ = x.double_; x.double_ = -1; [ 0:11] 49 return *this; [ 0:11] 50 } [ 0:11] 51 [ 0:11] 52 bool operator==(const Moveable& x) const [ 0:11] 53 {return int_ == x.int_ && double_ == x.double_;} [ 0:11] 54 bool operator<(const Moveable& x) const [ 0:11] 55 {return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);} [ 0:11] 56 [ 0:11] 57 int get() const {return int_;} [ 0:11] 58 bool moved() const {return int_ == -1;} [ 0:11] 59 }; [ 0:11] 60 [ 0:11] 61 [ 0:11] 62 int main(int, char**) [ 0:11] 63 { [ 0:11] 64 { // pair try_emplace(const key_type& k, Args&&... args); [ 0:11] 65 typedef std::map M; [ 0:11] 66 typedef std::pair R; [ 0:11] 67 M m; [ 0:11] 68 R r; [ 0:11] 69 for (int i = 0; i < 20; i += 2) [ 0:11] 70 m.emplace (i, Moveable(i, (double) i)); [ 0:11] 71 assert(m.size() == 10); [ 0:11] 72 [ 0:11] 73 Moveable mv1(3, 3.0); [ 0:11] 74 for (int i=0; i < 20; i += 2) [ 0:11] 75 { [ 0:11] 76 r = m.try_emplace(i, std::move(mv1)); [ 0:11] 77 assert(m.size() == 10); [ 0:11] 78 assert(!r.second); // was not inserted [ 0:11] 79 assert(!mv1.moved()); // was not moved from [ 0:11] 80 assert(r.first->first == i); // key [ 0:11] 81 } [ 0:11] 82 [ 0:11] 83 r = m.try_emplace(-1, std::move(mv1)); [ 0:11] 84 assert(m.size() == 11); [ 0:11] 85 assert(r.second); // was inserted [ 0:11] 86 assert(mv1.moved()); // was moved from [ 0:11] 87 assert(r.first->first == -1); // key [ 0:11] 88 assert(r.first->second.get() == 3); // value [ 0:11] 89 [ 0:11] 90 Moveable mv2(5, 3.0); [ 0:11] 91 r = m.try_emplace(5, std::move(mv2)); [ 0:11] 92 assert(m.size() == 12); [ 0:11] 93 assert(r.second); // was inserted [ 0:11] 94 assert(mv2.moved()); // was moved from [ 0:11] 95 assert(r.first->first == 5); // key [ 0:11] 96 assert(r.first->second.get() == 5); // value [ 0:11] 97 [ 0:11] 98 Moveable mv3(-1, 3.0); [ 0:11] 99 r = m.try_emplace(117, std::move(mv2)); [ 0:11] 100 assert(m.size() == 13); [ 0:11] 101 assert(r.second); // was inserted [ 0:11] 102 assert(mv2.moved()); // was moved from [ 0:11] 103 assert(r.first->first == 117); // key [ 0:11] 104 assert(r.first->second.get() == -1); // value [ 0:11] 105 } [ 0:11] 106 [ 0:11] 107 { // pair try_emplace(key_type&& k, Args&&... args); [ 0:11] 108 typedef std::map M; [ 0:11] 109 typedef std::pair R; [ 0:11] 110 M m; [ 0:11] 111 R r; [ 0:11] 112 for ( int i = 0; i < 20; i += 2 ) [ 0:11] 113 m.emplace ( Moveable(i, (double) i), Moveable(i+1, (double) i+1)); [ 0:11] 114 assert(m.size() == 10); [ 0:11] 115 [ 0:11] 116 Moveable mvkey1(2, 2.0); [ 0:11] 117 Moveable mv1(4, 4.0); [ 0:11] 118 r = m.try_emplace(std::move(mvkey1), std::move(mv1)); [ 0:11] 119 assert(m.size() == 10); [ 0:11] 120 assert(!r.second); // was not inserted [ 0:11] 121 assert(!mv1.moved()); // was not moved from [ 0:11] 122 assert(!mvkey1.moved()); // was not moved from [ 0:11] 123 assert(r.first->first == mvkey1); // key [ 0:11] 124 [ 0:11] 125 Moveable mvkey2(3, 3.0); [ 0:11] 126 r = m.try_emplace(std::move(mvkey2), std::move(mv1)); [ 0:11] 127 assert(m.size() == 11); [ 0:11] 128 assert(r.second); // was inserted [ 0:11] 129 assert(mv1.moved()); // was moved from [ 0:11] 130 assert(mvkey2.moved()); // was moved from [ 0:11] 131 assert(r.first->first.get() == 3); // key [ 0:11] 132 assert(r.first->second.get() == 4); // value [ 0:11] 133 } [ 0:11] 134 [ 0:11] 135 { // iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); [ 0:11] 136 typedef std::map M; [ 0:11] 137 M m; [ 0:11] 138 M::iterator r; [ 0:11] 139 for ( int i = 0; i < 20; i += 2 ) [ 0:11] 140 m.try_emplace ( i, Moveable(i, (double) i)); [ 0:11] 141 assert(m.size() == 10); [ 0:11] 142 M::const_iterator it = m.find(2); [ 0:11] 143 [ 0:11] 144 Moveable mv1(3, 3.0); [ 0:11] 145 for (int i=0; i < 20; i += 2) [ 0:11] 146 { [ 0:11] 147 r = m.try_emplace(it, i, std::move(mv1)); [ 0:11] 148 assert(m.size() == 10); [ 0:11] 149 assert(!mv1.moved()); // was not moved from [ 0:11] 150 assert(r->first == i); // key [ 0:11] 151 assert(r->second.get() == i); // value [ 0:11] 152 } [ 0:11] 153 [ 0:11] 154 r = m.try_emplace(it, 3, std::move(mv1)); [ 0:11] 155 assert(m.size() == 11); [ 0:11] 156 assert(mv1.moved()); // was moved from [ 0:11] 157 assert(r->first == 3); // key [ 0:11] 158 assert(r->second.get() == 3); // value [ 0:11] 159 } [ 0:11] 160 [ 0:11] 161 { // iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); [ 0:11] 162 typedef std::map M; [ 0:11] 163 M m; [ 0:11] 164 M::iterator r; [ 0:11] 165 for ( int i = 0; i < 20; i += 2 ) [ 0:11] 166 m.emplace ( Moveable(i, (double) i), Moveable(i+1, (double) i+1)); [ 0:11] 167 assert(m.size() == 10); [ 0:11] 168 M::const_iterator it = std::next(m.cbegin()); [ 0:11] 169 [ 0:11] 170 Moveable mvkey1(2, 2.0); [ 0:11] 171 Moveable mv1(4, 4.0); [ 0:11] 172 r = m.try_emplace(it, std::move(mvkey1), std::move(mv1)); [ 0:11] 173 assert(m.size() == 10); [ 0:11] 174 assert(!mv1.moved()); // was not moved from [ 0:11] 175 assert(!mvkey1.moved()); // was not moved from [ 0:11] 176 assert(r->first == mvkey1); // key [ 0:11] 177 [ 0:11] 178 Moveable mvkey2(3, 3.0); [ 0:11] 179 r = m.try_emplace(it, std::move(mvkey2), std::move(mv1)); [ 0:11] 180 assert(m.size() == 11); [ 0:11] 181 assert(mv1.moved()); // was moved from [ 0:11] 182 assert(mvkey2.moved()); // was moved from [ 0:11] 183 assert(r->first.get() == 3); // key [ 0:11] 184 assert(r->second.get() == 4); // value [ 0:11] 185 } [ 0:11] 186 [ 0:11] 187 return 0; [ 0:11] 188 } [ 0:11] # no errors were expected but one was found anyway