[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/strings/iter_iter_string.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/strings/iter_iter_string.pass.cpp:17: [ 0:01] In file included from /dios/libcxx/include/string:504: [ 0:01] In file included from /dios/libcxx/include/string_view:175: [ 0:01] In file included from /dios/libcxx/include/__string:56: [ 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:02] compiling /dios/lib/config/seqklee.bc [ 0:02] setting up pass: functionmeta, options = [ 0:04] setting up pass: fuse-ctors, options = [ 0:04] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.3/_klee_out" [ 0:09] KLEE: Using Z3 solver backend [ 0:09] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:09] 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:09] [ 0:09] KLEE: WARNING: undefined reference to function: _Z10klee_abortv [ 0:16] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:16] KLEE: WARNING: undefined reference to function: klee_free [ 0:16] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:16] KLEE: WARNING ONCE: Using zero size array fix for landingpad instruction filter [ 0:17] i:1 [ 0:17] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:17] about to __boot:0 [ 0:17] about to run the scheduler:0 [ 0:17] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:17] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:17] KLEE: NOTE: now ignoring this error at this location [ 0:17] KLEE: ERROR: EXITING ON ERROR: [ 0:17] Error: failed external call: __dios_tainted_init [ 0:17] File: /dios/libc/sys/start.cpp [ 0:17] Line: 87 [ 0:17] assembly.ll line: 138501 [ 0:17] Stack: [ 0:17] #000138501 in __dios_start (l=2, argc=1, argv=94272336176136, envp=94272336253448) at /dios/libc/sys/start.cpp:87 [ 0:17] #100086503 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:17] #200147081 in klee_boot (argc=2, argv=94272285130240) at /dios/arch/klee/boot.c:41 [ 0:17] [ 0:17] [ 0:17] 1 /* TAGS: c++ fin */ [ 0:17] 2 /* CC_OPTS: -std=c++2a */ [ 0:17] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:17] 4 //===----------------------------------------------------------------------===// [ 0:17] 5 // [ 0:17] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:17] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:17] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:17] 9 // [ 0:17] 10 //===----------------------------------------------------------------------===// [ 0:17] 11 [ 0:17] 12 // [ 0:17] 13 [ 0:17] 14 // basic_string& [ 0:17] 15 // replace(const_iterator i1, const_iterator i2, const basic_string& str); [ 0:17] 16 [ 0:17] 17 #include [ 0:17] 18 #include [ 0:17] 19 #include [ 0:17] 20 [ 0:17] 21 #include "test_macros.h" [ 0:17] 22 #include "min_allocator.h" [ 0:17] 23 [ 0:17] 24 template [ 0:17] 25 void [ 0:17] 26 test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expected) [ 0:17] 27 { [ 0:17] 28 typename S::size_type old_size = s.size(); [ 0:17] 29 typename S::const_iterator first = s.begin() + pos1; [ 0:17] 30 typename S::const_iterator last = s.begin() + pos1 + n1; [ 0:17] 31 typename S::size_type xlen = last - first; [ 0:17] 32 s.replace(first, last, str); [ 0:17] 33 LIBCPP_ASSERT(s.__invariants()); [ 0:17] 34 assert(s == expected); [ 0:17] 35 typename S::size_type rlen = str.size(); [ 0:17] 36 assert(s.size() == old_size - xlen + rlen); [ 0:17] 37 } [ 0:17] 38 [ 0:17] 39 template [ 0:17] 40 void test0() [ 0:17] 41 { [ 0:17] 42 test(S(""), 0, 0, S(""), S("")); [ 0:17] 43 test(S(""), 0, 0, S("12345"), S("12345")); [ 0:17] 44 test(S(""), 0, 0, S("1234567890"), S("1234567890")); [ 0:17] 45 test(S(""), 0, 0, S("12345678901234567890"), S("12345678901234567890")); [ 0:17] 46 test(S("abcde"), 0, 0, S(""), S("abcde")); [ 0:17] 47 test(S("abcde"), 0, 0, S("12345"), S("12345abcde")); [ 0:17] 48 test(S("abcde"), 0, 0, S("1234567890"), S("1234567890abcde")); [ 0:17] 49 test(S("abcde"), 0, 0, S("12345678901234567890"), S("12345678901234567890abcde")); [ 0:17] 50 test(S("abcde"), 0, 1, S(""), S("bcde")); [ 0:17] 51 test(S("abcde"), 0, 1, S("12345"), S("12345bcde")); [ 0:17] 52 test(S("abcde"), 0, 1, S("1234567890"), S("1234567890bcde")); [ 0:17] 53 test(S("abcde"), 0, 1, S("12345678901234567890"), S("12345678901234567890bcde")); [ 0:17] 54 test(S("abcde"), 0, 2, S(""), S("cde")); [ 0:17] 55 test(S("abcde"), 0, 2, S("12345"), S("12345cde")); [ 0:17] 56 test(S("abcde"), 0, 2, S("1234567890"), S("1234567890cde")); [ 0:17] 57 test(S("abcde"), 0, 2, S("12345678901234567890"), S("12345678901234567890cde")); [ 0:17] 58 test(S("abcde"), 0, 4, S(""), S("e")); [ 0:17] 59 test(S("abcde"), 0, 4, S("12345"), S("12345e")); [ 0:17] 60 test(S("abcde"), 0, 4, S("1234567890"), S("1234567890e")); [ 0:17] 61 test(S("abcde"), 0, 4, S("12345678901234567890"), S("12345678901234567890e")); [ 0:17] 62 test(S("abcde"), 0, 5, S(""), S("")); [ 0:17] 63 test(S("abcde"), 0, 5, S("12345"), S("12345")); [ 0:17] 64 test(S("abcde"), 0, 5, S("1234567890"), S("1234567890")); [ 0:17] 65 test(S("abcde"), 0, 5, S("12345678901234567890"), S("12345678901234567890")); [ 0:17] 66 test(S("abcde"), 1, 0, S(""), S("abcde")); [ 0:17] 67 test(S("abcde"), 1, 0, S("12345"), S("a12345bcde")); [ 0:17] 68 test(S("abcde"), 1, 0, S("1234567890"), S("a1234567890bcde")); [ 0:17] 69 test(S("abcde"), 1, 0, S("12345678901234567890"), S("a12345678901234567890bcde")); [ 0:17] 70 test(S("abcde"), 1, 1, S(""), S("acde")); [ 0:17] 71 test(S("abcde"), 1, 1, S("12345"), S("a12345cde")); [ 0:17] 72 test(S("abcde"), 1, 1, S("1234567890"), S("a1234567890cde")); [ 0:17] 73 test(S("abcde"), 1, 1, S("12345678901234567890"), S("a12345678901234567890cde")); [ 0:17] 74 test(S("abcde"), 1, 2, S(""), S("ade")); [ 0:17] 75 test(S("abcde"), 1, 2, S("12345"), S("a12345de")); [ 0:17] 76 test(S("abcde"), 1, 2, S("1234567890"), S("a1234567890de")); [ 0:17] 77 test(S("abcde"), 1, 2, S("12345678901234567890"), S("a12345678901234567890de")); [ 0:17] 78 test(S("abcde"), 1, 3, S(""), S("ae")); [ 0:17] 79 test(S("abcde"), 1, 3, S("12345"), S("a12345e")); [ 0:17] 80 test(S("abcde"), 1, 3, S("1234567890"), S("a1234567890e")); [ 0:17] 81 test(S("abcde"), 1, 3, S("12345678901234567890"), S("a12345678901234567890e")); [ 0:17] 82 test(S("abcde"), 1, 4, S(""), S("a")); [ 0:17] 83 test(S("abcde"), 1, 4, S("12345"), S("a12345")); [ 0:17] 84 test(S("abcde"), 1, 4, S("1234567890"), S("a1234567890")); [ 0:17] 85 test(S("abcde"), 1, 4, S("12345678901234567890"), S("a12345678901234567890")); [ 0:17] 86 test(S("abcde"), 2, 0, S(""), S("abcde")); [ 0:17] 87 test(S("abcde"), 2, 0, S("12345"), S("ab12345cde")); [ 0:17] 88 test(S("abcde"), 2, 0, S("1234567890"), S("ab1234567890cde")); [ 0:17] 89 test(S("abcde"), 2, 0, S("12345678901234567890"), S("ab12345678901234567890cde")); [ 0:17] 90 test(S("abcde"), 2, 1, S(""), S("abde")); [ 0:17] 91 test(S("abcde"), 2, 1, S("12345"), S("ab12345de")); [ 0:17] 92 test(S("abcde"), 2, 1, S("1234567890"), S("ab1234567890de")); [ 0:17] 93 test(S("abcde"), 2, 1, S("12345678901234567890"), S("ab12345678901234567890de")); [ 0:17] 94 test(S("abcde"), 2, 2, S(""), S("abe")); [ 0:17] 95 test(S("abcde"), 2, 2, S("12345"), S("ab12345e")); [ 0:17] 96 test(S("abcde"), 2, 2, S("1234567890"), S("ab1234567890e")); [ 0:17] 97 test(S("abcde"), 2, 2, S("12345678901234567890"), S("ab12345678901234567890e")); [ 0:17] 98 test(S("abcde"), 2, 3, S(""), S("ab")); [ 0:17] 99 test(S("abcde"), 2, 3, S("12345"), S("ab12345")); [ 0:17] 100 test(S("abcde"), 2, 3, S("1234567890"), S("ab1234567890")); [ 0:17] 101 test(S("abcde"), 2, 3, S("12345678901234567890"), S("ab12345678901234567890")); [ 0:17] 102 test(S("abcde"), 4, 0, S(""), S("abcde")); [ 0:17] 103 test(S("abcde"), 4, 0, S("12345"), S("abcd12345e")); [ 0:17] 104 test(S("abcde"), 4, 0, S("1234567890"), S("abcd1234567890e")); [ 0:17] 105 test(S("abcde"), 4, 0, S("12345678901234567890"), S("abcd12345678901234567890e")); [ 0:17] 106 test(S("abcde"), 4, 1, S(""), S("abcd")); [ 0:17] 107 test(S("abcde"), 4, 1, S("12345"), S("abcd12345")); [ 0:17] 108 test(S("abcde"), 4, 1, S("1234567890"), S("abcd1234567890")); [ 0:17] 109 test(S("abcde"), 4, 1, S("12345678901234567890"), S("abcd12345678901234567890")); [ 0:17] 110 test(S("abcde"), 5, 0, S(""), S("abcde")); [ 0:17] 111 test(S("abcde"), 5, 0, S("12345"), S("abcde12345")); [ 0:17] 112 test(S("abcde"), 5, 0, S("1234567890"), S("abcde1234567890")); [ 0:17] 113 test(S("abcde"), 5, 0, S("12345678901234567890"), S("abcde12345678901234567890")); [ 0:17] 114 test(S("abcdefghij"), 0, 0, S(""), S("abcdefghij")); [ 0:17] 115 test(S("abcdefghij"), 0, 0, S("12345"), S("12345abcdefghij")); [ 0:17] 116 test(S("abcdefghij"), 0, 0, S("1234567890"), S("1234567890abcdefghij")); [ 0:17] 117 test(S("abcdefghij"), 0, 0, S("12345678901234567890"), S("12345678901234567890abcdefghij")); [ 0:17] 118 test(S("abcdefghij"), 0, 1, S(""), S("bcdefghij")); [ 0:17] 119 test(S("abcdefghij"), 0, 1, S("12345"), S("12345bcdefghij")); [ 0:17] 120 test(S("abcdefghij"), 0, 1, S("1234567890"), S("1234567890bcdefghij")); [ 0:17] 121 test(S("abcdefghij"), 0, 1, S("12345678901234567890"), S("12345678901234567890bcdefghij")); [ 0:17] 122 test(S("abcdefghij"), 0, 5, S(""), S("fghij")); [ 0:17] 123 test(S("abcdefghij"), 0, 5, S("12345"), S("12345fghij")); [ 0:17] 124 test(S("abcdefghij"), 0, 5, S("1234567890"), S("1234567890fghij")); [ 0:17] 125 test(S("abcdefghij"), 0, 5, S("12345678901234567890"), S("12345678901234567890fghij")); [ 0:17] 126 test(S("abcdefghij"), 0, 9, S(""), S("j")); [ 0:17] 127 test(S("abcdefghij"), 0, 9, S("12345"), S("12345j")); [ 0:17] 128 test(S("abcdefghij"), 0, 9, S("1234567890"), S("1234567890j")); [ 0:17] 129 test(S("abcdefghij"), 0, 9, S("12345678901234567890"), S("12345678901234567890j")); [ 0:17] 130 test(S("abcdefghij"), 0, 10, S(""), S("")); [ 0:17] 131 test(S("abcdefghij"), 0, 10, S("12345"), S("12345")); [ 0:17] 132 test(S("abcdefghij"), 0, 10, S("1234567890"), S("1234567890")); [ 0:17] 133 test(S("abcdefghij"), 0, 10, S("12345678901234567890"), S("12345678901234567890")); [ 0:17] 134 test(S("abcdefghij"), 1, 0, S(""), S("abcdefghij")); [ 0:17] 135 test(S("abcdefghij"), 1, 0, S("12345"), S("a12345bcdefghij")); [ 0:17] 136 test(S("abcdefghij"), 1, 0, S("1234567890"), S("a1234567890bcdefghij")); [ 0:17] 137 test(S("abcdefghij"), 1, 0, S("12345678901234567890"), S("a12345678901234567890bcdefghij")); [ 0:17] 138 test(S("abcdefghij"), 1, 1, S(""), S("acdefghij")); [ 0:17] 139 test(S("abcdefghij"), 1, 1, S("12345"), S("a12345cdefghij")); [ 0:17] 140 test(S("abcdefghij"), 1, 1, S("1234567890"), S("a1234567890cdefghij")); [ 0:17] 141 test(S("abcdefghij"), 1, 1, S("12345678901234567890"), S("a12345678901234567890cdefghij")); [ 0:17] 142 } [ 0:17] 143 [ 0:17] 144 template [ 0:17] 145 void test1() [ 0:17] 146 { [ 0:17] 147 test(S("abcdefghij"), 1, 4, S(""), S("afghij")); [ 0:17] 148 test(S("abcdefghij"), 1, 4, S("12345"), S("a12345fghij")); [ 0:17] 149 test(S("abcdefghij"), 1, 4, S("1234567890"), S("a1234567890fghij")); [ 0:17] 150 test(S("abcdefghij"), 1, 4, S("12345678901234567890"), S("a12345678901234567890fghij")); [ 0:17] 151 test(S("abcdefghij"), 1, 8, S(""), S("aj")); [ 0:17] 152 test(S("abcdefghij"), 1, 8, S("12345"), S("a12345j")); [ 0:17] 153 test(S("abcdefghij"), 1, 8, S("1234567890"), S("a1234567890j")); [ 0:17] 154 test(S("abcdefghij"), 1, 8, S("12345678901234567890"), S("a12345678901234567890j")); [ 0:17] 155 test(S("abcdefghij"), 1, 9, S(""), S("a")); [ 0:17] 156 test(S("abcdefghij"), 1, 9, S("12345"), S("a12345")); [ 0:17] 157 test(S("abcdefghij"), 1, 9, S("1234567890"), S("a1234567890")); [ 0:17] 158 test(S("abcdefghij"), 1, 9, S("12345678901234567890"), S("a12345678901234567890")); [ 0:17] 159 test(S("abcdefghij"), 5, 0, S(""), S("abcdefghij")); [ 0:17] 160 test(S("abcdefghij"), 5, 0, S("12345"), S("abcde12345fghij")); [ 0:17] 161 test(S("abcdefghij"), 5, 0, S("1234567890"), S("abcde1234567890fghij")); [ 0:17] 162 test(S("abcdefghij"), 5, 0, S("12345678901234567890"), S("abcde12345678901234567890fghij")); [ 0:17] 163 test(S("abcdefghij"), 5, 1, S(""), S("abcdeghij")); [ 0:17] 164 test(S("abcdefghij"), 5, 1, S("12345"), S("abcde12345ghij")); [ 0:17] 165 test(S("abcdefghij"), 5, 1, S("1234567890"), S("abcde1234567890ghij")); [ 0:17] 166 test(S("abcdefghij"), 5, 1, S("12345678901234567890"), S("abcde12345678901234567890ghij")); [ 0:17] 167 test(S("abcdefghij"), 5, 2, S(""), S("abcdehij")); [ 0:17] 168 test(S("abcdefghij"), 5, 2, S("12345"), S("abcde12345hij")); [ 0:17] 169 test(S("abcdefghij"), 5, 2, S("1234567890"), S("abcde1234567890hij")); [ 0:17] 170 test(S("abcdefghij"), 5, 2, S("12345678901234567890"), S("abcde12345678901234567890hij")); [ 0:17] 171 test(S("abcdefghij"), 5, 4, S(""), S("abcdej")); [ 0:17] 172 test(S("abcdefghij"), 5, 4, S("12345"), S("abcde12345j")); [ 0:17] 173 test(S("abcdefghij"), 5, 4, S("1234567890"), S("abcde1234567890j")); [ 0:17] 174 test(S("abcdefghij"), 5, 4, S("12345678901234567890"), S("abcde12345678901234567890j")); [ 0:17] 175 test(S("abcdefghij"), 5, 5, S(""), S("abcde")); [ 0:17] 176 test(S("abcdefghij"), 5, 5, S("12345"), S("abcde12345")); [ 0:17] 177 test(S("abcdefghij"), 5, 5, S("1234567890"), S("abcde1234567890")); [ 0:17] 178 test(S("abcdefghij"), 5, 5, S("12345678901234567890"), S("abcde12345678901234567890")); [ 0:17] 179 test(S("abcdefghij"), 9, 0, S(""), S("abcdefghij")); [ 0:17] 180 test(S("abcdefghij"), 9, 0, S("12345"), S("abcdefghi12345j")); [ 0:17] 181 test(S("abcdefghij"), 9, 0, S("1234567890"), S("abcdefghi1234567890j")); [ 0:17] 182 test(S("abcdefghij"), 9, 0, S("12345678901234567890"), S("abcdefghi12345678901234567890j")); [ 0:17] 183 test(S("abcdefghij"), 9, 1, S(""), S("abcdefghi")); [ 0:17] 184 test(S("abcdefghij"), 9, 1, S("12345"), S("abcdefghi12345")); [ 0:17] 185 test(S("abcdefghij"), 9, 1, S("1234567890"), S("abcdefghi1234567890")); [ 0:17] 186 test(S("abcdefghij"), 9, 1, S("12345678901234567890"), S("abcdefghi12345678901234567890")); [ 0:17] 187 test(S("abcdefghij"), 10, 0, S(""), S("abcdefghij")); [ 0:17] 188 test(S("abcdefghij"), 10, 0, S("12345"), S("abcdefghij12345")); [ 0:17] 189 test(S("abcdefghij"), 10, 0, S("1234567890"), S("abcdefghij1234567890")); [ 0:17] 190 test(S("abcdefghij"), 10, 0, S("12345678901234567890"), S("abcdefghij12345678901234567890")); [ 0:17] 191 test(S("abcdefghijklmnopqrst"), 0, 0, S(""), S("abcdefghijklmnopqrst")); [ 0:17] 192 test(S("abcdefghijklmnopqrst"), 0, 0, S("12345"), S("12345abcdefghijklmnopqrst")); [ 0:17] 193 test(S("abcdefghijklmnopqrst"), 0, 0, S("1234567890"), S("1234567890abcdefghijklmnopqrst")); [ 0:17] 194 test(S("abcdefghijklmnopqrst"), 0, 0, S("12345678901234567890"), S("12345678901234567890abcdefghijklmnopqrst")); [ 0:17] 195 test(S("abcdefghijklmnopqrst"), 0, 1, S(""), S("bcdefghijklmnopqrst")); [ 0:17] 196 test(S("abcdefghijklmnopqrst"), 0, 1, S("12345"), S("12345bcdefghijklmnopqrst")); [ 0:17] 197 test(S("abcdefghijklmnopqrst"), 0, 1, S("1234567890"), S("1234567890bcdefghijklmnopqrst")); [ 0:17] 198 test(S("abcdefghijklmnopqrst"), 0, 1, S("12345678901234567890"), S("12345678901234567890bcdefghijklmnopqrst")); [ 0:17] 199 test(S("abcdefghijklmnopqrst"), 0, 10, S(""), S("klmnopqrst")); [ 0:17] 200 test(S("abcdefghijklmnopqrst"), 0, 10, S("12345"), S("12345klmnopqrst")); [ 0:17] 201 test(S("abcdefghijklmnopqrst"), 0, 10, S("1234567890"), S("1234567890klmnopqrst")); [ 0:17] 202 test(S("abcdefghijklmnopqrst"), 0, 10, S("12345678901234567890"), S("12345678901234567890klmnopqrst")); [ 0:17] 203 test(S("abcdefghijklmnopqrst"), 0, 19, S(""), S("t")); [ 0:17] 204 test(S("abcdefghijklmnopqrst"), 0, 19, S("12345"), S("12345t")); [ 0:17] 205 test(S("abcdefghijklmnopqrst"), 0, 19, S("1234567890"), S("1234567890t")); [ 0:17] 206 test(S("abcdefghijklmnopqrst"), 0, 19, S("12345678901234567890"), S("12345678901234567890t")); [ 0:17] 207 test(S("abcdefghijklmnopqrst"), 0, 20, S(""), S("")); [ 0:17] 208 test(S("abcdefghijklmnopqrst"), 0, 20, S("12345"), S("12345")); [ 0:17] 209 test(S("abcdefghijklmnopqrst"), 0, 20, S("1234567890"), S("1234567890")); [ 0:17] 210 test(S("abcdefghijklmnopqrst"), 0, 20, S("12345678901234567890"), S("12345678901234567890")); [ 0:17] 211 test(S("abcdefghijklmnopqrst"), 1, 0, S(""), S("abcdefghijklmnopqrst")); [ 0:17] 212 test(S("abcdefghijklmnopqrst"), 1, 0, S("12345"), S("a12345bcdefghijklmnopqrst")); [ 0:17] 213 test(S("abcdefghijklmnopqrst"), 1, 0, S("1234567890"), S("a1234567890bcdefghijklmnopqrst")); [ 0:17] 214 test(S("abcdefghijklmnopqrst"), 1, 0, S("12345678901234567890"), S("a12345678901234567890bcdefghijklmnopqrst")); [ 0:17] 215 test(S("abcdefghijklmnopqrst"), 1, 1, S(""), S("acdefghijklmnopqrst")); [ 0:17] 216 test(S("abcdefghijklmnopqrst"), 1, 1, S("12345"), S("a12345cdefghijklmnopqrst")); [ 0:17] 217 test(S("abcdefghijklmnopqrst"), 1, 1, S("1234567890"), S("a1234567890cdefghijklmnopqrst")); [ 0:17] 218 test(S("abcdefghijklmnopqrst"), 1, 1, S("12345678901234567890"), S("a12345678901234567890cdefghijklmnopqrst")); [ 0:17] 219 test(S("abcdefghijklmnopqrst"), 1, 9, S(""), S("aklmnopqrst")); [ 0:17] 220 test(S("abcdefghijklmnopqrst"), 1, 9, S("12345"), S("a12345klmnopqrst")); [ 0:17] 221 test(S("abcdefghijklmnopqrst"), 1, 9, S("1234567890"), S("a1234567890klmnopqrst")); [ 0:17] 222 test(S("abcdefghijklmnopqrst"), 1, 9, S("12345678901234567890"), S("a12345678901234567890klmnopqrst")); [ 0:17] 223 test(S("abcdefghijklmnopqrst"), 1, 18, S(""), S("at")); [ 0:17] 224 test(S("abcdefghijklmnopqrst"), 1, 18, S("12345"), S("a12345t")); [ 0:17] 225 test(S("abcdefghijklmnopqrst"), 1, 18, S("1234567890"), S("a1234567890t")); [ 0:17] 226 test(S("abcdefghijklmnopqrst"), 1, 18, S("12345678901234567890"), S("a12345678901234567890t")); [ 0:17] 227 test(S("abcdefghijklmnopqrst"), 1, 19, S(""), S("a")); [ 0:17] 228 test(S("abcdefghijklmnopqrst"), 1, 19, S("12345"), S("a12345")); [ 0:17] 229 test(S("abcdefghijklmnopqrst"), 1, 19, S("1234567890"), S("a1234567890")); [ 0:17] 230 test(S("abcdefghijklmnopqrst"), 1, 19, S("12345678901234567890"), S("a12345678901234567890")); [ 0:17] 231 test(S("abcdefghijklmnopqrst"), 10, 0, S(""), S("abcdefghijklmnopqrst")); [ 0:17] 232 test(S("abcdefghijklmnopqrst"), 10, 0, S("12345"), S("abcdefghij12345klmnopqrst")); [ 0:17] 233 test(S("abcdefghijklmnopqrst"), 10, 0, S("1234567890"), S("abcdefghij1234567890klmnopqrst")); [ 0:17] 234 test(S("abcdefghijklmnopqrst"), 10, 0, S("12345678901234567890"), S("abcdefghij12345678901234567890klmnopqrst")); [ 0:17] 235 test(S("abcdefghijklmnopqrst"), 10, 1, S(""), S("abcdefghijlmnopqrst")); [ 0:17] 236 test(S("abcdefghijklmnopqrst"), 10, 1, S("12345"), S("abcdefghij12345lmnopqrst")); [ 0:17] 237 test(S("abcdefghijklmnopqrst"), 10, 1, S("1234567890"), S("abcdefghij1234567890lmnopqrst")); [ 0:17] 238 test(S("abcdefghijklmnopqrst"), 10, 1, S("12345678901234567890"), S("abcdefghij12345678901234567890lmnopqrst")); [ 0:17] 239 test(S("abcdefghijklmnopqrst"), 10, 5, S(""), S("abcdefghijpqrst")); [ 0:17] 240 test(S("abcdefghijklmnopqrst"), 10, 5, S("12345"), S("abcdefghij12345pqrst")); [ 0:17] 241 test(S("abcdefghijklmnopqrst"), 10, 5, S("1234567890"), S("abcdefghij1234567890pqrst")); [ 0:17] 242 test(S("abcdefghijklmnopqrst"), 10, 5, S("12345678901234567890"), S("abcdefghij12345678901234567890pqrst")); [ 0:17] 243 test(S("abcdefghijklmnopqrst"), 10, 9, S(""), S("abcdefghijt")); [ 0:17] 244 test(S("abcdefghijklmnopqrst"), 10, 9, S("12345"), S("abcdefghij12345t")); [ 0:17] 245 test(S("abcdefghijklmnopqrst"), 10, 9, S("1234567890"), S("abcdefghij1234567890t")); [ 0:17] 246 test(S("abcdefghijklmnopqrst"), 10, 9, S("12345678901234567890"), S("abcdefghij12345678901234567890t")); [ 0:17] 247 } [ 0:17] 248 [ 0:17] 249 template [ 0:17] 250 void test2() [ 0:17] 251 { [ 0:17] 252 test(S("abcdefghijklmnopqrst"), 10, 10, S(""), S("abcdefghij")); [ 0:17] 253 test(S("abcdefghijklmnopqrst"), 10, 10, S("12345"), S("abcdefghij12345")); [ 0:17] 254 test(S("abcdefghijklmnopqrst"), 10, 10, S("1234567890"), S("abcdefghij1234567890")); [ 0:17] 255 test(S("abcdefghijklmnopqrst"), 10, 10, S("12345678901234567890"), S("abcdefghij12345678901234567890")); [ 0:17] 256 test(S("abcdefghijklmnopqrst"), 19, 0, S(""), S("abcdefghijklmnopqrst")); [ 0:17] 257 test(S("abcdefghijklmnopqrst"), 19, 0, S("12345"), S("abcdefghijklmnopqrs12345t")); [ 0:17] 258 test(S("abcdefghijklmnopqrst"), 19, 0, S("1234567890"), S("abcdefghijklmnopqrs1234567890t")); [ 0:17] 259 test(S("abcdefghijklmnopqrst"), 19, 0, S("12345678901234567890"), S("abcdefghijklmnopqrs12345678901234567890t")); [ 0:17] 260 test(S("abcdefghijklmnopqrst"), 19, 1, S(""), S("abcdefghijklmnopqrs")); [ 0:17] 261 test(S("abcdefghijklmnopqrst"), 19, 1, S("12345"), S("abcdefghijklmnopqrs12345")); [ 0:17] 262 test(S("abcdefghijklmnopqrst"), 19, 1, S("1234567890"), S("abcdefghijklmnopqrs1234567890")); [ 0:17] 263 test(S("abcdefghijklmnopqrst"), 19, 1, S("12345678901234567890"), S("abcdefghijklmnopqrs12345678901234567890")); [ 0:17] 264 test(S("abcdefghijklmnopqrst"), 20, 0, S(""), S("abcdefghijklmnopqrst")); [ 0:17] 265 test(S("abcdefghijklmnopqrst"), 20, 0, S("12345"), S("abcdefghijklmnopqrst12345")); [ 0:17] 266 test(S("abcdefghijklmnopqrst"), 20, 0, S("1234567890"), S("abcdefghijklmnopqrst1234567890")); [ 0:17] 267 test(S("abcdefghijklmnopqrst"), 20, 0, S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); [ 0:17] 268 } [ 0:17] 269 [ 0:17] 270 int main(int, char**) [ 0:17] 271 { [ 0:17] 272 { [ 0:17] 273 typedef std::string S; [ 0:17] 274 test0(); [ 0:17] 275 test1(); [ 0:17] 276 test2(); [ 0:17] 277 } [ 0:17] 278 #if TEST_STD_VER >= 11 [ 0:17] 279 { [ 0:17] 280 typedef std::basic_string, min_allocator> S; [ 0:17] 281 test0(); [ 0:17] 282 test1(); [ 0:17] 283 test2(); [ 0:17] 284 } [ 0:17] 285 #endif [ 0:17] 286 [ 0:17] 287 #if TEST_STD_VER > 3 [ 0:17] 288 { // LWG 2946 [ 0:17] 289 std::string s = " "; [ 0:17] 290 s.replace(s.cbegin(), s.cend(), {"abc", 1}); [ 0:17] 291 assert(s.size() == 1); [ 0:17] 292 assert(s == "a"); [ 0:17] 293 } [ 0:17] 294 #endif [ 0:17] 295 [ 0:17] 296 return 0; [ 0:17] 297 } [ 0:17] # no errors were expected but one was found anyway