[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/algorithms/fill_n.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/algorithms/fill_n.pass.cpp:19: [ 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.8/_klee_out" [ 0:05] KLEE: Using Z3 solver backend [ 0:05] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:05] 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:05] [ 0:05] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:08] KLEE: WARNING: undefined reference to function: klee_free [ 0:08] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:08] i:1 [ 0:08] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:08] about to __boot:0 [ 0:08] about to run the scheduler:0 [ 0:08] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:08] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:08] KLEE: NOTE: now ignoring this error at this location [ 0:08] KLEE: ERROR: EXITING ON ERROR: [ 0:08] Error: failed external call: __dios_tainted_init [ 0:08] File: /dios/libc/sys/start.cpp [ 0:08] Line: 87 [ 0:08] assembly.ll line: 37248 [ 0:08] Stack: [ 0:08] #000037248 in __dios_start (l=2, argc=1, argv=94153839915528, envp=94153839976456) at /dios/libc/sys/start.cpp:87 [ 0:08] #100013257 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:08] #200045496 in klee_boot (argc=2, argv=94153812613120) at /dios/arch/klee/boot.c:41 [ 0:08] [ 0:08] [ 0:08] 1 /* TAGS: c++ fin */ [ 0:08] 2 /* CC_OPTS: -std=c++2a */ [ 0:08] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:08] 4 //===----------------------------------------------------------------------===// [ 0:08] 5 // [ 0:08] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:08] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:08] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:08] 9 // [ 0:08] 10 //===----------------------------------------------------------------------===// [ 0:08] 11 [ 0:08] 12 // [ 0:08] 13 [ 0:08] 14 // template [ 0:08] 15 // requires OutputIterator [ 0:08] 16 // constexpr OutputIterator // constexpr after C++17 [ 0:08] 17 // fill_n(Iter first, Size n, const T& value); [ 0:08] 18 [ 0:08] 19 #include [ 0:08] 20 #include [ 0:08] 21 [ 0:08] 22 #include "test_macros.h" [ 0:08] 23 #include "test_iterators.h" [ 0:08] 24 #include "user_defined_integral.hpp" [ 0:08] 25 [ 0:08] 26 #if TEST_STD_VER > 17 [ 0:08] 27 TEST_CONSTEXPR bool test_constexpr() { [ 0:08] 28 const size_t N = 5; [ 0:08] 29 int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N [ 0:08] 30 [ 0:08] 31 auto it = std::fill_n(std::begin(ib), N, 5); [ 0:08] 32 return it == (std::begin(ib) + N) [ 0:08] 33 && std::all_of(std::begin(ib), it, [](int a) {return a == 5; }) [ 0:08] 34 && *it == 0 // don't overwrite the last value in the output array [ 0:08] 35 ; [ 0:08] 36 } [ 0:08] 37 #endif [ 0:08] 38 [ 0:08] 39 typedef UserDefinedIntegral UDI; [ 0:08] 40 [ 0:08] 41 template [ 0:08] 42 void [ 0:08] 43 test_char() [ 0:08] 44 { [ 0:08] 45 const unsigned n = 4; [ 0:08] 46 char ca[n] = {0}; [ 0:08] 47 assert(std::fill_n(Iter(ca), UDI(n), char(1)) == std::next(Iter(ca), n)); [ 0:08] 48 assert(ca[0] == 1); [ 0:08] 49 assert(ca[1] == 1); [ 0:08] 50 assert(ca[2] == 1); [ 0:08] 51 assert(ca[3] == 1); [ 0:08] 52 } [ 0:08] 53 [ 0:08] 54 template [ 0:08] 55 void [ 0:08] 56 test_int() [ 0:08] 57 { [ 0:08] 58 const unsigned n = 4; [ 0:08] 59 int ia[n] = {0}; [ 0:08] 60 assert(std::fill_n(Iter(ia), UDI(n), 1) == std::next(Iter(ia), n)); [ 0:08] 61 assert(ia[0] == 1); [ 0:08] 62 assert(ia[1] == 1); [ 0:08] 63 assert(ia[2] == 1); [ 0:08] 64 assert(ia[3] == 1); [ 0:08] 65 } [ 0:08] 66 [ 0:08] 67 void [ 0:08] 68 test_int_array() [ 0:08] 69 { [ 0:08] 70 const unsigned n = 4; [ 0:08] 71 int ia[n] = {0}; [ 0:08] 72 assert(std::fill_n(ia, UDI(n), static_cast(1)) == std::next(ia, n)); [ 0:08] 73 assert(ia[0] == 1); [ 0:08] 74 assert(ia[1] == 1); [ 0:08] 75 assert(ia[2] == 1); [ 0:08] 76 assert(ia[3] == 1); [ 0:08] 77 } [ 0:08] 78 [ 0:08] 79 struct source { [ 0:08] 80 source() : i(0) { } [ 0:08] 81 [ 0:08] 82 operator int() const { return i++; } [ 0:08] 83 mutable int i; [ 0:08] 84 }; [ 0:08] 85 [ 0:08] 86 void [ 0:08] 87 test_int_array_struct_source() [ 0:08] 88 { [ 0:08] 89 const unsigned n = 4; [ 0:08] 90 int ia[n] = {0}; [ 0:08] 91 assert(std::fill_n(ia, UDI(n), source()) == std::next(ia, n)); [ 0:08] 92 assert(ia[0] == 0); [ 0:08] 93 assert(ia[1] == 1); [ 0:08] 94 assert(ia[2] == 2); [ 0:08] 95 assert(ia[3] == 3); [ 0:08] 96 } [ 0:08] 97 [ 0:08] 98 struct test1 { [ 0:08] 99 test1() : c(0) { } [ 0:08] 100 test1(char xc) : c(xc + 1) { } [ 0:08] 101 char c; [ 0:08] 102 }; [ 0:08] 103 [ 0:08] 104 void [ 0:08] 105 test_struct_array() [ 0:08] 106 { [ 0:08] 107 const unsigned n = 4; [ 0:08] 108 test1 test1a[n] = {0}; [ 0:08] 109 assert(std::fill_n(test1a, UDI(n), static_cast(10)) == std::next(test1a, n)); [ 0:08] 110 assert(test1a[0].c == 11); [ 0:08] 111 assert(test1a[1].c == 11); [ 0:08] 112 assert(test1a[2].c == 11); [ 0:08] 113 assert(test1a[3].c == 11); [ 0:08] 114 } [ 0:08] 115 [ 0:08] 116 class A [ 0:08] 117 { [ 0:08] 118 char a_; [ 0:08] 119 public: [ 0:08] 120 A() {} [ 0:08] 121 explicit A(char a) : a_(a) {} [ 0:08] 122 operator unsigned char() const {return 'b';} [ 0:08] 123 [ 0:08] 124 friend bool operator==(const A& x, const A& y) [ 0:08] 125 {return x.a_ == y.a_;} [ 0:08] 126 }; [ 0:08] 127 [ 0:08] 128 void [ 0:08] 129 test5() [ 0:08] 130 { [ 0:08] 131 A a[3]; [ 0:08] 132 assert(std::fill_n(&a[0], UDI(3), A('a')) == a+3); [ 0:08] 133 assert(a[0] == A('a')); [ 0:08] 134 assert(a[1] == A('a')); [ 0:08] 135 assert(a[2] == A('a')); [ 0:08] 136 } [ 0:08] 137 [ 0:08] 138 struct Storage [ 0:08] 139 { [ 0:08] 140 union [ 0:08] 141 { [ 0:08] 142 unsigned char a; [ 0:08] 143 unsigned char b; [ 0:08] 144 }; [ 0:08] 145 }; [ 0:08] 146 [ 0:08] 147 void test6() [ 0:08] 148 { [ 0:08] 149 Storage foo[5]; [ 0:08] 150 std::fill_n(&foo[0], UDI(5), Storage()); [ 0:08] 151 } [ 0:08] 152 [ 0:08] 153 [ 0:08] 154 int main(int, char**) [ 0:08] 155 { [ 0:08] 156 test_char >(); [ 0:08] 157 test_char >(); [ 0:08] 158 test_char >(); [ 0:08] 159 test_char(); [ 0:08] 160 [ 0:08] 161 test_int >(); [ 0:08] 162 test_int >(); [ 0:08] 163 test_int >(); [ 0:08] 164 test_int(); [ 0:08] 165 [ 0:08] 166 test_int_array(); [ 0:08] 167 test_int_array_struct_source(); [ 0:08] 168 test_struct_array(); [ 0:08] 169 [ 0:08] 170 test5(); [ 0:08] 171 test6(); [ 0:08] 172 [ 0:08] 173 #if TEST_STD_VER > 17 [ 0:08] 174 static_assert(test_constexpr()); [ 0:08] 175 #endif [ 0:08] 176 [ 0:08] 177 return 0; [ 0:08] 178 } [ 0:08] # no errors were expected but one was found anyway