[ 0:00] compiling /home/xrockai/src/divine/nightly/test/libcxx/strings/compare.sv.pass.cpp [ 0:00] In file included from /home/xrockai/src/divine/nightly/test/libcxx/strings/compare.sv.pass.cpp:16: [ 0:00] In file included from /dios/libcxx/include/string_view:175: [ 0:00] In file included from /dios/libcxx/include/__string:56: [ 0:00] In file included from /dios/libcxx/include/algorithm:639: [ 0:00] In file included from /dios/libcxx/include/initializer_list:46: [ 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: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.12/_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:10] 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] KLEE: WARNING ONCE: Using zero size array fix for landingpad instruction filter [ 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: 65745 [ 0:10] Stack: [ 0:10] #000065745 in __dios_start (l=2, argc=1, argv=94245548593672, envp=94245548654600) at /dios/libc/sys/start.cpp:87 [ 0:10] #100013672 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:10] #200074325 in klee_boot (argc=2, argv=94245516602752) 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 // constexpr int compare(basic_string_view str) const noexcept; [ 0:10] 15 [ 0:10] 16 #include [ 0:10] 17 #include [ 0:10] 18 [ 0:10] 19 #include "test_macros.h" [ 0:10] 20 #include "constexpr_char_traits.hpp" [ 0:10] 21 [ 0:10] 22 int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } [ 0:10] 23 [ 0:10] 24 template [ 0:10] 25 void test1 ( std::basic_string_view sv1, [ 0:10] 26 std::basic_string_view sv2, int expected ) { [ 0:10] 27 assert ( sign( sv1.compare(sv2)) == sign(expected)); [ 0:10] 28 } [ 0:10] 29 [ 0:10] 30 [ 0:10] 31 template [ 0:10] 32 void test ( const CharT *s1, const CharT *s2, int expected ) { [ 0:10] 33 typedef std::basic_string_view string_view_t; [ 0:10] 34 [ 0:10] 35 string_view_t sv1 ( s1 ); [ 0:10] 36 string_view_t sv2 ( s2 ); [ 0:10] 37 test1(sv1, sv2, expected); [ 0:10] 38 } [ 0:10] 39 [ 0:10] 40 int main(int, char**) { [ 0:10] 41 [ 0:10] 42 test("", "", 0); [ 0:10] 43 test("", "abcde", -5); [ 0:10] 44 test("", "abcdefghij", -10); [ 0:10] 45 test("", "abcdefghijklmnopqrst", -20); [ 0:10] 46 test("abcde", "", 5); [ 0:10] 47 test("abcde", "abcde", 0); [ 0:10] 48 test("abcde", "abcdefghij", -5); [ 0:10] 49 test("abcde", "abcdefghijklmnopqrst", -15); [ 0:10] 50 test("abcdefghij", "", 10); [ 0:10] 51 test("abcdefghij", "abcde", 5); [ 0:10] 52 test("abcdefghij", "abcdefghij", 0); [ 0:10] 53 test("abcdefghij", "abcdefghijklmnopqrst", -10); [ 0:10] 54 test("abcdefghijklmnopqrst", "", 20); [ 0:10] 55 test("abcdefghijklmnopqrst", "abcde", 15); [ 0:10] 56 test("abcdefghijklmnopqrst", "abcdefghij", 10); [ 0:10] 57 test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0); [ 0:10] 58 [ 0:10] 59 test(L"", L"", 0); [ 0:10] 60 test(L"", L"abcde", -5); [ 0:10] 61 test(L"", L"abcdefghij", -10); [ 0:10] 62 test(L"", L"abcdefghijklmnopqrst", -20); [ 0:10] 63 test(L"abcde", L"", 5); [ 0:10] 64 test(L"abcde", L"abcde", 0); [ 0:10] 65 test(L"abcde", L"abcdefghij", -5); [ 0:10] 66 test(L"abcde", L"abcdefghijklmnopqrst", -15); [ 0:10] 67 test(L"abcdefghij", L"", 10); [ 0:10] 68 test(L"abcdefghij", L"abcde", 5); [ 0:10] 69 test(L"abcdefghij", L"abcdefghij", 0); [ 0:10] 70 test(L"abcdefghij", L"abcdefghijklmnopqrst", -10); [ 0:10] 71 test(L"abcdefghijklmnopqrst", L"", 20); [ 0:10] 72 test(L"abcdefghijklmnopqrst", L"abcde", 15); [ 0:10] 73 test(L"abcdefghijklmnopqrst", L"abcdefghij", 10); [ 0:10] 74 test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0); [ 0:10] 75 [ 0:10] 76 #if TEST_STD_VER >= 11 [ 0:10] 77 test(u"", u"", 0); [ 0:10] 78 test(u"", u"abcde", -5); [ 0:10] 79 test(u"", u"abcdefghij", -10); [ 0:10] 80 test(u"", u"abcdefghijklmnopqrst", -20); [ 0:10] 81 test(u"abcde", u"", 5); [ 0:10] 82 test(u"abcde", u"abcde", 0); [ 0:10] 83 test(u"abcde", u"abcdefghij", -5); [ 0:10] 84 test(u"abcde", u"abcdefghijklmnopqrst", -15); [ 0:10] 85 test(u"abcdefghij", u"", 10); [ 0:10] 86 test(u"abcdefghij", u"abcde", 5); [ 0:10] 87 test(u"abcdefghij", u"abcdefghij", 0); [ 0:10] 88 test(u"abcdefghij", u"abcdefghijklmnopqrst", -10); [ 0:10] 89 test(u"abcdefghijklmnopqrst", u"", 20); [ 0:10] 90 test(u"abcdefghijklmnopqrst", u"abcde", 15); [ 0:10] 91 test(u"abcdefghijklmnopqrst", u"abcdefghij", 10); [ 0:10] 92 test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0); [ 0:10] 93 [ 0:10] 94 test(U"", U"", 0); [ 0:10] 95 test(U"", U"abcde", -5); [ 0:10] 96 test(U"", U"abcdefghij", -10); [ 0:10] 97 test(U"", U"abcdefghijklmnopqrst", -20); [ 0:10] 98 test(U"abcde", U"", 5); [ 0:10] 99 test(U"abcde", U"abcde", 0); [ 0:10] 100 test(U"abcde", U"abcdefghij", -5); [ 0:10] 101 test(U"abcde", U"abcdefghijklmnopqrst", -15); [ 0:10] 102 test(U"abcdefghij", U"", 10); [ 0:10] 103 test(U"abcdefghij", U"abcde", 5); [ 0:10] 104 test(U"abcdefghij", U"abcdefghij", 0); [ 0:10] 105 test(U"abcdefghij", U"abcdefghijklmnopqrst", -10); [ 0:10] 106 test(U"abcdefghijklmnopqrst", U"", 20); [ 0:10] 107 test(U"abcdefghijklmnopqrst", U"abcde", 15); [ 0:10] 108 test(U"abcdefghijklmnopqrst", U"abcdefghij", 10); [ 0:10] 109 test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0); [ 0:10] 110 #endif [ 0:10] 111 [ 0:10] 112 #if TEST_STD_VER > 11 [ 0:10] 113 { [ 0:10] 114 typedef std::basic_string_view> SV; [ 0:10] 115 constexpr SV sv1 { "abcde", 5 }; [ 0:10] 116 constexpr SV sv2 { "abcde", 5 }; [ 0:10] 117 constexpr SV sv3 { "edcba0", 6 }; [ 0:10] 118 static_assert ( sv1.compare(sv2) == 0, "" ); [ 0:10] 119 static_assert ( sv2.compare(sv1) == 0, "" ); [ 0:10] 120 static_assert ( sv3.compare(sv2) > 0, "" ); [ 0:10] 121 static_assert ( sv2.compare(sv3) < 0, "" ); [ 0:10] 122 } [ 0:10] 123 #endif [ 0:10] 124 [ 0:10] 125 return 0; [ 0:10] 126 } [ 0:10] # no errors were expected but one was found anyway