[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/containers/subspan.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/containers/subspan.pass.cpp:25: [ 0:01] In file included from /dios/libcxx/include/span:132: [ 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.23/_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: 76417 [ 0:11] Stack: [ 0:11] #000076417 in __dios_start (l=2, argc=1, argv=94718696894984, envp=94718696955912) at /dios/libc/sys/start.cpp:87 [ 0:11] #100024419 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:11] #200084997 in klee_boot (argc=2, argv=94718668385664) 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 // -*- C++ -*- [ 0:11] 5 //===------------------------------ span ---------------------------------===// [ 0:11] 6 // [ 0:11] 7 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:11] 8 // See https://llvm.org/LICENSE.txt for license information. [ 0:11] 9 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:11] 10 // [ 0:11] 11 //===---------------------------------------------------------------------===// [ 0:11] 12 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 [ 0:11] 13 [ 0:11] 14 // [ 0:11] 15 [ 0:11] 16 // template [ 0:11] 17 // constexpr span subspan() const; [ 0:11] 18 // [ 0:11] 19 // constexpr span subspan( [ 0:11] 20 // index_type offset, index_type count = dynamic_extent) const; [ 0:11] 21 // [ 0:11] 22 // Requires: (0 <= Offset && Offset <= size()) [ 0:11] 23 // && (Count == dynamic_extent || Count >= 0 && Offset + Count <= size()) [ 0:11] 24 [ 0:11] 25 #include [ 0:11] 26 #include [ 0:11] 27 #include [ 0:11] 28 #include [ 0:11] 29 [ 0:11] 30 #include "test_macros.h" [ 0:11] 31 [ 0:11] 32 template [ 0:11] 33 constexpr bool testConstexprSpan(Span sp) [ 0:11] 34 { [ 0:11] 35 LIBCPP_ASSERT((noexcept(sp.template subspan()))); [ 0:11] 36 LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count)))); [ 0:11] 37 auto s1 = sp.template subspan(); [ 0:11] 38 auto s2 = sp.subspan(Offset, Count); [ 0:11] 39 using S1 = decltype(s1); [ 0:11] 40 using S2 = decltype(s2); [ 0:11] 41 ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); [ 0:11] 42 ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); [ 0:11] 43 static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Count), ""); [ 0:11] 44 static_assert(S2::extent == std::dynamic_extent, ""); [ 0:11] 45 return [ 0:11] 46 s1.data() == s2.data() [ 0:11] 47 && s1.size() == s2.size() [ 0:11] 48 && std::equal(s1.begin(), s1.end(), sp.begin() + Offset); [ 0:11] 49 } [ 0:11] 50 [ 0:11] 51 template [ 0:11] 52 constexpr bool testConstexprSpan(Span sp) [ 0:11] 53 { [ 0:11] 54 LIBCPP_ASSERT((noexcept(sp.template subspan()))); [ 0:11] 55 LIBCPP_ASSERT((noexcept(sp.subspan(Offset)))); [ 0:11] 56 auto s1 = sp.template subspan(); [ 0:11] 57 auto s2 = sp.subspan(Offset); [ 0:11] 58 using S1 = decltype(s1); [ 0:11] 59 using S2 = decltype(s2); [ 0:11] 60 ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); [ 0:11] 61 ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); [ 0:11] 62 static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), ""); [ 0:11] 63 static_assert(S2::extent == std::dynamic_extent, ""); [ 0:11] 64 return [ 0:11] 65 s1.data() == s2.data() [ 0:11] 66 && s1.size() == s2.size() [ 0:11] 67 && std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end()); [ 0:11] 68 } [ 0:11] 69 [ 0:11] 70 [ 0:11] 71 template [ 0:11] 72 void testRuntimeSpan(Span sp) [ 0:11] 73 { [ 0:11] 74 LIBCPP_ASSERT((noexcept(sp.template subspan()))); [ 0:11] 75 LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count)))); [ 0:11] 76 auto s1 = sp.template subspan(); [ 0:11] 77 auto s2 = sp.subspan(Offset, Count); [ 0:11] 78 using S1 = decltype(s1); [ 0:11] 79 using S2 = decltype(s2); [ 0:11] 80 ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); [ 0:11] 81 ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); [ 0:11] 82 static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Count), ""); [ 0:11] 83 static_assert(S2::extent == std::dynamic_extent, ""); [ 0:11] 84 assert(s1.data() == s2.data()); [ 0:11] 85 assert(s1.size() == s2.size()); [ 0:11] 86 assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset)); [ 0:11] 87 } [ 0:11] 88 [ 0:11] 89 [ 0:11] 90 template [ 0:11] 91 void testRuntimeSpan(Span sp) [ 0:11] 92 { [ 0:11] 93 LIBCPP_ASSERT((noexcept(sp.template subspan()))); [ 0:11] 94 LIBCPP_ASSERT((noexcept(sp.subspan(Offset)))); [ 0:11] 95 auto s1 = sp.template subspan(); [ 0:11] 96 auto s2 = sp.subspan(Offset); [ 0:11] 97 using S1 = decltype(s1); [ 0:11] 98 using S2 = decltype(s2); [ 0:11] 99 ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); [ 0:11] 100 ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); [ 0:11] 101 static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), ""); [ 0:11] 102 static_assert(S2::extent == std::dynamic_extent, ""); [ 0:11] 103 assert(s1.data() == s2.data()); [ 0:11] 104 assert(s1.size() == s2.size()); [ 0:11] 105 assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end())); [ 0:11] 106 } [ 0:11] 107 [ 0:11] 108 [ 0:11] 109 constexpr int carr1[] = {1,2,3,4}; [ 0:11] 110 int arr1[] = {5,6,7}; [ 0:11] 111 [ 0:11] 112 int main(int, char**) [ 0:11] 113 { [ 0:11] 114 { [ 0:11] 115 using Sp = std::span; [ 0:11] 116 static_assert(testConstexprSpan(Sp{}), ""); [ 0:11] 117 [ 0:11] 118 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 119 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 120 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 121 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 122 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 123 [ 0:11] 124 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 125 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 126 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 127 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 128 } [ 0:11] 129 [ 0:11] 130 { [ 0:11] 131 using Sp = std::span; [ 0:11] 132 [ 0:11] 133 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 134 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 135 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 136 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 137 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 138 [ 0:11] 139 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 140 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 141 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 142 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 143 } [ 0:11] 144 [ 0:11] 145 { [ 0:11] 146 using Sp = std::span; [ 0:11] 147 static_assert(testConstexprSpan(Sp{}), ""); [ 0:11] 148 [ 0:11] 149 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 150 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 151 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 152 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 153 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 154 } [ 0:11] 155 [ 0:11] 156 { [ 0:11] 157 using Sp = std::span; [ 0:11] 158 [ 0:11] 159 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 160 [ 0:11] 161 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 162 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 163 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 164 static_assert(testConstexprSpan(Sp{carr1}), ""); [ 0:11] 165 } [ 0:11] 166 [ 0:11] 167 { [ 0:11] 168 using Sp = std::span; [ 0:11] 169 testRuntimeSpan(Sp{}); [ 0:11] 170 [ 0:11] 171 testRuntimeSpan(Sp{arr1}); [ 0:11] 172 testRuntimeSpan(Sp{arr1}); [ 0:11] 173 testRuntimeSpan(Sp{arr1}); [ 0:11] 174 testRuntimeSpan(Sp{arr1}); [ 0:11] 175 [ 0:11] 176 testRuntimeSpan(Sp{arr1}); [ 0:11] 177 testRuntimeSpan(Sp{arr1}); [ 0:11] 178 testRuntimeSpan(Sp{arr1}); [ 0:11] 179 } [ 0:11] 180 [ 0:11] 181 { [ 0:11] 182 using Sp = std::span; [ 0:11] 183 [ 0:11] 184 testRuntimeSpan(Sp{arr1}); [ 0:11] 185 testRuntimeSpan(Sp{arr1}); [ 0:11] 186 testRuntimeSpan(Sp{arr1}); [ 0:11] 187 testRuntimeSpan(Sp{arr1}); [ 0:11] 188 [ 0:11] 189 testRuntimeSpan(Sp{arr1}); [ 0:11] 190 testRuntimeSpan(Sp{arr1}); [ 0:11] 191 testRuntimeSpan(Sp{arr1}); [ 0:11] 192 } [ 0:11] 193 [ 0:11] 194 { [ 0:11] 195 using Sp = std::span; [ 0:11] 196 testRuntimeSpan(Sp{}); [ 0:11] 197 [ 0:11] 198 testRuntimeSpan(Sp{arr1}); [ 0:11] 199 testRuntimeSpan(Sp{arr1}); [ 0:11] 200 testRuntimeSpan(Sp{arr1}); [ 0:11] 201 testRuntimeSpan(Sp{arr1}); [ 0:11] 202 } [ 0:11] 203 [ 0:11] 204 { [ 0:11] 205 using Sp = std::span; [ 0:11] 206 [ 0:11] 207 testRuntimeSpan(Sp{arr1}); [ 0:11] 208 testRuntimeSpan(Sp{arr1}); [ 0:11] 209 testRuntimeSpan(Sp{arr1}); [ 0:11] 210 testRuntimeSpan(Sp{arr1}); [ 0:11] 211 } [ 0:11] 212 [ 0:11] 213 return 0; [ 0:11] 214 } [ 0:11] # no errors were expected but one was found anyway