[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/algorithms/unique.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/algorithms/unique.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: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.6/_klee_out" [ 0:07] KLEE: Using Z3 solver backend [ 0:07] 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:08] [ 0:08] 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: 87272 [ 0:14] Stack: [ 0:14] #000087272 in __dios_start (l=2, argc=1, argv=94870532608520, envp=94870532669448) at /dios/libc/sys/start.cpp:87 [ 0:14] #100035274 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:14] #200095852 in klee_boot (argc=2, argv=94870501895552) 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 // [ 0:14] 13 [ 0:14] 14 // template [ 0:14] 15 // requires OutputIterator [ 0:14] 16 // && EqualityComparable [ 0:14] 17 // constexpr Iter // constexpr after C++17 [ 0:14] 18 // unique(Iter first, Iter last); [ 0:14] 19 [ 0:14] 20 #include [ 0:14] 21 #include [ 0:14] 22 #include [ 0:14] 23 [ 0:14] 24 #include "test_macros.h" [ 0:14] 25 #include "test_iterators.h" [ 0:14] 26 [ 0:14] 27 #if TEST_STD_VER > 17 [ 0:14] 28 TEST_CONSTEXPR bool test_constexpr() { [ 0:14] 29 int ia[] = {0, 1, 1, 3, 4}; [ 0:14] 30 const int expected[] = {0, 1, 3, 4}; [ 0:14] 31 const size_t N = 4; [ 0:14] 32 [ 0:14] 33 auto it = std::unique(std::begin(ia), std::end(ia)); [ 0:14] 34 return it == (std::begin(ia) + N) [ 0:14] 35 && std::equal(std::begin(ia), it, std::begin(expected), std::end(expected)) [ 0:14] 36 ; [ 0:14] 37 } [ 0:14] 38 #endif [ 0:14] 39 [ 0:14] 40 template [ 0:14] 41 void [ 0:14] 42 test() [ 0:14] 43 { [ 0:14] 44 int ia[] = {0}; [ 0:14] 45 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:14] 46 Iter r = std::unique(Iter(ia), Iter(ia+sa)); [ 0:14] 47 assert(base(r) == ia + sa); [ 0:14] 48 assert(ia[0] == 0); [ 0:14] 49 [ 0:14] 50 int ib[] = {0, 1}; [ 0:14] 51 const unsigned sb = sizeof(ib)/sizeof(ib[0]); [ 0:14] 52 r = std::unique(Iter(ib), Iter(ib+sb)); [ 0:14] 53 assert(base(r) == ib + sb); [ 0:14] 54 assert(ib[0] == 0); [ 0:14] 55 assert(ib[1] == 1); [ 0:14] 56 [ 0:14] 57 int ic[] = {0, 0}; [ 0:14] 58 const unsigned sc = sizeof(ic)/sizeof(ic[0]); [ 0:14] 59 r = std::unique(Iter(ic), Iter(ic+sc)); [ 0:14] 60 assert(base(r) == ic + 1); [ 0:14] 61 assert(ic[0] == 0); [ 0:14] 62 [ 0:14] 63 int id[] = {0, 0, 1}; [ 0:14] 64 const unsigned sd = sizeof(id)/sizeof(id[0]); [ 0:14] 65 r = std::unique(Iter(id), Iter(id+sd)); [ 0:14] 66 assert(base(r) == id + 2); [ 0:14] 67 assert(id[0] == 0); [ 0:14] 68 assert(id[1] == 1); [ 0:14] 69 [ 0:14] 70 int ie[] = {0, 0, 1, 0}; [ 0:14] 71 const unsigned se = sizeof(ie)/sizeof(ie[0]); [ 0:14] 72 r = std::unique(Iter(ie), Iter(ie+se)); [ 0:14] 73 assert(base(r) == ie + 3); [ 0:14] 74 assert(ie[0] == 0); [ 0:14] 75 assert(ie[1] == 1); [ 0:14] 76 assert(ie[2] == 0); [ 0:14] 77 [ 0:14] 78 int ig[] = {0, 0, 1, 1}; [ 0:14] 79 const unsigned sg = sizeof(ig)/sizeof(ig[0]); [ 0:14] 80 r = std::unique(Iter(ig), Iter(ig+sg)); [ 0:14] 81 assert(base(r) == ig + 2); [ 0:14] 82 assert(ig[0] == 0); [ 0:14] 83 assert(ig[1] == 1); [ 0:14] 84 [ 0:14] 85 int ih[] = {0, 1, 1}; [ 0:14] 86 const unsigned sh = sizeof(ih)/sizeof(ih[0]); [ 0:14] 87 r = std::unique(Iter(ih), Iter(ih+sh)); [ 0:14] 88 assert(base(r) == ih + 2); [ 0:14] 89 assert(ih[0] == 0); [ 0:14] 90 assert(ih[1] == 1); [ 0:14] 91 [ 0:14] 92 int ii[] = {0, 1, 1, 1, 2, 2, 2}; [ 0:14] 93 const unsigned si = sizeof(ii)/sizeof(ii[0]); [ 0:14] 94 r = std::unique(Iter(ii), Iter(ii+si)); [ 0:14] 95 assert(base(r) == ii + 3); [ 0:14] 96 assert(ii[0] == 0); [ 0:14] 97 assert(ii[1] == 1); [ 0:14] 98 assert(ii[2] == 2); [ 0:14] 99 } [ 0:14] 100 [ 0:14] 101 #if TEST_STD_VER >= 11 [ 0:14] 102 [ 0:14] 103 struct do_nothing [ 0:14] 104 { [ 0:14] 105 void operator()(void*) const {} [ 0:14] 106 }; [ 0:14] 107 [ 0:14] 108 typedef std::unique_ptr Ptr; [ 0:14] 109 [ 0:14] 110 template [ 0:14] 111 void [ 0:14] 112 test1() [ 0:14] 113 { [ 0:14] 114 int one = 1; [ 0:14] 115 int two = 2; [ 0:14] 116 Ptr ia[1]; [ 0:14] 117 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:14] 118 Iter r = std::unique(Iter(ia), Iter(ia+sa)); [ 0:14] 119 assert(base(r) == ia + sa); [ 0:14] 120 assert(ia[0] == 0); [ 0:14] 121 [ 0:14] 122 Ptr ib[2]; [ 0:14] 123 ib[1].reset(&one); [ 0:14] 124 const unsigned sb = sizeof(ib)/sizeof(ib[0]); [ 0:14] 125 r = std::unique(Iter(ib), Iter(ib+sb)); [ 0:14] 126 assert(base(r) == ib + sb); [ 0:14] 127 assert(ib[0] == 0); [ 0:14] 128 assert(*ib[1] == 1); [ 0:14] 129 [ 0:14] 130 Ptr ic[2]; [ 0:14] 131 const unsigned sc = sizeof(ic)/sizeof(ic[0]); [ 0:14] 132 r = std::unique(Iter(ic), Iter(ic+sc)); [ 0:14] 133 assert(base(r) == ic + 1); [ 0:14] 134 assert(ic[0] == 0); [ 0:14] 135 [ 0:14] 136 Ptr id[3]; [ 0:14] 137 id[2].reset(&one); [ 0:14] 138 const unsigned sd = sizeof(id)/sizeof(id[0]); [ 0:14] 139 r = std::unique(Iter(id), Iter(id+sd)); [ 0:14] 140 assert(base(r) == id + 2); [ 0:14] 141 assert(id[0] == 0); [ 0:14] 142 assert(*id[1] == 1); [ 0:14] 143 [ 0:14] 144 Ptr ie[4]; [ 0:14] 145 ie[2].reset(&one); [ 0:14] 146 const unsigned se = sizeof(ie)/sizeof(ie[0]); [ 0:14] 147 r = std::unique(Iter(ie), Iter(ie+se)); [ 0:14] 148 assert(base(r) == ie + 3); [ 0:14] 149 assert(ie[0] == 0); [ 0:14] 150 assert(*ie[1] == 1); [ 0:14] 151 assert(ie[2] == 0); [ 0:14] 152 [ 0:14] 153 Ptr ig[4]; [ 0:14] 154 ig[2].reset(&one); [ 0:14] 155 ig[3].reset(&one); [ 0:14] 156 const unsigned sg = sizeof(ig)/sizeof(ig[0]); [ 0:14] 157 r = std::unique(Iter(ig), Iter(ig+sg)); [ 0:14] 158 assert(base(r) == ig + 2); [ 0:14] 159 assert(ig[0] == 0); [ 0:14] 160 assert(*ig[1] == 1); [ 0:14] 161 [ 0:14] 162 Ptr ih[3]; [ 0:14] 163 ih[1].reset(&one); [ 0:14] 164 ih[2].reset(&one); [ 0:14] 165 const unsigned sh = sizeof(ih)/sizeof(ih[0]); [ 0:14] 166 r = std::unique(Iter(ih), Iter(ih+sh)); [ 0:14] 167 assert(base(r) == ih + 2); [ 0:14] 168 assert(ih[0] == 0); [ 0:14] 169 assert(*ih[1] == 1); [ 0:14] 170 [ 0:14] 171 Ptr ii[7]; [ 0:14] 172 ii[1].reset(&one); [ 0:14] 173 ii[2].reset(&one); [ 0:14] 174 ii[3].reset(&one); [ 0:14] 175 ii[4].reset(&two); [ 0:14] 176 ii[5].reset(&two); [ 0:14] 177 ii[6].reset(&two); [ 0:14] 178 const unsigned si = sizeof(ii)/sizeof(ii[0]); [ 0:14] 179 r = std::unique(Iter(ii), Iter(ii+si)); [ 0:14] 180 assert(base(r) == ii + 3); [ 0:14] 181 assert(ii[0] == 0); [ 0:14] 182 assert(*ii[1] == 1); [ 0:14] 183 assert(*ii[2] == 2); [ 0:14] 184 } [ 0:14] 185 #endif // TEST_STD_VER >= 11 [ 0:14] 186 [ 0:14] 187 int main(int, char**) [ 0:14] 188 { [ 0:14] 189 test >(); [ 0:14] 190 test >(); [ 0:14] 191 test >(); [ 0:14] 192 test(); [ 0:14] 193 [ 0:14] 194 #if TEST_STD_VER >= 11 [ 0:14] 195 test1 >(); [ 0:14] 196 test1 >(); [ 0:14] 197 test1 >(); [ 0:14] 198 test1(); [ 0:14] 199 #endif [ 0:14] 200 [ 0:14] 201 #if TEST_STD_VER > 17 [ 0:14] 202 static_assert(test_constexpr()); [ 0:14] 203 #endif [ 0:14] 204 [ 0:14] 205 return 0; [ 0:14] 206 } [ 0:14] # no errors were expected but one was found anyway