[ 0:00] compiling /home/xrockai/src/divine/nightly/test/libcxx/containers/span.pass.cpp [ 0:00] In file included from /home/xrockai/src/divine/nightly/test/libcxx/containers/span.pass.cpp:24: [ 0:00] In file included from /dios/libcxx/include/span:132: [ 0:00] In file included from /dios/libcxx/include/cstddef:44: [ 0:00] In file included from /dios/include/stddef.h:10: [ 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:02] compiling /dios/lib/config/seqklee.bc [ 0:02] setting up pass: functionmeta, options = [ 0:02] setting up pass: fuse-ctors, options = [ 0:02] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.1/_klee_out" [ 0:04] KLEE: Using Z3 solver backend [ 0:04] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:04] 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:04] [ 0:04] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:07] KLEE: WARNING: undefined reference to function: klee_free [ 0:07] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:07] i:1 [ 0:07] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:07] about to __boot:0 [ 0:07] about to run the scheduler:0 [ 0:07] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:07] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:07] KLEE: NOTE: now ignoring this error at this location [ 0:07] KLEE: ERROR: EXITING ON ERROR: [ 0:07] Error: failed external call: __dios_tainted_init [ 0:07] File: /dios/libc/sys/start.cpp [ 0:07] Line: 87 [ 0:07] assembly.ll line: 35167 [ 0:07] Stack: [ 0:07] #000035167 in __dios_start (l=2, argc=1, argv=94357864907784, envp=94357864968712) at /dios/libc/sys/start.cpp:87 [ 0:07] #100011176 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:07] #200043415 in klee_boot (argc=2, argv=94357833276160) at /dios/arch/klee/boot.c:41 [ 0:07] [ 0:07] [ 0:07] 1 /* TAGS: c++ fin */ [ 0:07] 2 /* CC_OPTS: -std=c++2a */ [ 0:07] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:07] 4 // -*- C++ -*- [ 0:07] 5 //===------------------------------ span ---------------------------------===// [ 0:07] 6 // [ 0:07] 7 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:07] 8 // See https://llvm.org/LICENSE.txt for license information. [ 0:07] 9 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:07] 10 // [ 0:07] 11 //===---------------------------------------------------------------------===// [ 0:07] 12 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 [ 0:07] 13 [ 0:07] 14 // [ 0:07] 15 [ 0:07] 16 // template [ 0:07] 17 // constexpr span(const span& s) noexcept; [ 0:07] 18 // [ 0:07] 19 // Remarks: This constructor shall not participate in overload resolution unless: [ 0:07] 20 // Extent == dynamic_extent || Extent == OtherExtent is true, and [ 0:07] 21 // OtherElementType(*)[] is convertible to ElementType(*)[]. [ 0:07] 22 [ 0:07] 23 [ 0:07] 24 #include [ 0:07] 25 #include [ 0:07] 26 #include [ 0:07] 27 [ 0:07] 28 #include "test_macros.h" [ 0:07] 29 [ 0:07] 30 void checkCV() [ 0:07] 31 { [ 0:07] 32 std::span< int> sp; [ 0:07] 33 // std::span csp; [ 0:07] 34 std::span< volatile int> vsp; [ 0:07] 35 // std::span cvsp; [ 0:07] 36 [ 0:07] 37 std::span< int, 0> sp0; [ 0:07] 38 // std::span csp0; [ 0:07] 39 std::span< volatile int, 0> vsp0; [ 0:07] 40 // std::span cvsp0; [ 0:07] 41 [ 0:07] 42 // dynamic -> dynamic [ 0:07] 43 { [ 0:07] 44 std::span s1{ sp}; // a span pointing at int. [ 0:07] 45 std::span< volatile int> s2{ sp}; // a span< volatile int> pointing at int. [ 0:07] 46 std::span s3{ sp}; // a span pointing at int. [ 0:07] 47 std::span s4{ vsp}; // a span pointing at volatile int. [ 0:07] 48 assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); [ 0:07] 49 } [ 0:07] 50 [ 0:07] 51 // static -> static [ 0:07] 52 { [ 0:07] 53 std::span s1{ sp0}; // a span pointing at int. [ 0:07] 54 std::span< volatile int, 0> s2{ sp0}; // a span< volatile int> pointing at int. [ 0:07] 55 std::span s3{ sp0}; // a span pointing at int. [ 0:07] 56 std::span s4{ vsp0}; // a span pointing at volatile int. [ 0:07] 57 assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); [ 0:07] 58 } [ 0:07] 59 [ 0:07] 60 // static -> dynamic [ 0:07] 61 { [ 0:07] 62 std::span s1{ sp0}; // a span pointing at int. [ 0:07] 63 std::span< volatile int> s2{ sp0}; // a span< volatile int> pointing at int. [ 0:07] 64 std::span s3{ sp0}; // a span pointing at int. [ 0:07] 65 std::span s4{ vsp0}; // a span pointing at volatile int. [ 0:07] 66 assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); [ 0:07] 67 } [ 0:07] 68 [ 0:07] 69 // dynamic -> static [ 0:07] 70 { [ 0:07] 71 std::span s1{ sp}; // a span pointing at int. [ 0:07] 72 std::span< volatile int, 0> s2{ sp}; // a span< volatile int> pointing at int. [ 0:07] 73 std::span s3{ sp}; // a span pointing at int. [ 0:07] 74 std::span s4{ vsp}; // a span pointing at volatile int. [ 0:07] 75 assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); [ 0:07] 76 } [ 0:07] 77 } [ 0:07] 78 [ 0:07] 79 [ 0:07] 80 template [ 0:07] 81 constexpr bool testConstexprSpan() [ 0:07] 82 { [ 0:07] 83 std::span s0{}; [ 0:07] 84 std::span s1(s0); // dynamic -> static [ 0:07] 85 std::span s2(s1); // static -> dynamic [ 0:07] 86 ASSERT_NOEXCEPT(std::span {s0}); [ 0:07] 87 ASSERT_NOEXCEPT(std::span{s1}); [ 0:07] 88 ASSERT_NOEXCEPT(std::span {s1}); [ 0:07] 89 ASSERT_NOEXCEPT(std::span{s0}); [ 0:07] 90 [ 0:07] 91 return [ 0:07] 92 s1.data() == nullptr && s1.size() == 0 [ 0:07] 93 && s2.data() == nullptr && s2.size() == 0; [ 0:07] 94 } [ 0:07] 95 [ 0:07] 96 [ 0:07] 97 template [ 0:07] 98 void testRuntimeSpan() [ 0:07] 99 { [ 0:07] 100 std::span s0{}; [ 0:07] 101 std::span s1(s0); // dynamic -> static [ 0:07] 102 std::span s2(s1); // static -> dynamic [ 0:07] 103 ASSERT_NOEXCEPT(std::span {s0}); [ 0:07] 104 ASSERT_NOEXCEPT(std::span{s1}); [ 0:07] 105 ASSERT_NOEXCEPT(std::span {s1}); [ 0:07] 106 ASSERT_NOEXCEPT(std::span{s0}); [ 0:07] 107 [ 0:07] 108 assert(s1.data() == nullptr && s1.size() == 0); [ 0:07] 109 assert(s2.data() == nullptr && s2.size() == 0); [ 0:07] 110 } [ 0:07] 111 [ 0:07] 112 [ 0:07] 113 template [ 0:07] 114 bool testConversionSpan() [ 0:07] 115 { [ 0:07] 116 static_assert(std::is_convertible_v, "Bad input types to 'testConversionSpan"); [ 0:07] 117 std::span s0d{}; [ 0:07] 118 std::span s0s{}; [ 0:07] 119 std::span s1(s0d); // dynamic -> static [ 0:07] 120 std::span s2(s0s); // static -> dynamic [ 0:07] 121 s1.data() == nullptr && s1.size() == 0 [ 0:07] 122 && s2.data() == nullptr && s2.size() == 0; [ 0:07] 123 } [ 0:07] 124 [ 0:07] 125 struct A{}; [ 0:07] 126 [ 0:07] 127 int main(int, char**) [ 0:07] 128 { [ 0:07] 129 static_assert(testConstexprSpan(), ""); [ 0:07] 130 static_assert(testConstexprSpan(), ""); [ 0:07] 131 static_assert(testConstexprSpan(), ""); [ 0:07] 132 static_assert(testConstexprSpan(), ""); [ 0:07] 133 [ 0:07] 134 testRuntimeSpan(); [ 0:07] 135 testRuntimeSpan(); [ 0:07] 136 testRuntimeSpan(); [ 0:07] 137 testRuntimeSpan(); [ 0:07] 138 testRuntimeSpan(); [ 0:07] 139 [ 0:07] 140 // TODO: Add some conversion tests here that aren't "X --> const X" [ 0:07] 141 // assert((testConversionSpan())); [ 0:07] 142 [ 0:07] 143 checkCV(); [ 0:07] 144 [ 0:07] 145 return 0; [ 0:07] 146 } [ 0:07] # no errors were expected but one was found anyway