[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/iterators/begin-end.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/iterators/begin-end.pass.cpp:37: [ 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:03] setting up pass: fuse-ctors, options = [ 0:03] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.14/_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: _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:12] i:1 [ 0:12] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:12] about to __boot:0 [ 0:12] about to run the scheduler:0 [ 0:12] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:12] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:12] KLEE: NOTE: now ignoring this error at this location [ 0:12] KLEE: ERROR: EXITING ON ERROR: [ 0:12] Error: failed external call: __dios_tainted_init [ 0:12] File: /dios/libc/sys/start.cpp [ 0:12] Line: 87 [ 0:12] assembly.ll line: 80401 [ 0:12] Stack: [ 0:12] #000080401 in __dios_start (l=2, argc=1, argv=94879547704328, envp=94879547757064) at /dios/libc/sys/start.cpp:87 [ 0:12] #100028230 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:12] #200088981 in klee_boot (argc=2, argv=94879512595840) at /dios/arch/klee/boot.c:41 [ 0:12] [ 0:12] [ 0:12] 1 /* TAGS: c++ fin */ [ 0:12] 2 /* CC_OPTS: -std=c++2a */ [ 0:12] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:12] 4 //===----------------------------------------------------------------------===// [ 0:12] 5 // [ 0:12] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:12] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:12] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:12] 9 // [ 0:12] 10 //===----------------------------------------------------------------------===// [ 0:12] 11 [ 0:12] 12 // XFAIL: c++98, c++03 [ 0:12] 13 [ 0:12] 14 // [ 0:12] 15 // template constexpr auto begin(C& c) -> decltype(c.begin()); [ 0:12] 16 // template constexpr auto begin(const C& c) -> decltype(c.begin()); [ 0:12] 17 // template constexpr auto cbegin(const C& c) -> decltype(std::begin(c)); // C++14 [ 0:12] 18 // template constexpr auto cend(const C& c) -> decltype(std::end(c)); // C++14 [ 0:12] 19 // template constexpr auto end (C& c) -> decltype(c.end()); [ 0:12] 20 // template constexpr auto end (const C& c) -> decltype(c.end()); [ 0:12] 21 // template constexpr reverse_iterator rbegin(initializer_list il); [ 0:12] 22 // template constexpr reverse_iterator rend (initializer_list il); [ 0:12] 23 // [ 0:12] 24 // template auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14 [ 0:12] 25 // template auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14 [ 0:12] 26 // template auto constexpr rend(C& c) -> decltype(c.rend()); // C++14 [ 0:12] 27 // template constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14 [ 0:12] 28 // template reverse_iterator constexpr rbegin(T (&array)[N]); // C++14 [ 0:12] 29 // template reverse_iterator constexpr rend(T (&array)[N]); // C++14 [ 0:12] 30 // template constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14 [ 0:12] 31 // template constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14 [ 0:12] 32 // [ 0:12] 33 // All of these are constexpr in C++17 [ 0:12] 34 [ 0:12] 35 #include "test_macros.h" [ 0:12] 36 [ 0:12] 37 #include [ 0:12] 38 #include [ 0:12] 39 #include [ 0:12] 40 #include [ 0:12] 41 #include [ 0:12] 42 #include [ 0:12] 43 [ 0:12] 44 // std::array is explicitly allowed to be initialized with A a = { init-list };. [ 0:12] 45 // Disable the missing braces warning for this reason. [ 0:12] 46 #include "disable_missing_braces_warning.h" [ 0:12] 47 [ 0:12] 48 template [ 0:12] 49 void test_const_container( const C & c, typename C::value_type val ) { [ 0:12] 50 assert ( std::begin(c) == c.begin()); [ 0:12] 51 assert (*std::begin(c) == val ); [ 0:12] 52 assert ( std::begin(c) != c.end()); [ 0:12] 53 assert ( std::end(c) == c.end()); [ 0:12] 54 #if TEST_STD_VER > 11 [ 0:12] 55 assert ( std::cbegin(c) == c.cbegin()); [ 0:12] 56 assert ( std::cbegin(c) != c.cend()); [ 0:12] 57 assert ( std::cend(c) == c.cend()); [ 0:12] 58 assert ( std::rbegin(c) == c.rbegin()); [ 0:12] 59 assert ( std::rbegin(c) != c.rend()); [ 0:12] 60 assert ( std::rend(c) == c.rend()); [ 0:12] 61 assert ( std::crbegin(c) == c.crbegin()); [ 0:12] 62 assert ( std::crbegin(c) != c.crend()); [ 0:12] 63 assert ( std::crend(c) == c.crend()); [ 0:12] 64 #endif [ 0:12] 65 } [ 0:12] 66 [ 0:12] 67 template [ 0:12] 68 void test_const_container( const std::initializer_list & c, T val ) { [ 0:12] 69 assert ( std::begin(c) == c.begin()); [ 0:12] 70 assert (*std::begin(c) == val ); [ 0:12] 71 assert ( std::begin(c) != c.end()); [ 0:12] 72 assert ( std::end(c) == c.end()); [ 0:12] 73 #if TEST_STD_VER > 11 [ 0:12] 74 // initializer_list doesn't have cbegin/cend/rbegin/rend [ 0:12] 75 // but std::cbegin(),etc work (b/c they're general fn templates) [ 0:12] 76 // assert ( std::cbegin(c) == c.cbegin()); [ 0:12] 77 // assert ( std::cbegin(c) != c.cend()); [ 0:12] 78 // assert ( std::cend(c) == c.cend()); [ 0:12] 79 // assert ( std::rbegin(c) == c.rbegin()); [ 0:12] 80 // assert ( std::rbegin(c) != c.rend()); [ 0:12] 81 // assert ( std::rend(c) == c.rend()); [ 0:12] 82 // assert ( std::crbegin(c) == c.crbegin()); [ 0:12] 83 // assert ( std::crbegin(c) != c.crend()); [ 0:12] 84 // assert ( std::crend(c) == c.crend()); [ 0:12] 85 #endif [ 0:12] 86 } [ 0:12] 87 [ 0:12] 88 template [ 0:12] 89 void test_container( C & c, typename C::value_type val ) { [ 0:12] 90 assert ( std::begin(c) == c.begin()); [ 0:12] 91 assert (*std::begin(c) == val ); [ 0:12] 92 assert ( std::begin(c) != c.end()); [ 0:12] 93 assert ( std::end(c) == c.end()); [ 0:12] 94 #if TEST_STD_VER > 11 [ 0:12] 95 assert ( std::cbegin(c) == c.cbegin()); [ 0:12] 96 assert ( std::cbegin(c) != c.cend()); [ 0:12] 97 assert ( std::cend(c) == c.cend()); [ 0:12] 98 assert ( std::rbegin(c) == c.rbegin()); [ 0:12] 99 assert ( std::rbegin(c) != c.rend()); [ 0:12] 100 assert ( std::rend(c) == c.rend()); [ 0:12] 101 assert ( std::crbegin(c) == c.crbegin()); [ 0:12] 102 assert ( std::crbegin(c) != c.crend()); [ 0:12] 103 assert ( std::crend(c) == c.crend()); [ 0:12] 104 #endif [ 0:12] 105 } [ 0:12] 106 [ 0:12] 107 template [ 0:12] 108 void test_container( std::initializer_list & c, T val ) { [ 0:12] 109 assert ( std::begin(c) == c.begin()); [ 0:12] 110 assert (*std::begin(c) == val ); [ 0:12] 111 assert ( std::begin(c) != c.end()); [ 0:12] 112 assert ( std::end(c) == c.end()); [ 0:12] 113 #if TEST_STD_VER > 11 [ 0:12] 114 // initializer_list doesn't have cbegin/cend/rbegin/rend [ 0:12] 115 // assert ( std::cbegin(c) == c.cbegin()); [ 0:12] 116 // assert ( std::cbegin(c) != c.cend()); [ 0:12] 117 // assert ( std::cend(c) == c.cend()); [ 0:12] 118 // assert ( std::rbegin(c) == c.rbegin()); [ 0:12] 119 // assert ( std::rbegin(c) != c.rend()); [ 0:12] 120 // assert ( std::rend(c) == c.rend()); [ 0:12] 121 // assert ( std::crbegin(c) == c.crbegin()); [ 0:12] 122 // assert ( std::crbegin(c) != c.crend()); [ 0:12] 123 // assert ( std::crend(c) == c.crend()); [ 0:12] 124 #endif [ 0:12] 125 } [ 0:12] 126 [ 0:12] 127 template [ 0:12] 128 void test_const_array( const T (&array)[Sz] ) { [ 0:12] 129 assert ( std::begin(array) == array ); [ 0:12] 130 assert (*std::begin(array) == array[0] ); [ 0:12] 131 assert ( std::begin(array) != std::end(array)); [ 0:12] 132 assert ( std::end(array) == array + Sz); [ 0:12] 133 #if TEST_STD_VER > 11 [ 0:12] 134 assert ( std::cbegin(array) == array ); [ 0:12] 135 assert (*std::cbegin(array) == array[0] ); [ 0:12] 136 assert ( std::cbegin(array) != std::cend(array)); [ 0:12] 137 assert ( std::cend(array) == array + Sz); [ 0:12] 138 #endif [ 0:12] 139 } [ 0:12] 140 [ 0:12] 141 int main(int, char**) { [ 0:12] 142 std::vector v; v.push_back(1); [ 0:12] 143 std::list l; l.push_back(2); [ 0:12] 144 std::array a; a[0] = 3; [ 0:12] 145 std::initializer_list il = { 4 }; [ 0:12] 146 [ 0:12] 147 test_container ( v, 1 ); [ 0:12] 148 test_container ( l, 2 ); [ 0:12] 149 test_container ( a, 3 ); [ 0:12] 150 test_container ( il, 4 ); [ 0:12] 151 [ 0:12] 152 test_const_container ( v, 1 ); [ 0:12] 153 test_const_container ( l, 2 ); [ 0:12] 154 test_const_container ( a, 3 ); [ 0:12] 155 test_const_container ( il, 4 ); [ 0:12] 156 [ 0:12] 157 static constexpr int arrA [] { 1, 2, 3 }; [ 0:12] 158 test_const_array ( arrA ); [ 0:12] 159 #if TEST_STD_VER > 11 [ 0:12] 160 constexpr const int *b = std::cbegin(arrA); [ 0:12] 161 constexpr const int *e = std::cend(arrA); [ 0:12] 162 static_assert(e - b == 3, ""); [ 0:12] 163 #endif [ 0:12] 164 [ 0:12] 165 #if TEST_STD_VER > 14 [ 0:12] 166 { [ 0:12] 167 typedef std::array C; [ 0:12] 168 constexpr const C c{0,1,2,3,4}; [ 0:12] 169 [ 0:12] 170 static_assert ( c.begin() == std::begin(c), ""); [ 0:12] 171 static_assert ( c.cbegin() == std::cbegin(c), ""); [ 0:12] 172 static_assert ( c.end() == std::end(c), ""); [ 0:12] 173 static_assert ( c.cend() == std::cend(c), ""); [ 0:12] 174 [ 0:12] 175 static_assert ( c.rbegin() == std::rbegin(c), ""); [ 0:12] 176 static_assert ( c.crbegin() == std::crbegin(c), ""); [ 0:12] 177 static_assert ( c.rend() == std::rend(c), ""); [ 0:12] 178 static_assert ( c.crend() == std::crend(c), ""); [ 0:12] 179 [ 0:12] 180 static_assert ( std::begin(c) != std::end(c), ""); [ 0:12] 181 static_assert ( std::rbegin(c) != std::rend(c), ""); [ 0:12] 182 static_assert ( std::cbegin(c) != std::cend(c), ""); [ 0:12] 183 static_assert ( std::crbegin(c) != std::crend(c), ""); [ 0:12] 184 [ 0:12] 185 static_assert ( *c.begin() == 0, ""); [ 0:12] 186 static_assert ( *c.rbegin() == 4, ""); [ 0:12] 187 [ 0:12] 188 static_assert ( *std::begin(c) == 0, "" ); [ 0:12] 189 static_assert ( *std::cbegin(c) == 0, "" ); [ 0:12] 190 static_assert ( *std::rbegin(c) == 4, "" ); [ 0:12] 191 static_assert ( *std::crbegin(c) == 4, "" ); [ 0:12] 192 } [ 0:12] 193 [ 0:12] 194 { [ 0:12] 195 static constexpr const int c[] = {0,1,2,3,4}; [ 0:12] 196 [ 0:12] 197 static_assert ( *std::begin(c) == 0, "" ); [ 0:12] 198 static_assert ( *std::cbegin(c) == 0, "" ); [ 0:12] 199 static_assert ( *std::rbegin(c) == 4, "" ); [ 0:12] 200 static_assert ( *std::crbegin(c) == 4, "" ); [ 0:12] 201 } [ 0:12] 202 #endif [ 0:12] 203 [ 0:12] 204 return 0; [ 0:12] 205 } [ 0:12] # no errors were expected but one was found anyway