[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/algorithms/search_pred.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/algorithms/search_pred.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:02] setting up pass: fuse-ctors, options = [ 0:02] 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: __dios_tainted_init [ 0:10] KLEE: WARNING: undefined reference to function: klee_free [ 0:10] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:10] i:1 [ 0:10] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:10] about to __boot:0 [ 0:10] about to run the scheduler:0 [ 0:10] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:10] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:10] KLEE: NOTE: now ignoring this error at this location [ 0:10] KLEE: ERROR: EXITING ON ERROR: [ 0:10] Error: failed external call: __dios_tainted_init [ 0:10] File: /dios/libc/sys/start.cpp [ 0:10] Line: 87 [ 0:10] assembly.ll line: 54303 [ 0:10] Stack: [ 0:10] #000054303 in __dios_start (l=2, argc=1, argv=93904850227720, envp=93904850296840) at /dios/libc/sys/start.cpp:87 [ 0:10] #100030312 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:10] #200062551 in klee_boot (argc=2, argv=93904816527360) at /dios/arch/klee/boot.c:41 [ 0:10] [ 0:10] [ 0:10] 1 /* TAGS: c++ fin */ [ 0:10] 2 /* CC_OPTS: -std=c++2a */ [ 0:10] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:10] 4 //===----------------------------------------------------------------------===// [ 0:10] 5 // [ 0:10] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:10] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:10] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:10] 9 // [ 0:10] 10 //===----------------------------------------------------------------------===// [ 0:10] 11 [ 0:10] 12 // [ 0:10] 13 [ 0:10] 14 // template [ 0:10] 15 // requires HasEqualTo [ 0:10] 16 // constexpr Iter1 // constexpr after C++17 [ 0:10] 17 // search(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); [ 0:10] 18 [ 0:10] 19 #include [ 0:10] 20 #include [ 0:10] 21 [ 0:10] 22 #include "test_macros.h" [ 0:10] 23 #include "test_iterators.h" [ 0:10] 24 [ 0:10] 25 #if TEST_STD_VER > 17 [ 0:10] 26 TEST_CONSTEXPR bool eq(int a, int b) { return a == b; } [ 0:10] 27 [ 0:10] 28 TEST_CONSTEXPR bool test_constexpr() { [ 0:10] 29 int ia[] = {0, 1, 2, 3}; [ 0:10] 30 int ib[] = {0, 1, 5, 3}; [ 0:10] 31 int ic[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; [ 0:10] 32 return (std::search(std::begin(ic), std::end(ic), std::begin(ia), std::end(ia), eq) == ic+3) [ 0:10] 33 && (std::search(std::begin(ic), std::end(ic), std::begin(ib), std::end(ib), eq) == std::end(ic)) [ 0:10] 34 ; [ 0:10] 35 } [ 0:10] 36 #endif [ 0:10] 37 [ 0:10] 38 struct count_equal [ 0:10] 39 { [ 0:10] 40 static unsigned count; [ 0:10] 41 template [ 0:10] 42 bool operator()(const T& x, const T& y) [ 0:10] 43 {++count; return x == y;} [ 0:10] 44 }; [ 0:10] 45 [ 0:10] 46 unsigned count_equal::count = 0; [ 0:10] 47 [ 0:10] 48 template [ 0:10] 49 void [ 0:10] 50 test() [ 0:10] 51 { [ 0:10] 52 int ia[] = {0, 1, 2, 3, 4, 5}; [ 0:10] 53 const unsigned sa = sizeof(ia)/sizeof(ia[0]); [ 0:10] 54 count_equal::count = 0; [ 0:10] 55 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), count_equal()) == Iter1(ia)); [ 0:10] 56 assert(count_equal::count <= 0); [ 0:10] 57 count_equal::count = 0; [ 0:10] 58 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), count_equal()) == Iter1(ia)); [ 0:10] 59 assert(count_equal::count <= sa); [ 0:10] 60 count_equal::count = 0; [ 0:10] 61 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), count_equal()) == Iter1(ia+1)); [ 0:10] 62 assert(count_equal::count <= sa); [ 0:10] 63 count_equal::count = 0; [ 0:10] 64 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), count_equal()) == Iter1(ia)); [ 0:10] 65 assert(count_equal::count <= 0); [ 0:10] 66 count_equal::count = 0; [ 0:10] 67 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), count_equal()) == Iter1(ia+2)); [ 0:10] 68 assert(count_equal::count <= sa); [ 0:10] 69 count_equal::count = 0; [ 0:10] 70 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), count_equal()) == Iter1(ia+2)); [ 0:10] 71 assert(count_equal::count <= sa); [ 0:10] 72 count_equal::count = 0; [ 0:10] 73 assert(std::search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), count_equal()) == Iter1(ia)); [ 0:10] 74 assert(count_equal::count <= 0); [ 0:10] 75 count_equal::count = 0; [ 0:10] 76 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), count_equal()) == Iter1(ia+sa-1)); [ 0:10] 77 assert(count_equal::count <= sa); [ 0:10] 78 count_equal::count = 0; [ 0:10] 79 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), count_equal()) == Iter1(ia+sa-3)); [ 0:10] 80 assert(count_equal::count <= sa*3); [ 0:10] 81 count_equal::count = 0; [ 0:10] 82 assert(std::search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), count_equal()) == Iter1(ia)); [ 0:10] 83 assert(count_equal::count <= sa*sa); [ 0:10] 84 count_equal::count = 0; [ 0:10] 85 assert(std::search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), count_equal()) == Iter1(ia+sa-1)); [ 0:10] 86 assert(count_equal::count <= (sa-1)*sa); [ 0:10] 87 count_equal::count = 0; [ 0:10] 88 assert(std::search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), count_equal()) == Iter1(ia+1)); [ 0:10] 89 assert(count_equal::count <= sa); [ 0:10] 90 count_equal::count = 0; [ 0:10] 91 int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; [ 0:10] 92 const unsigned sb = sizeof(ib)/sizeof(ib[0]); [ 0:10] 93 int ic[] = {1}; [ 0:10] 94 assert(std::search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), count_equal()) == Iter1(ib+1)); [ 0:10] 95 assert(count_equal::count <= sb); [ 0:10] 96 count_equal::count = 0; [ 0:10] 97 int id[] = {1, 2}; [ 0:10] 98 assert(std::search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), count_equal()) == Iter1(ib+1)); [ 0:10] 99 assert(count_equal::count <= sb*2); [ 0:10] 100 count_equal::count = 0; [ 0:10] 101 int ie[] = {1, 2, 3}; [ 0:10] 102 assert(std::search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), count_equal()) == Iter1(ib+4)); [ 0:10] 103 assert(count_equal::count <= sb*3); [ 0:10] 104 count_equal::count = 0; [ 0:10] 105 int ig[] = {1, 2, 3, 4}; [ 0:10] 106 assert(std::search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), count_equal()) == Iter1(ib+8)); [ 0:10] 107 assert(count_equal::count <= sb*4); [ 0:10] 108 count_equal::count = 0; [ 0:10] 109 int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; [ 0:10] 110 const unsigned sh = sizeof(ih)/sizeof(ih[0]); [ 0:10] 111 int ii[] = {1, 1, 2}; [ 0:10] 112 assert(std::search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), count_equal()) == Iter1(ih+3)); [ 0:10] 113 assert(count_equal::count <= sh*3); [ 0:10] 114 } [ 0:10] 115 [ 0:10] 116 int main(int, char**) [ 0:10] 117 { [ 0:10] 118 test, forward_iterator >(); [ 0:10] 119 test, bidirectional_iterator >(); [ 0:10] 120 test, random_access_iterator >(); [ 0:10] 121 test, forward_iterator >(); [ 0:10] 122 test, bidirectional_iterator >(); [ 0:10] 123 test, random_access_iterator >(); [ 0:10] 124 test, forward_iterator >(); [ 0:10] 125 test, bidirectional_iterator >(); [ 0:10] 126 test, random_access_iterator >(); [ 0:10] 127 [ 0:10] 128 #if TEST_STD_VER > 17 [ 0:10] 129 static_assert(test_constexpr()); [ 0:10] 130 #endif [ 0:10] 131 [ 0:10] 132 return 0; [ 0:10] 133 } [ 0:10] # no errors were expected but one was found anyway