aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt13
-rw-r--r--test/libcxx/atomics/atomics.flag/init_bool.pass.cpp13
-rw-r--r--test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp49
-rw-r--r--test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp49
-rw-r--r--test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp53
-rw-r--r--test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp57
-rw-r--r--test/libcxx/depr/depr.c.headers/math_h.sh.cpp (renamed from test/libcxx/experimental/utilities/syserror/version.pass.cpp)17
-rw-r--r--test/libcxx/double_include.sh.cpp13
-rw-r--r--test/libcxx/experimental/any/size_and_alignment.pass.cpp23
-rw-r--r--test/libcxx/experimental/any/small_type.pass.cpp114
-rw-r--r--test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp70
-rw-r--r--test/libcxx/experimental/filesystem/convert_file_time.sh.cpp200
-rw-r--r--test/libcxx/experimental/filesystem/version.pass.cpp2
-rw-r--r--test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp12
-rw-r--r--test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp21
-rw-r--r--test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp21
-rw-r--r--test/libcxx/experimental/utilities/time/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/tuple/version.pass.cpp20
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp (renamed from test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp)19
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp46
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp52
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat1
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp42
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp48
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat1
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp60
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp60
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp30
-rw-r--r--test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp93
-rw-r--r--test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp (renamed from test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp)25
-rw-r--r--test/libcxx/input.output/filesystems/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp (renamed from test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp)6
-rw-r--r--test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp (renamed from test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp)6
-rw-r--r--test/libcxx/input.output/filesystems/convert_file_time.sh.cpp307
-rw-r--r--test/libcxx/input.output/filesystems/lit.local.cfg (renamed from test/libcxx/experimental/filesystem/lit.local.cfg)0
-rw-r--r--test/libcxx/input.output/filesystems/version.pass.cpp (renamed from test/libcxx/experimental/optional/version.pass.cpp)4
-rw-r--r--test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp (renamed from test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp)24
-rw-r--r--test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp29
-rw-r--r--test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp26
-rw-r--r--test/libcxx/iterators/failed.pass.cpp (renamed from test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp)23
-rw-r--r--test/libcxx/language.support/cmp/version.pass.cpp (renamed from test/libcxx/experimental/any/version.pass.cpp)4
-rw-r--r--test/libcxx/language.support/support.limits/version.pass.cpp (renamed from test/libcxx/experimental/utilities/ratio/version.pass.cpp)8
-rw-r--r--test/libcxx/memory/is_allocator.pass.cpp42
-rw-r--r--test/libcxx/min_max_macros.sh.cpp16
-rw-r--r--test/libcxx/numerics/complex.number/__sqr.pass.cpp81
-rw-r--r--test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp48
-rw-r--r--test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp16
-rw-r--r--test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp16
-rw-r--r--test/libcxx/type_traits/is_floating_point.pass.cpp (renamed from test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp)23
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp40
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp85
-rw-r--r--test/libcxx/utilities/utility/pairs/pairs.pair/assign_tuple_like.pass.cpp (renamed from test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp)52
-rw-r--r--test/lit.site.cfg.in4
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp18
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp20
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp22
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp29
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp26
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp18
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp23
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp20
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp23
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp25
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp20
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp23
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp25
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp26
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp22
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp18
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp20
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp30
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp36
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp26
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp28
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp26
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp26
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp22
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp18
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp45
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp55
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp20
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp44
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp48
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp20
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp25
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp19
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp21
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp18
-rw-r--r--test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp19
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp24
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp25
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp19
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp21
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp25
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp26
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp13
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp13
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp13
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp13
-rw-r--r--test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.cons/move.pass.cpp4
-rw-r--r--test/std/containers/associative/map/map.ops/count_transparent.pass.cpp50
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move.pass.cpp4
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp50
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/multiset/count_transparent.pass.cpp51
-rw-r--r--test/std/containers/associative/multiset/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/multiset/insert_cv.pass.cpp78
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/move.pass.cpp4
-rw-r--r--test/std/containers/associative/set/count_transparent.pass.cpp51
-rw-r--r--test/std/containers/associative/set/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/set/insert_cv.pass.cpp87
-rw-r--r--test/std/containers/associative/set/set.cons/move.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp58
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp123
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp46
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp91
-rw-r--r--test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp23
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp53
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp94
-rw-r--r--test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp23
-rw-r--r--test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp106
-rw-r--r--test/std/containers/sequences/array/array.cons/deduct.fail.cpp37
-rw-r--r--test/std/containers/sequences/array/array.cons/deduct.pass.cpp65
-rw-r--r--test/std/containers/sequences/array/array.cons/default.pass.cpp17
-rw-r--r--test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp93
-rw-r--r--test/std/containers/sequences/array/array.data/data.pass.cpp30
-rw-r--r--test/std/containers/sequences/array/array.data/data_const.pass.cpp19
-rw-r--r--test/std/containers/sequences/array/array.fill/fill.fail.cpp29
-rw-r--r--test/std/containers/sequences/array/array.swap/swap.fail.cpp30
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp20
-rw-r--r--test/std/containers/sequences/array/begin.pass.cpp10
-rw-r--r--test/std/containers/sequences/array/compare.fail.cpp71
-rw-r--r--test/std/containers/sequences/array/compare.pass.cpp63
-rw-r--r--test/std/containers/sequences/array/empty.fail.cpp5
-rw-r--r--test/std/containers/sequences/array/front_back.pass.cpp33
-rw-r--r--test/std/containers/sequences/array/indexing.pass.cpp29
-rw-r--r--test/std/containers/sequences/array/size_and_alignment.pass.cpp71
-rw-r--r--test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp42
-rw-r--r--test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp98
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp42
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp103
-rw-r--r--test/std/containers/sequences/list/list.cons/deduct.fail.cpp42
-rw-r--r--test/std/containers/sequences/list/list.cons/deduct.pass.cpp103
-rw-r--r--test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp41
-rw-r--r--test/std/containers/sequences/vector.bool/move.pass.cpp31
-rw-r--r--test/std/containers/sequences/vector/iterators.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp40
-rw-r--r--test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp116
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move.pass.cpp33
-rw-r--r--test/std/containers/test_compare.h4
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp15
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp79
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp77
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp80
-rw-r--r--test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp70
-rw-r--r--test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp69
-rw-r--r--test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp76
-rw-r--r--test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp67
-rw-r--r--test/std/containers/views/span.comparison/op.eq.pass.cpp168
-rw-r--r--test/std/containers/views/span.comparison/op.ge.pass.cpp153
-rw-r--r--test/std/containers/views/span.comparison/op.gt.pass.cpp154
-rw-r--r--test/std/containers/views/span.comparison/op.le.pass.cpp153
-rw-r--r--test/std/containers/views/span.comparison/op.lt.pass.cpp154
-rw-r--r--test/std/containers/views/span.comparison/op.ne.pass.cpp168
-rw-r--r--test/std/containers/views/span.cons/array.fail.cpp72
-rw-r--r--test/std/containers/views/span.cons/array.pass.cpp123
-rw-r--r--test/std/containers/views/span.cons/assign.pass.cpp293
-rw-r--r--test/std/containers/views/span.cons/container.fail.cpp117
-rw-r--r--test/std/containers/views/span.cons/container.pass.cpp118
-rw-r--r--test/std/containers/views/span.cons/copy.pass.cpp71
-rw-r--r--test/std/containers/views/span.cons/deduct.pass.cpp87
-rw-r--r--test/std/containers/views/span.cons/default.fail.cpp32
-rw-r--r--test/std/containers/views/span.cons/default.pass.cpp82
-rw-r--r--test/std/containers/views/span.cons/ptr_len.fail.cpp63
-rw-r--r--test/std/containers/views/span.cons/ptr_len.pass.cpp113
-rw-r--r--test/std/containers/views/span.cons/ptr_ptr.fail.cpp63
-rw-r--r--test/std/containers/views/span.cons/ptr_ptr.pass.cpp113
-rw-r--r--test/std/containers/views/span.cons/span.fail.cpp104
-rw-r--r--test/std/containers/views/span.cons/span.pass.cpp142
-rw-r--r--test/std/containers/views/span.cons/stdarray.pass.cpp114
-rw-r--r--test/std/containers/views/span.elem/data.pass.cpp121
-rw-r--r--test/std/containers/views/span.elem/op_idx.pass.cpp119
-rw-r--r--test/std/containers/views/span.iterators/begin.pass.cpp116
-rw-r--r--test/std/containers/views/span.iterators/end.pass.cpp118
-rw-r--r--test/std/containers/views/span.iterators/rbegin.pass.cpp117
-rw-r--r--test/std/containers/views/span.iterators/rend.pass.cpp118
-rw-r--r--test/std/containers/views/span.objectrep/as_bytes.pass.cpp78
-rw-r--r--test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp48
-rw-r--r--test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp78
-rw-r--r--test/std/containers/views/span.obs/empty.pass.cpp73
-rw-r--r--test/std/containers/views/span.obs/size.pass.cpp91
-rw-r--r--test/std/containers/views/span.obs/size_bytes.pass.cpp92
-rw-r--r--test/std/containers/views/span.sub/first.pass.cpp136
-rw-r--r--test/std/containers/views/span.sub/last.pass.cpp136
-rw-r--r--test/std/containers/views/span.sub/subspan.pass.cpp210
-rw-r--r--test/std/containers/views/types.pass.cpp107
-rw-r--r--test/std/depr/depr.c.headers/stddef_h.pass.cpp10
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp5
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp5
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp5
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp41
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp150
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp53
-rw-r--r--test/std/experimental/any/any.class/any.assign/copy.pass.cpp199
-rw-r--r--test/std/experimental/any/any.class/any.assign/move.pass.cpp104
-rw-r--r--test/std/experimental/any/any.class/any.assign/value.pass.cpp179
-rw-r--r--test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp38
-rw-r--r--test/std/experimental/any/any.class/any.cons/copy.pass.cpp102
-rw-r--r--test/std/experimental/any/any.class/any.cons/default.pass.cpp38
-rw-r--r--test/std/experimental/any/any.class/any.cons/move.pass.cpp104
-rw-r--r--test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp36
-rw-r--r--test/std/experimental/any/any.class/any.cons/value.pass.cpp118
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp65
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp103
-rw-r--r--test/std/experimental/any/any.class/any.observers/empty.pass.cpp64
-rw-r--r--test/std/experimental/any/any.class/any.observers/type.pass.cpp41
-rw-r--r--test/std/experimental/any/any.class/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp146
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp312
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp38
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp45
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp37
-rw-r--r--test/std/experimental/any/any.nonmembers/swap.pass.cpp41
-rw-r--r--test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp97
-rw-r--r--test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp113
-rw-r--r--test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp51
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp117
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp188
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp424
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp58
-rw-r--r--test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp9
-rw-r--r--test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp75
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp30
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp29
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp33
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp43
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp142
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp41
-rw-r--r--test/std/experimental/nothing_to_do.pass.cpp2
-rw-r--r--test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp15
-rw-r--r--test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp15
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp139
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp139
-rw-r--r--test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp29
-rw-r--r--test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp31
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp53
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp53
-rw-r--r--test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/optional/optional.hash/hash.pass.cpp46
-rw-r--r--test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp36
-rw-r--r--test/std/experimental/optional/optional.nullops/equal.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/greater.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/less_equal.pass.cpp43
-rw-r--r--test/std/experimental/optional/optional.nullops/less_than.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/not_equal.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp38
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp80
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp101
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp153
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp126
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp114
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp62
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp116
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp139
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp62
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp144
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp118
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp149
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp63
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp110
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp54
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp44
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp52
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp43
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp65
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp59
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp64
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp66
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp77
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp313
-rw-r--r--test/std/experimental/optional/optional.object/optional_const_void.fail.cpp22
-rw-r--r--test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp28
-rw-r--r--test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp27
-rw-r--r--test/std/experimental/optional/optional.object/optional_void.fail.cpp22
-rw-r--r--test/std/experimental/optional/optional.object/types.pass.cpp38
-rw-r--r--test/std/experimental/optional/optional.relops/equal.pass.cpp74
-rw-r--r--test/std/experimental/optional/optional.relops/greater_equal.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/greater_than.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/less_equal.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/less_than.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/not_equal.pass.cpp74
-rw-r--r--test/std/experimental/optional/optional.specalg/make_optional.pass.cpp51
-rw-r--r--test/std/experimental/optional/optional.specalg/swap.pass.cpp303
-rw-r--r--test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp23
-rw-r--r--test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp23
-rw-r--r--test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp23
-rw-r--r--test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp23
-rw-r--r--test/std/experimental/simd/simd.casts/simd_cast.pass.cpp40
-rw-r--r--test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp38
-rw-r--r--test/std/experimental/simd/simd.cons/broadcast.pass.cpp58
-rw-r--r--test/std/experimental/simd/simd.cons/generator.pass.cpp46
-rw-r--r--test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp30
-rw-r--r--test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp115
-rw-r--r--test/std/experimental/simd/simd.traits/is_simd.pass.cpp133
-rw-r--r--test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp55
-rw-r--r--test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp133
-rw-r--r--test/std/experimental/string.view/lit.local.cfg3
-rw-r--r--test/std/experimental/string.view/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/string.view/string.view.access/at.pass.cpp63
-rw-r--r--test/std/experimental/string.view/string.view.access/back.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.access/data.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.access/front.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.access/index.pass.cpp53
-rw-r--r--test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp89
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp69
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp62
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp70
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp49
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp62
-rw-r--r--test/std/experimental/string.view/string.view.cons/default.pass.cpp48
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_string.pass.cpp56
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp32
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp32
-rw-r--r--test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp85
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp85
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp172
-rw-r--r--test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp394
-rw-r--r--test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp165
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp84
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp172
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp165
-rw-r--r--test/std/experimental/string.view/string.view.hash/string_view.pass.cpp55
-rw-r--r--test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp58
-rw-r--r--test/std/experimental/string.view/string.view.iterators/begin.pass.cpp79
-rw-r--r--test/std/experimental/string.view/string.view.iterators/end.pass.cpp88
-rw-r--r--test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp61
-rw-r--r--test/std/experimental/string.view/string.view.iterators/rend.pass.cpp69
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp67
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp78
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp78
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp76
-rw-r--r--test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp214
-rw-r--r--test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp127
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp453
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp403
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp1356
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp5849
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp122
-rw-r--r--test/std/experimental/string.view/string.view.ops/copy.pass.cpp101
-rw-r--r--test/std/experimental/string.view/string.view.ops/substr.pass.cpp119
-rw-r--r--test/std/experimental/string.view/string.view.ops/to_string.pass.cpp76
-rw-r--r--test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp68
-rw-r--r--test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp68
-rw-r--r--test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp41
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp62
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp178
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp99
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp492
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp62
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp22
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp47
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp61
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp57
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp57
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp57
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp47
-rw-r--r--test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp21
-rw-r--r--test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp37
-rw-r--r--test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp38
-rw-r--r--test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp19
-rw-r--r--test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp49
-rw-r--r--test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp20
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp187
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp118
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp427
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp146
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp53
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp70
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp431
-rw-r--r--test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp25
-rw-r--r--test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp45
-rw-r--r--test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp25
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp56
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp20
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp8
-rw-r--r--test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp49
-rw-r--r--test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp52
-rw-r--r--test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp53
-rw-r--r--test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp48
-rw-r--r--test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp69
-rw-r--r--test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp62
l---------test/std/input.output/filesystems/Inputs/static_test_env/bad_symlink (renamed from test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/afile3 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/dir3/file5 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/file4 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4)0
l---------test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/file1 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/file2 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/empty_file (renamed from test/std/experimental/filesystem/Inputs/static_test_env/empty_file)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/non_empty_file (renamed from test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file)0
l---------test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_dir (renamed from test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir)0
l---------test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_empty_file (renamed from test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file)0
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp74
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp82
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp31
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp32
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp72
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp78
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp182
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp132
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp341
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp169
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp242
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp258
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp242
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp215
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/path.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp58
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp)36
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp)10
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.file_status/file_status.cons.pass.cpp (renamed from test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.file_status/file_status.mods.pass.cpp (renamed from test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.file_status/file_status.obs.pass.cpp (renamed from test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp (renamed from test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp)9
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp)77
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/braced_init.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp)22
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/default.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp)29
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp)113
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp142
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp89
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp)51
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp)20
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp)2
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp)0
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp)0
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp)37
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp)4
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/synop.pass.cpp (renamed from test/std/experimental/filesystem/class.path/synop.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp)10
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp)40
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp (renamed from test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp)0
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp38
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp48
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp)10
-rw-r--r--test/std/input.output/filesystems/fs.error.report/tested_elsewhere.pass.cpp (renamed from test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp)0
-rw-r--r--test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp (renamed from test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp)31
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp58
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp)52
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp189
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp99
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp)41
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp)11
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp)46
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp)32
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp594
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp)90
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp133
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp78
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp)23
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp)23
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp76
-rw-r--r--test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp29
-rw-r--r--test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp (renamed from test/std/experimental/utilities/meta/meta.type.synop/includes.pass.cpp)22
-rw-r--r--test/std/input.output/filesystems/fs.req.namespace/namespace.pass.cpp (renamed from test/std/experimental/utilities/tuple/tuple_size_v_2.fail.cpp)21
-rw-r--r--test/std/input.output/filesystems/lit.local.cfg (renamed from test/std/experimental/filesystem/lit.local.cfg)0
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp62
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp62
-rw-r--r--test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp4
-rw-r--r--test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp4
-rw-r--r--test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp13
-rw-r--r--test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp13
-rw-r--r--test/std/iterators/iterator.container/data.pass.cpp10
-rw-r--r--test/std/iterators/iterator.container/empty.pass.cpp10
-rw-r--r--test/std/iterators/iterator.container/size.pass.cpp12
-rw-r--r--test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp6
-rw-r--r--test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp17
-rw-r--r--test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp93
-rw-r--r--test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp164
-rw-r--r--test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp96
-rw-r--r--test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp212
-rw-r--r--test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp70
-rw-r--r--test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp169
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp11
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp11
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp6
-rw-r--r--test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp12
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp48
-rw-r--r--test/std/language.support/support.limits/version.pass.cpp (renamed from test/std/experimental/optional/optional.defs/tested_elsewhere.pass.cpp)5
-rw-r--r--test/std/language.support/support.types/byte.pass.cpp6
-rw-r--r--test/std/language.support/support.types/max_align_t.pass.cpp14
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp56
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp58
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp6
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp19
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp23
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp164
-rw-r--r--test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp11
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp6
-rw-r--r--test/std/numerics/c.math/cmath.pass.cpp14
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp9
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp9
-rw-r--r--test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp2
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp27
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp26
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp12
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp16
-rw-r--r--test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp21
-rw-r--r--test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp11
-rw-r--r--test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp17
-rw-r--r--test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp17
-rw-r--r--test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp33
-rw-r--r--test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp84
-rw-r--r--test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp66
-rw-r--r--test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp86
-rw-r--r--test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp83
-rw-r--r--test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp12
-rw-r--r--test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp14
-rw-r--r--test/std/numerics/rand/rand.device/eval.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp8
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp37
-rw-r--r--test/std/re/re.regex/re.regex.construct/deduct.fail.cpp45
-rw-r--r--test/std/re/re.regex/re.regex.construct/deduct.pass.cpp137
-rw-r--r--test/std/strings/basic.string/char.bad.fail.cpp53
-rw-r--r--test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp51
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp56
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp93
-rw-r--r--test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp41
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp95
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp47
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp99
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp5
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp3
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp10
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp8
-rw-r--r--test/std/strings/string.view/char.bad.fail.cpp53
-rw-r--r--test/std/strings/string.view/string.view.access/data.pass.cpp4
-rw-r--r--test/std/strings/string.view/string.view.capacity/capacity.pass.cpp5
-rw-r--r--test/std/strings/string.view/string.view.cons/assign.pass.cpp6
-rw-r--r--test/std/strings/string.view/types.pass.cpp28
-rw-r--r--test/std/thread/futures/futures.async/async.fail.cpp6
-rw-r--r--test/std/utilities/any/any.class/any.assign/copy.pass.cpp6
-rw-r--r--test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp48
-rw-r--r--test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp12
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp129
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp125
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp143
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp134
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp129
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp124
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp137
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp131
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp96
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp103
-rw-r--r--test/std/utilities/function.objects/func.search/nothing_to_do.pass.cpp (renamed from test/std/experimental/utilities/ratio/nothing_to_do.pass.cpp)0
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp46
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp46
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp50
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp102
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp4
-rw-r--r--test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp35
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp7
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp138
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp21
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp5
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp24
-rw-r--r--test/std/utilities/meta/meta.type.synop/endian.pass.cpp48
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp106
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp12
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp2
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp46
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp54
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp (renamed from test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp)78
-rw-r--r--test/std/utilities/utility/exchange/exchange.pass.cpp30
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp22
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp2
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp16
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp4
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp2
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp6
-rw-r--r--test/support/Counter.h4
-rw-r--r--test/support/MoveOnly.h3
-rw-r--r--test/support/count_new.hpp169
-rw-r--r--test/support/filesystem_include.hpp13
-rw-r--r--test/support/filesystem_test_helper.hpp149
-rw-r--r--test/support/format_string.hpp71
-rw-r--r--test/support/msvc_stdlib_force_include.hpp6
-rw-r--r--test/support/platform_support.h12
-rw-r--r--test/support/rapid-cxx-test.hpp23
-rw-r--r--test/support/test_allocator.h57
-rw-r--r--test/support/test_comparisons.h175
-rw-r--r--test/support/test_macros.h34
-rw-r--r--test/support/test_memory_resource.hpp2
-rw-r--r--test/support/verbose_assert.h222
794 files changed, 21866 insertions, 29665 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 53c6416cca6b..f8442460a2fe 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -9,6 +9,11 @@ endmacro()
set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
"Configuration variant to use for LIT.")
+set(LIBCXX_TEST_LINKER_FLAGS "" CACHE STRING
+ "Additonal linker flags to pass when compiling the tests")
+set(LIBCXX_TEST_COMPILER_FLAGS "" CACHE STRING
+ "Additonal linker flags to pass when compiling the tests")
+
# The tests shouldn't link to any ABI library when it has been linked into
# libc++ statically or via a linker script.
if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
@@ -30,6 +35,7 @@ pythonize_bool(LIBCXX_BUILD_32_BITS)
pythonize_bool(LIBCXX_GENERATE_COVERAGE)
pythonize_bool(LIBCXXABI_ENABLE_SHARED)
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
+pythonize_bool(LIBCXX_USE_COMPILER_RT)
pythonize_bool(LIBCXX_HAS_ATOMIC_LIB)
pythonize_bool(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB)
pythonize_bool(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
@@ -52,7 +58,10 @@ set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!"
set(LIBCXX_TEST_DEPS "")
if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
- set(LIBCXX_TEST_DEPS cxx_experimental)
+ list(APPEND LIBCXX_TEST_DEPS cxx_experimental)
+endif()
+if (LIBCXX_ENABLE_FILESYSTEM)
+ list(APPEND LIBCXX_TEST_DEPS cxx_filesystem)
endif()
if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
@@ -99,7 +108,7 @@ if (LIBCXX_CONFIGURE_IDE)
${LIBCXX_TESTS} ${LIBCXX_TEST_HEADERS} ${LIBCXX_HEADERS})
add_dependencies(libcxx_test_objects cxx)
- set(STATIC_ROOT ${LIBCXX_SOURCE_DIR}/test/std/experimental/filesystem/Inputs/static_test_env)
+ set(STATIC_ROOT ${LIBCXX_SOURCE_DIR}/test/std/input.output/filesystems/Inputs/static_test_env)
add_definitions(-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="${STATIC_ROOT}")
set(DYNAMIC_ROOT ${LIBCXX_BINARY_DIR}/test/filesystem/Output/dynamic_env)
diff --git a/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp b/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp
index d7b172cd1212..9dd68bd4e459 100644
--- a/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp
+++ b/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp
@@ -18,8 +18,21 @@
#include <atomic>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_STD_VER >= 11
+// Ensure that static initialization happens; this is PR#37226
+extern std::atomic_flag global;
+struct X { X() { global.test_and_set(); }};
+X x;
+std::atomic_flag global = ATOMIC_FLAG_INIT;
+#endif
+
int main()
{
+#if TEST_STD_VER >= 11
+ assert(global.test_and_set() == 1);
+#endif
{
std::atomic_flag f(false);
assert(f.test_and_set() == 0);
diff --git a/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp b/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
new file mode 100644
index 000000000000..465523f84d67
--- /dev/null
+++ b/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-no-exceptions
+// MODULES_DEFINES: _LIBCPP_DEBUG=1
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
+// test array<T, 0>::front() throws a debug exception.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <array>
+
+template <class Array>
+inline bool CheckDebugThrows(Array& Arr) {
+ try {
+ Arr.back();
+ } catch (std::__libcpp_debug_exception const&) {
+ return true;
+ }
+ return false;
+}
+
+int main()
+{
+ {
+ typedef std::array<int, 0> C;
+ C c = {};
+ C const& cc = c;
+ assert(CheckDebugThrows(c));
+ assert(CheckDebugThrows(cc));
+ }
+ {
+ typedef std::array<const int, 0> C;
+ C c = {{}};
+ C const& cc = c;
+ assert(CheckDebugThrows(c));
+ assert(CheckDebugThrows(cc));
+ }
+}
diff --git a/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp b/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
new file mode 100644
index 000000000000..d49b3a763345
--- /dev/null
+++ b/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-no-exceptions
+// MODULES_DEFINES: _LIBCPP_DEBUG=1
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
+// test array<T, 0>::front() throws a debug exception.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <array>
+
+template <class Array>
+inline bool CheckDebugThrows(Array& Arr) {
+ try {
+ Arr.front();
+ } catch (std::__libcpp_debug_exception const&) {
+ return true;
+ }
+ return false;
+}
+
+int main()
+{
+ {
+ typedef std::array<int, 0> C;
+ C c = {};
+ C const& cc = c;
+ assert(CheckDebugThrows(c));
+ assert(CheckDebugThrows(cc));
+ }
+ {
+ typedef std::array<const int, 0> C;
+ C c = {{}};
+ C const& cc = c;
+ assert(CheckDebugThrows(c));
+ assert(CheckDebugThrows(cc));
+ }
+}
diff --git a/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp b/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
new file mode 100644
index 000000000000..4d6ad6907388
--- /dev/null
+++ b/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-no-exceptions
+// MODULES_DEFINES: _LIBCPP_DEBUG=1
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
+// test array<T, 0>::operator[] throws a debug exception.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <array>
+
+template <class Array>
+inline bool CheckDebugThrows(Array& Arr, size_t Index) {
+ try {
+ Arr[Index];
+ } catch (std::__libcpp_debug_exception const&) {
+ return true;
+ }
+ return false;
+}
+
+int main()
+{
+ {
+ typedef std::array<int, 0> C;
+ C c = {};
+ C const& cc = c;
+ assert(CheckDebugThrows(c, 0));
+ assert(CheckDebugThrows(c, 1));
+ assert(CheckDebugThrows(cc, 0));
+ assert(CheckDebugThrows(cc, 1));
+ }
+ {
+ typedef std::array<const int, 0> C;
+ C c = {{}};
+ C const& cc = c;
+ assert(CheckDebugThrows(c, 0));
+ assert(CheckDebugThrows(c, 1));
+ assert(CheckDebugThrows(cc, 0));
+ assert(CheckDebugThrows(cc, 1));
+ }
+}
diff --git a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
index 3ae009a8e96c..57d16c2723f7 100644
--- a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
+++ b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
@@ -42,6 +42,7 @@ public:
Base::run();
try {
FrontOnEmptyContainer();
+
if constexpr (CT != CT_ForwardList) {
AssignInvalidates();
BackOnEmptyContainer();
@@ -50,6 +51,8 @@ public:
InsertIterIterIter();
EmplaceIterValue();
EraseIterIter();
+ } else {
+ SpliceFirstElemAfter();
}
if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) {
PopBack();
@@ -57,12 +60,66 @@ public:
if constexpr (CT == CT_List || CT == CT_Deque) {
PopFront(); // FIXME: Run with forward list as well
}
+ if constexpr (CT == CT_List || CT == CT_ForwardList) {
+ RemoveFirstElem();
+ }
+ if constexpr (CT == CT_List) {
+ SpliceFirstElem();
+ }
} catch (...) {
assert(false && "uncaught debug exception");
}
}
private:
+ static void RemoveFirstElem() {
+ // See llvm.org/PR35564
+ CHECKPOINT("remove(<first-elem>)");
+ {
+ Container C = makeContainer(1);
+ auto FirstVal = *(C.begin());
+ C.remove(FirstVal);
+ assert(C.empty());
+ }
+ {
+ Container C = {1, 1, 1, 1};
+ auto FirstVal = *(C.begin());
+ C.remove(FirstVal);
+ assert(C.empty());
+ }
+ }
+
+ static void SpliceFirstElem() {
+ // See llvm.org/PR35564
+ CHECKPOINT("splice(<first-elem>)");
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice(C2.end(), C, C.begin(), ++C.begin());
+ }
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice(C2.end(), C, C.begin());
+ }
+ }
+
+
+ static void SpliceFirstElemAfter() {
+ // See llvm.org/PR35564
+ CHECKPOINT("splice(<first-elem>)");
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice_after(C2.begin(), C, C.begin(), ++C.begin());
+ }
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice_after(C2.begin(), C, C.begin());
+ }
+ }
+
static void AssignInvalidates() {
CHECKPOINT("assign(Size, Value)");
Container C(allocator_type{});
diff --git a/test/libcxx/experimental/utilities/syserror/version.pass.cpp b/test/libcxx/depr/depr.c.headers/math_h.sh.cpp
index 35f6a59c3876..8048865c34be 100644
--- a/test/libcxx/experimental/utilities/syserror/version.pass.cpp
+++ b/test/libcxx/depr/depr.c.headers/math_h.sh.cpp
@@ -7,14 +7,17 @@
//
//===----------------------------------------------------------------------===//
-// <experimental/system_error>
+// RUN: %compile -fsyntax-only
-#include <experimental/system_error>
+#ifdef _MSC_VER
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
+#include <math.h>
+
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+#ifndef M_PI
+#error M_PI not defined
#endif
-int main()
-{
-}
+#endif
diff --git a/test/libcxx/double_include.sh.cpp b/test/libcxx/double_include.sh.cpp
index 0a9e9fcfaea8..c98cc8065eb9 100644
--- a/test/libcxx/double_include.sh.cpp
+++ b/test/libcxx/double_include.sh.cpp
@@ -41,6 +41,7 @@
#include <clocale>
#include <cmath>
#include <codecvt>
+#include <compare>
#include <complex>
#include <complex.h>
#include <condition_variable>
@@ -61,6 +62,7 @@
#include <deque>
#include <errno.h>
#include <exception>
+#include <filesystem>
#include <float.h>
#include <forward_list>
#include <fstream>
@@ -101,6 +103,7 @@
#ifndef _LIBCPP_HAS_NO_THREADS
#include <shared_mutex>
#endif
+#include <span>
#include <sstream>
#include <stack>
#include <stdbool.h>
@@ -129,14 +132,13 @@
#include <valarray>
#include <variant>
#include <vector>
+#include <version>
#include <wchar.h>
#include <wctype.h>
// experimental headers
#if __cplusplus >= 201103L
#include <experimental/algorithm>
-#include <experimental/any>
-#include <experimental/chrono>
#if defined(__cpp_coroutines)
#include <experimental/coroutine>
#endif
@@ -149,16 +151,11 @@
#include <experimental/list>
#include <experimental/map>
#include <experimental/memory_resource>
-#include <experimental/numeric>
-#include <experimental/optional>
#include <experimental/propagate_const>
-#include <experimental/ratio>
#include <experimental/regex>
+#include <experimental/simd>
#include <experimental/set>
#include <experimental/string>
-#include <experimental/string_view>
-#include <experimental/system_error>
-#include <experimental/tuple>
#include <experimental/type_traits>
#include <experimental/unordered_map>
#include <experimental/unordered_set>
diff --git a/test/libcxx/experimental/any/size_and_alignment.pass.cpp b/test/libcxx/experimental/any/size_and_alignment.pass.cpp
deleted file mode 100644
index b7db54020478..000000000000
--- a/test/libcxx/experimental/any/size_and_alignment.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// Check that the size and alignment of any are what we expect.
-
-#include <experimental/any>
-
-int main()
-{
- using std::experimental::any;
- static_assert(sizeof(any) == sizeof(void*)*4, "");
- static_assert(alignof(any) == alignof(void*), "");
-}
diff --git a/test/libcxx/experimental/any/small_type.pass.cpp b/test/libcxx/experimental/any/small_type.pass.cpp
deleted file mode 100644
index 96754126c996..000000000000
--- a/test/libcxx/experimental/any/small_type.pass.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// Check that the size and alignment of any are what we expect.
-
-#include <experimental/any>
-#include "experimental_any_helpers.h"
-
-constexpr std::size_t BufferSize = (sizeof(void*) * 3);
-constexpr std::size_t BufferAlignment = alignof(void*);
-// Clang doesn't like "alignof(BufferAlignment * 2)" due to PR13986.
-// So we create "DoubleBufferAlignment" instead.
-constexpr std::size_t DoubleBufferAlignment = BufferAlignment * 2;
-
-class SmallThrowsDtor
-{
-public:
- SmallThrowsDtor() {}
- SmallThrowsDtor(SmallThrowsDtor const &) noexcept {}
- SmallThrowsDtor(SmallThrowsDtor &&) noexcept {}
- ~SmallThrowsDtor() noexcept(false) {}
-};
-
-
-struct alignas(1) MaxSizeType {
- char buff[BufferSize];
-};
-
-struct alignas(BufferAlignment) MaxAlignType {
-};
-
-struct alignas(BufferAlignment) MaxSizeAndAlignType {
- char buff[BufferSize];
-};
-
-
-struct alignas(1) OverSizeType {
- char buff[BufferSize + 1];
-};
-
-struct alignas(DoubleBufferAlignment) OverAlignedType {
-};
-
-struct alignas(DoubleBufferAlignment) OverSizeAndAlignedType {
- char buff[BufferSize + 1];
-};
-
-int main()
-{
- using std::experimental::any;
- using std::experimental::__any_imp::_IsSmallObject;
- static_assert(_IsSmallObject<small>::value, "");
- static_assert(_IsSmallObject<void*>::value, "");
- static_assert(!_IsSmallObject<SmallThrowsDtor>::value, "");
- static_assert(!_IsSmallObject<large>::value, "");
- {
- // Check a type that meets the size requirement *exactly* and has
- // a lesser alignment requirement is considered small.
- typedef MaxSizeType T;
- static_assert(sizeof(T) == BufferSize, "");
- static_assert(alignof(T) < BufferAlignment, "");
- static_assert(_IsSmallObject<T>::value, "");
- }
- {
- // Check a type that meets the alignment requirement *exactly* and has
- // a lesser size is considered small.
- typedef MaxAlignType T;
- static_assert(sizeof(T) < BufferSize, "");
- static_assert(alignof(T) == BufferAlignment, "");
- static_assert(_IsSmallObject<T>::value, "");
- }
- {
- // Check a type that meets the size and alignment requirements *exactly*
- // is considered small.
- typedef MaxSizeAndAlignType T;
- static_assert(sizeof(T) == BufferSize, "");
- static_assert(alignof(T) == BufferAlignment, "");
- static_assert(_IsSmallObject<T>::value, "");
- }
- {
- // Check a type that meets the alignment requirements but is over-sized
- // is not considered small.
- typedef OverSizeType T;
- static_assert(sizeof(T) > BufferSize, "");
- static_assert(alignof(T) < BufferAlignment, "");
- static_assert(!_IsSmallObject<T>::value, "");
- }
- {
- // Check a type that meets the size requirements but is over-aligned
- // is not considered small.
- typedef OverAlignedType T;
- static_assert(sizeof(T) < BufferSize, "");
- static_assert(alignof(T) > BufferAlignment, "");
- static_assert(!_IsSmallObject<T>::value, "");
- }
- {
- // Check a type that exceeds both the size an alignment requirements
- // is not considered small.
- typedef OverSizeAndAlignedType T;
- static_assert(sizeof(T) > BufferSize, "");
- static_assert(alignof(T) > BufferAlignment, "");
- static_assert(!_IsSmallObject<T>::value, "");
- }
-}
diff --git a/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
deleted file mode 100644
index c43ea078f989..000000000000
--- a/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// class path
-
-// path& operator/=(path const&)
-// path operator/(path const&, path const&)
-
-
-#define _LIBCPP_DEBUG 0
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++)
-int AssertCount = 0;
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-#include "count_new.hpp"
-#include "filesystem_test_helper.hpp"
-
-namespace fs = std::experimental::filesystem;
-
-int main()
-{
- using namespace fs;
- {
- path lhs("//foo");
- path rhs("/bar");
- assert(AssertCount == 0);
- lhs /= rhs;
- assert(AssertCount == 0);
- }
- {
- path lhs("//foo");
- path rhs("/bar");
- assert(AssertCount == 0);
- (void)(lhs / rhs);
- assert(AssertCount == 0);
- }
- {
- path lhs("//foo");
- path rhs("//bar");
- assert(AssertCount == 0);
- lhs /= rhs;
- assert(AssertCount == 1);
- AssertCount = 0;
- }
- {
- path lhs("//foo");
- path rhs("//bar");
- assert(AssertCount == 0);
- (void)(lhs / rhs);
- assert(AssertCount == 1);
- }
- // FIXME The same error is not diagnosed for the append(Source) and
- // append(It, It) overloads.
-}
diff --git a/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp b/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp
deleted file mode 100644
index 972d51813961..000000000000
--- a/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/filesystem>
-
-// typedef TrivialClock file_time_type;
-
-// RUN: %build -I%libcxx_src_root/src/experimental/filesystem
-// RUN: %run
-
-#include <experimental/filesystem>
-#include <chrono>
-#include <type_traits>
-#include <limits>
-#include <cstddef>
-#include <cassert>
-
-#include "filesystem_time_helper.h"
-
-using namespace std::chrono;
-namespace fs = std::experimental::filesystem;
-using fs::file_time_type;
-using fs::fs_time_util;
-
-enum TestKind { TK_64Bit, TK_32Bit, TK_FloatingPoint };
-
-template <class FileTimeT, class TimeT, class TimeSpec>
-constexpr TestKind getTestKind() {
- if (sizeof(TimeT) == 8 && !std::is_floating_point<TimeT>::value)
- return TK_64Bit;
- else if (sizeof(TimeT) == 4 && !std::is_floating_point<TimeT>::value)
- return TK_32Bit;
- else if (std::is_floating_point<TimeT>::value)
- return TK_FloatingPoint;
- else
- assert(false && "test kind not supported");
-}
-
-template <class FileTimeT, class TimeT, class TimeSpecT,
- class Base = fs_time_util<FileTimeT, TimeT, TimeSpecT>,
- TestKind = getTestKind<FileTimeT, TimeT, TimeSpecT>()>
-struct check_is_representable;
-
-template <class FileTimeT, class TimeT, class TimeSpecT, class Base>
-struct check_is_representable<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit>
- : public Base {
-
- using Base::convert_timespec;
- using Base::is_representable;
- using Base::max_nsec;
- using Base::max_seconds;
- using Base::min_nsec_timespec;
- using Base::min_seconds;
-
- static constexpr auto max_time_t = std::numeric_limits<TimeT>::max();
- static constexpr auto min_time_t = std::numeric_limits<TimeT>::min();
-
- static constexpr bool test_timespec() {
- static_assert(is_representable(TimeSpecT{max_seconds, max_nsec}), "");
- static_assert(!is_representable(TimeSpecT{max_seconds + 1, 0}), "");
- static_assert(!is_representable(TimeSpecT{max_seconds, max_nsec + 1}), "");
- static_assert(!is_representable(TimeSpecT{max_time_t, 0}), "");
- static_assert(is_representable(TimeSpecT{min_seconds, 0}), "");
- static_assert(
- is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec}), "");
- static_assert(
- is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}),
- "");
- static_assert(
- !is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec - 1}),
- "");
- static_assert(!is_representable(TimeSpecT{min_time_t, 999999999}), "");
- return true;
- }
-
- static constexpr bool test_file_time_type() {
- static_assert(Base::is_representable(FileTimeT::max()), "");
- static_assert(Base::is_representable(FileTimeT::min()), "");
- return true;
- }
-
- static constexpr bool test_convert_timespec() {
- static_assert(convert_timespec(TimeSpecT{max_seconds, max_nsec}) ==
- FileTimeT::max(),
- "");
- static_assert(convert_timespec(TimeSpecT{max_seconds, max_nsec - 1}) <
- FileTimeT::max(),
- "");
- static_assert(convert_timespec(TimeSpecT{max_seconds - 1, 999999999}) <
- FileTimeT::max(),
- "");
- static_assert(convert_timespec(TimeSpecT{
- min_seconds - 1, min_nsec_timespec}) == FileTimeT::min(),
- "");
- static_assert(
- convert_timespec(TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}) >
- FileTimeT::min(),
- "");
- static_assert(
- convert_timespec(TimeSpecT{min_seconds, 0}) > FileTimeT::min(), "");
- return true;
- }
-
- static bool test() {
- static_assert(test_timespec(), "");
- static_assert(test_file_time_type(), "");
- static_assert(test_convert_timespec(), "");
- return true;
- }
-};
-
-template <class FileTimeT, class TimeT, class TimeSpecT, class Base>
-struct check_is_representable<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit>
- : public Base {
- static constexpr auto max_time_t = std::numeric_limits<TimeT>::max();
- static constexpr auto min_time_t = std::numeric_limits<TimeT>::min();
-
- using Base::convert_timespec;
- using Base::is_representable;
- using Base::max_nsec;
- using Base::max_seconds;
- using Base::min_nsec_timespec;
- using Base::min_seconds;
-
- static constexpr bool test_timespec() {
- static_assert(is_representable(TimeSpecT{max_time_t, 999999999}), "");
- static_assert(is_representable(TimeSpecT{max_time_t, 1000000000}), "");
- static_assert(is_representable(TimeSpecT{min_time_t, 0}), "");
- return true;
- }
-
- static constexpr bool test_file_time_type() {
- static_assert(!is_representable(FileTimeT::max()), "");
- static_assert(!is_representable(FileTimeT::min()), "");
- static_assert(is_representable(FileTimeT(seconds(max_time_t))), "");
- static_assert(is_representable(FileTimeT(seconds(min_time_t))), "");
- return true;
- }
-
- static constexpr bool test_convert_timespec() {
- // FIXME add tests for 32 bit builds
- return true;
- }
-
- static bool test() {
- static_assert(test_timespec(), "");
- static_assert(test_file_time_type(), "");
- static_assert(test_convert_timespec(), "");
- return true;
- }
-};
-
-template <class FileTimeT, class TimeT, class TimeSpec, class Base>
-struct check_is_representable<FileTimeT, TimeT, TimeSpec, Base,
- TK_FloatingPoint> : public Base {
-
- static bool test() { return true; }
-};
-
-template <class TimeT, class NSecT = long>
-struct TestTimeSpec {
- TimeT tv_sec;
- NSecT tv_nsec;
-};
-
-template <class Dur>
-struct TestClock {
- typedef Dur duration;
- typedef typename duration::rep rep;
- typedef typename duration::period period;
- typedef std::chrono::time_point<TestClock> time_point;
- static constexpr const bool is_steady = false;
-
- static time_point now() noexcept { return {}; }
-};
-
-template <class IntType, class Dur = duration<IntType, std::micro> >
-using TestFileTimeT = time_point<TestClock<Dur> >;
-
-int main() {
- assert((
- check_is_representable<file_time_type, time_t, struct timespec>::test()));
- assert((check_is_representable<TestFileTimeT<int64_t>, int64_t,
- TestTimeSpec<int64_t, long> >::test()));
- assert((check_is_representable<TestFileTimeT<long long>, int32_t,
- TestTimeSpec<int32_t, int32_t> >::test()));
-
- // Test that insane platforms like ppc64 linux, which use long double as time_t,
- // at least compile.
- assert((check_is_representable<TestFileTimeT<long double>, double,
- TestTimeSpec<long double, long> >::test()));
-}
diff --git a/test/libcxx/experimental/filesystem/version.pass.cpp b/test/libcxx/experimental/filesystem/version.pass.cpp
index 723380a26fba..d5f36a6b313b 100644
--- a/test/libcxx/experimental/filesystem/version.pass.cpp
+++ b/test/libcxx/experimental/filesystem/version.pass.cpp
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03
-
// <experimental/filesystem>
#include <experimental/filesystem>
diff --git a/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
index 83b304196371..40bacbcbad59 100644
--- a/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -79,12 +79,12 @@ struct CountCopies {
};
struct CountCopiesAllocV1 {
- typedef ex::memory_resource* allocator_type;
- allocator_type alloc;
+ typedef ex::polymorphic_allocator<char> allocator_type;
+ ex::memory_resource *alloc;
int count;
CountCopiesAllocV1() : alloc(nullptr), count(0) {}
CountCopiesAllocV1(std::allocator_arg_t, allocator_type const& a,
- CountCopiesAllocV1 const& o) : alloc(a), count(o.count + 1)
+ CountCopiesAllocV1 const& o) : alloc(a.resource()), count(o.count + 1)
{}
CountCopiesAllocV1(CountCopiesAllocV1 const& o) : count(o.count + 1) {}
@@ -92,12 +92,12 @@ struct CountCopiesAllocV1 {
struct CountCopiesAllocV2 {
- typedef ex::memory_resource* allocator_type;
- allocator_type alloc;
+ typedef ex::polymorphic_allocator<char> allocator_type;
+ ex::memory_resource *alloc;
int count;
CountCopiesAllocV2() : alloc(nullptr), count(0) {}
CountCopiesAllocV2(CountCopiesAllocV2 const& o, allocator_type const& a)
- : alloc(a), count(o.count + 1)
+ : alloc(a.resource()), count(o.count + 1)
{ }
CountCopiesAllocV2(CountCopiesAllocV2 const& o) : count(o.count + 1) {}
diff --git a/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp
deleted file mode 100644
index be3aacdc362c..000000000000
--- a/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/system_error>
-
-#include <experimental/system_error>
-
-#ifndef _LIBCPP_SYSTEM_ERROR
-# error "<experimental/system_error> must include <system_error>"
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp
deleted file mode 100644
index e91068c742e1..000000000000
--- a/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/chrono>
-
-#include <experimental/chrono>
-
-#ifndef _LIBCPP_CHRONO
-# error "<experimental/chrono> must include <chrono>"
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/experimental/utilities/time/version.pass.cpp b/test/libcxx/experimental/utilities/time/version.pass.cpp
deleted file mode 100644
index be97466f37c0..000000000000
--- a/test/libcxx/experimental/utilities/time/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/chrono>
-
-#include <experimental/chrono>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
deleted file mode 100644
index defa454d68f7..000000000000
--- a/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/tuple>
-
-#include <experimental/tuple>
-
-int main()
-{
-#ifndef _LIBCPP_TUPLE
-# error "<experimental/tuple> must include <tuple>"
-#endif
-}
diff --git a/test/libcxx/experimental/utilities/tuple/version.pass.cpp b/test/libcxx/experimental/utilities/tuple/version.pass.cpp
deleted file mode 100644
index 5a3fd2e39647..000000000000
--- a/test/libcxx/experimental/utilities/tuple/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/tuple>
-
-#include <experimental/tuple>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp b/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
index 1f04580ddabd..84045cf3c94f 100644
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp
+++ b/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
@@ -6,20 +6,19 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+// <fstream>
-#include <experimental/numeric>
+// template<class charT, class traits = char_traits<charT>>
+// class basic_filebuf;
+//
+// The char type of the stream and the char_type of the traits have to match
+#include <fstream>
int main()
{
- std::experimental::gcd<volatile bool, int>(false, 4);
+ std::basic_filebuf<char, std::char_traits<wchar_t> > f;
+// expected-error-re@streambuf:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
}
+
diff --git a/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
new file mode 100644
index 000000000000..9808d1c09600
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_fstream
+
+// explicit basic_fstream(const wchar_t* s, ios_base::openmode mode = ios_base::in | ios_base::out);
+
+#include <fstream>
+#include <cassert>
+#include "platform_support.h"
+
+int main()
+{
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::fstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out
+ | std::ios_base::trunc);
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+ {
+ std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out
+ | std::ios_base::trunc);
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+#endif
+}
diff --git a/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
new file mode 100644
index 000000000000..131b587639aa
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_fstream
+
+// void open(const wchar_t* s, ios_base::openmode mode = ios_base::in|ios_base::out);
+
+#include <fstream>
+#include <cassert>
+#include "platform_support.h"
+
+int main()
+{
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::fstream fs;
+ assert(!fs.is_open());
+ fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out
+ | std::ios_base::trunc);
+ assert(fs.is_open());
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+ {
+ std::wfstream fs;
+ assert(!fs.is_open());
+ fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out
+ | std::ios_base::trunc);
+ assert(fs.is_open());
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+#endif
+}
diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat
new file mode 100644
index 000000000000..64064d34a8e3
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat
@@ -0,0 +1 @@
+3.25 \ No newline at end of file
diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
new file mode 100644
index 000000000000..84a2bf992eb3
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ifstream
+
+// explicit basic_ifstream(const wchar_t* s, ios_base::openmode mode = ios_base::in);
+
+#include <fstream>
+#include <cassert>
+
+int main()
+{
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+ {
+ std::ifstream fs(L"test.dat");
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ // std::ifstream(const wchar_t*, std::ios_base::openmode) is tested in
+ // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
+ // which creates writable files.
+ {
+ std::wifstream fs(L"test.dat");
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ // std::wifstream(const wchar_t*, std::ios_base::openmode) is tested in
+ // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
+ // which creates writable files.
+#endif
+}
diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
new file mode 100644
index 000000000000..81351b5572b6
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ifstream
+
+// void open(const wchar_t* s, ios_base::openmode mode = ios_base::in);
+
+#include <fstream>
+#include <cassert>
+
+int main()
+{
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+ {
+ std::ifstream fs;
+ assert(!fs.is_open());
+ char c = 'a';
+ fs >> c;
+ assert(fs.fail());
+ assert(c == 'a');
+ fs.open(L"test.dat");
+ assert(fs.is_open());
+ fs >> c;
+ assert(c == 'r');
+ }
+ {
+ std::wifstream fs;
+ assert(!fs.is_open());
+ wchar_t c = L'a';
+ fs >> c;
+ assert(fs.fail());
+ assert(c == L'a');
+ fs.open(L"test.dat");
+ assert(fs.is_open());
+ fs >> c;
+ assert(c == L'r');
+ }
+#endif
+}
diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat
new file mode 100644
index 000000000000..1d2f01491f78
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat
@@ -0,0 +1 @@
+r \ No newline at end of file
diff --git a/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
new file mode 100644
index 000000000000..6741e75cebad
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ofstream
+
+// explicit basic_ofstream(const wchar_t* s, ios_base::openmode mode = ios_base::out);
+
+#include <fstream>
+#include <cassert>
+#include "platform_support.h"
+
+int main()
+{
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::ofstream fs(temp.c_str());
+ fs << 3.25;
+ }
+ {
+ std::ifstream fs(temp.c_str());
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ {
+ std::ifstream fs(temp.c_str(), std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+ {
+ std::wofstream fs(temp.c_str());
+ fs << 3.25;
+ }
+ {
+ std::wifstream fs(temp.c_str());
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ {
+ std::wifstream fs(temp.c_str(), std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+#endif
+}
diff --git a/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
new file mode 100644
index 000000000000..8c2e6230857c
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ofstream
+
+// void open(const wchar_t* s, ios_base::openmode mode = ios_base::out);
+
+#include <fstream>
+#include <cassert>
+#include "platform_support.h"
+
+int main()
+{
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::ofstream fs;
+ assert(!fs.is_open());
+ char c = 'a';
+ fs << c;
+ assert(fs.fail());
+ fs.open(temp.c_str());
+ assert(fs.is_open());
+ fs << c;
+ }
+ {
+ std::ifstream fs(temp.c_str());
+ char c = 0;
+ fs >> c;
+ assert(c == 'a');
+ }
+ _wremove(temp.c_str());
+ {
+ std::wofstream fs;
+ assert(!fs.is_open());
+ wchar_t c = L'a';
+ fs << c;
+ assert(fs.fail());
+ fs.open(temp.c_str());
+ assert(fs.is_open());
+ fs << c;
+ }
+ {
+ std::wifstream fs(temp.c_str());
+ wchar_t c = 0;
+ fs >> c;
+ assert(c == L'a');
+ }
+ _wremove(temp.c_str());
+#endif
+}
diff --git a/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
new file mode 100644
index 000000000000..c843b7e988ba
--- /dev/null
+++ b/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_fstream
+
+// The char type of the stream and the char_type of the traits have to match
+
+#include <fstream>
+
+int main()
+{
+ std::basic_fstream<char, std::char_traits<wchar_t> > f;
+// expected-error-re@ios:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
+// expected-error-re@streambuf:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
+
+// FIXME: As of commit r324062 Clang incorrectly generates a diagnostic about mismatching
+// exception specifications for types which are already invalid for one reason or another.
+// For now we tolerate this diagnostic.
+// expected-error@ostream:* 0-1 {{exception specification of overriding function is more lax than base version}}
+}
+
diff --git a/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp b/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp
new file mode 100644
index 000000000000..6372755fc09e
--- /dev/null
+++ b/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// RUN: %build -I%libcxx_src_root/src/filesystem
+// RUN: %run
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+#include "filesystem_common.h"
+
+using namespace fs::detail;
+
+TEST_SUITE(directory_entry_mods_suite)
+
+TEST_CASE(last_write_time_not_representable_error) {
+ using namespace fs;
+ using namespace std::chrono;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+
+ TimeSpec ToTime;
+ ToTime.tv_sec = std::numeric_limits<decltype(ToTime.tv_sec)>::max();
+ ToTime.tv_nsec = duration_cast<nanoseconds>(seconds(1)).count() - 1;
+
+ std::array<TimeSpec, 2> TS = {ToTime, ToTime};
+
+ file_time_type old_time = last_write_time(file);
+ directory_entry ent(file);
+
+ file_time_type start_time = file_time_type::clock::now() - hours(1);
+ last_write_time(file, start_time);
+
+ TEST_CHECK(ent.last_write_time() == old_time);
+
+ bool IsRepresentable = true;
+ file_time_type rep_value;
+ {
+ std::error_code ec;
+ TEST_REQUIRE(!set_file_times(file, TS, ec));
+ ec.clear();
+ rep_value = last_write_time(file, ec);
+ IsRepresentable = !bool(ec);
+ }
+
+ if (!IsRepresentable) {
+ std::error_code rec = GetTestEC();
+ ent.refresh(rec);
+ TEST_CHECK(!rec);
+
+ const std::errc expected_err = std::errc::value_too_large;
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, expected_err));
+
+ ec = GetTestEC();
+ TEST_CHECK(last_write_time(file, ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, expected_err));
+
+ ExceptionChecker CheckExcept(file, expected_err,
+ "directory_entry::last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, CheckExcept,
+ ent.last_write_time());
+
+ } else {
+ ent.refresh();
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == rep_value);
+ TEST_CHECK(!ec);
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp b/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp
index aea46f10c9bc..405f9abc242c 100644
--- a/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp
+++ b/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp
@@ -10,14 +10,16 @@
// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: libcpp-no-exceptions
-// <experimental/filesystem>
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
+
+// <filesystem>
// class path
#define _LIBCPP_DEBUG 0
-#define _LIBCPP_ASSERT(cond, msg) ((cond) ? ((void)0) : throw 42)
-
-#include <experimental/filesystem>
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include "filesystem_include.hpp"
#include <iterator>
#include <type_traits>
#include <cassert>
@@ -25,21 +27,20 @@
#include "test_macros.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
-
int main() {
using namespace fs;
+ using ExType = std::__libcpp_debug_exception;
// Test incrementing/decrementing a singular iterator
{
path::iterator singular;
try {
++singular;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
try {
--singular;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
}
// Test decrementing the begin iterator
{
@@ -48,13 +49,13 @@ int main() {
try {
--it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
++it;
++it;
try {
++it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
}
// Test incrementing the end iterator
{
@@ -63,12 +64,12 @@ int main() {
try {
++it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
--it;
--it;
try {
--it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
}
}
diff --git a/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp b/test/libcxx/input.output/filesystems/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp
index 5a6f5304a061..992cdebb5f06 100644
--- a/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp
+++ b/test/libcxx/input.output/filesystems/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp
@@ -9,16 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <iterator>
-namespace fs = std::experimental::filesystem;
-
int main() {
using namespace fs;
using RIt = std::reverse_iterator<path::iterator>;
diff --git a/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp b/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp
index 61d322524071..ff0cc5935f5c 100644
--- a/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp
+++ b/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// template <class Tp> struct __is_pathable
@@ -21,7 +21,7 @@
// * A character array, which points to a NTCTS after array-to-pointer decay.
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -30,8 +30,6 @@
#include "min_allocator.h"
#include "constexpr_char_traits.hpp"
-namespace fs = std::experimental::filesystem;
-
using fs::__is_pathable;
template <class Tp>
diff --git a/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp b/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp
new file mode 100644
index 000000000000..21a1a4992da3
--- /dev/null
+++ b/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp
@@ -0,0 +1,307 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <filesystem>
+
+// typedef TrivialClock file_time_type;
+
+// RUN: %build -I%libcxx_src_root/src/filesystem
+// RUN: %run
+
+#include <filesystem>
+#include <chrono>
+#include <type_traits>
+#include <limits>
+#include <cstddef>
+#include <cassert>
+
+#include "filesystem_common.h"
+
+#ifndef __SIZEOF_INT128__
+#define TEST_HAS_NO_INT128_T
+#endif
+
+using namespace std::chrono;
+namespace fs = std::__fs::filesystem;
+using fs::file_time_type;
+using fs::detail::time_util;
+
+#ifdef TEST_HAS_NO_INT128_T
+static_assert(sizeof(fs::file_time_type::rep) <= 8, "");
+#endif
+
+enum TestKind { TK_128Bit, TK_64Bit, TK_32Bit, TK_FloatingPoint };
+
+template <class TimeT>
+constexpr TestKind getTimeTTestKind() {
+ if (sizeof(TimeT) == 8 && !std::is_floating_point<TimeT>::value)
+ return TK_64Bit;
+ else if (sizeof(TimeT) == 4 && !std::is_floating_point<TimeT>::value)
+ return TK_32Bit;
+ else if (std::is_floating_point<TimeT>::value)
+ return TK_FloatingPoint;
+ else
+ assert(false && "test kind not supported");
+}
+template <class FileTimeT>
+constexpr TestKind getFileTimeTestKind() {
+ using Rep = typename FileTimeT::rep;
+ if (std::is_floating_point<Rep>::value)
+ return TK_FloatingPoint;
+ else if (sizeof(Rep) == 16)
+ return TK_128Bit;
+ else if (sizeof(Rep) == 8)
+ return TK_64Bit;
+ else
+ assert(false && "test kind not supported");
+}
+
+template <class FileTimeT, class TimeT, class TimeSpecT,
+ class Base = time_util<FileTimeT, TimeT, TimeSpecT>,
+ TestKind = getTimeTTestKind<TimeT>(),
+ TestKind = getFileTimeTestKind<FileTimeT>()>
+struct test_case;
+
+template <class FileTimeT, class TimeT, class TimeSpecT, class Base>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_128Bit>
+ : public Base {
+
+ using Base::convert_from_timespec;
+ using Base::convert_to_timespec;
+ using Base::is_representable;
+ using Base::max_nsec;
+ using Base::max_seconds;
+ using Base::min_nsec_timespec;
+ using Base::min_seconds;
+
+ static constexpr auto max_time_t = std::numeric_limits<TimeT>::max();
+ static constexpr auto min_time_t = std::numeric_limits<TimeT>::min();
+
+ static constexpr bool test_timespec() {
+ static_assert(is_representable(TimeSpecT{max_time_t, 0}), "");
+ static_assert(is_representable(TimeSpecT{max_time_t, 999999999}), "");
+ static_assert(is_representable(TimeSpecT{max_time_t, 1000000000}), "");
+ static_assert(is_representable(TimeSpecT{max_time_t, max_nsec}), "");
+
+ static_assert(is_representable(TimeSpecT{min_time_t, 0}), "");
+ static_assert(is_representable(TimeSpecT{min_time_t, 999999999}), "");
+ static_assert(is_representable(TimeSpecT{min_time_t, 1000000000}), "");
+ static_assert(is_representable(TimeSpecT{min_time_t, min_nsec_timespec}),
+ "");
+
+ return true;
+ }
+
+ static constexpr bool test_file_time_type() {
+ // This kinda sucks. Oh well.
+ static_assert(!Base::is_representable(FileTimeT::max()), "");
+ static_assert(!Base::is_representable(FileTimeT::min()), "");
+ return true;
+ }
+
+ static constexpr bool check_round_trip(TimeSpecT orig) {
+ TimeSpecT new_ts = {};
+ FileTimeT out = convert_from_timespec(orig);
+ assert(convert_to_timespec(new_ts, out));
+ return new_ts.tv_sec == orig.tv_sec && new_ts.tv_nsec == orig.tv_nsec;
+ }
+
+ static constexpr bool test_convert_timespec() {
+ static_assert(check_round_trip({0, 0}), "");
+ static_assert(check_round_trip({0, 1}), "");
+ static_assert(check_round_trip({1, 1}), "");
+ static_assert(check_round_trip({-1, 1}), "");
+ static_assert(check_round_trip({max_time_t, max_nsec}), "");
+ static_assert(check_round_trip({max_time_t, 123}), "");
+ static_assert(check_round_trip({min_time_t, min_nsec_timespec}), "");
+ static_assert(check_round_trip({min_time_t, 123}), "");
+ return true;
+ }
+
+ static bool test() {
+ static_assert(test_timespec(), "");
+ static_assert(test_file_time_type(), "");
+ static_assert(test_convert_timespec(), "");
+ return true;
+ }
+};
+
+template <class FileTimeT, class TimeT, class TimeSpecT, class Base>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit, TK_128Bit>
+ : public test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_128Bit> {
+
+};
+
+template <class FileTimeT, class TimeT, class TimeSpecT, class Base>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_64Bit>
+ : public Base {
+
+ using Base::convert_from_timespec;
+ using Base::is_representable;
+ using Base::max_nsec;
+ using Base::max_seconds;
+ using Base::min_nsec_timespec;
+ using Base::min_seconds;
+
+ static constexpr auto max_time_t = std::numeric_limits<TimeT>::max();
+ static constexpr auto min_time_t = std::numeric_limits<TimeT>::min();
+
+ static constexpr bool test_timespec() {
+ static_assert(is_representable(TimeSpecT{max_seconds, max_nsec}), "");
+ static_assert(!is_representable(TimeSpecT{max_seconds + 1, 0}), "");
+ static_assert(!is_representable(TimeSpecT{max_seconds, max_nsec + 1}), "");
+ static_assert(!is_representable(TimeSpecT{max_time_t, 0}), "");
+ static_assert(is_representable(TimeSpecT{min_seconds, 0}), "");
+ static_assert(
+ is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec}), "");
+ static_assert(
+ is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}),
+ "");
+ static_assert(
+ !is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec - 1}),
+ "");
+ static_assert(!is_representable(TimeSpecT{min_time_t, 999999999}), "");
+ return true;
+ }
+
+ static constexpr bool test_file_time_type() {
+ static_assert(Base::is_representable(FileTimeT::max()), "");
+ static_assert(Base::is_representable(FileTimeT::min()), "");
+ return true;
+ }
+
+ static constexpr bool test_convert_timespec() {
+ static_assert(convert_from_timespec(TimeSpecT{max_seconds, max_nsec}) ==
+ FileTimeT::max(),
+ "");
+ static_assert(convert_from_timespec(TimeSpecT{max_seconds, max_nsec - 1}) <
+ FileTimeT::max(),
+ "");
+ static_assert(convert_from_timespec(TimeSpecT{max_seconds - 1, 999999999}) <
+ FileTimeT::max(),
+ "");
+ static_assert(convert_from_timespec(TimeSpecT{
+ min_seconds - 1, min_nsec_timespec}) == FileTimeT::min(),
+ "");
+ static_assert(convert_from_timespec(
+ TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}) >
+ FileTimeT::min(),
+ "");
+ static_assert(convert_from_timespec(TimeSpecT{min_seconds, 0}) >
+ FileTimeT::min(),
+ "");
+ return true;
+ }
+
+ static bool test() {
+ static_assert(test_timespec(), "");
+ static_assert(test_file_time_type(), "");
+ static_assert(test_convert_timespec(), "");
+ return true;
+ }
+};
+
+template <class FileTimeT, class TimeT, class TimeSpecT, class Base>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit, TK_64Bit>
+ : public Base {
+ static constexpr auto max_time_t = std::numeric_limits<TimeT>::max();
+ static constexpr auto min_time_t = std::numeric_limits<TimeT>::min();
+
+ using Base::convert_from_timespec;
+ using Base::is_representable;
+ using Base::max_nsec;
+ using Base::max_seconds;
+ using Base::min_nsec_timespec;
+ using Base::min_seconds;
+
+ static constexpr bool test_timespec() {
+ static_assert(is_representable(TimeSpecT{max_time_t, 999999999}), "");
+ static_assert(is_representable(TimeSpecT{max_time_t, 1000000000}), "");
+ static_assert(is_representable(TimeSpecT{min_time_t, 0}), "");
+ return true;
+ }
+
+ static constexpr bool test_file_time_type() {
+ static_assert(!is_representable(FileTimeT::max()), "");
+ static_assert(!is_representable(FileTimeT::min()), "");
+ static_assert(is_representable(FileTimeT(seconds(max_time_t))), "");
+ static_assert(is_representable(FileTimeT(seconds(min_time_t))), "");
+ return true;
+ }
+
+ static constexpr bool test_convert_timespec() {
+ // FIXME add tests for 32 bit builds
+ return true;
+ }
+
+ static bool test() {
+ static_assert(test_timespec(), "");
+ static_assert(test_file_time_type(), "");
+ static_assert(test_convert_timespec(), "");
+ return true;
+ }
+};
+
+template <class FileTimeT, class TimeT, class TimeSpec, class Base,
+ TestKind FileTimeTKind>
+struct test_case<FileTimeT, TimeT, TimeSpec, Base, TK_FloatingPoint,
+ FileTimeTKind> : public Base {
+
+ static bool test() { return true; }
+};
+
+template <class TimeT, class NSecT = long>
+struct TestTimeSpec {
+ TimeT tv_sec;
+ NSecT tv_nsec;
+};
+
+template <class Dur>
+struct TestClock {
+ typedef Dur duration;
+ typedef typename duration::rep rep;
+ typedef typename duration::period period;
+ typedef std::chrono::time_point<TestClock> time_point;
+ static constexpr const bool is_steady = false;
+
+ static time_point now() noexcept { return {}; }
+};
+
+template <class IntType, class Period = std::micro>
+using TestFileTimeT = time_point<TestClock<duration<IntType, Period> > >;
+
+int main() {
+ { assert((test_case<file_time_type, time_t, struct timespec>::test())); }
+ {
+ assert((test_case<TestFileTimeT<int64_t>, int64_t,
+ TestTimeSpec<int64_t, long> >::test()));
+ }
+ {
+ assert((test_case<TestFileTimeT<long long>, int32_t,
+ TestTimeSpec<int32_t, int32_t> >::test()));
+ }
+ {
+ // Test that insane platforms like ppc64 linux, which use long double as time_t,
+ // at least compile.
+ assert((test_case<TestFileTimeT<long double>, double,
+ TestTimeSpec<long double, long> >::test()));
+ }
+#ifndef TEST_HAS_NO_INT128_T
+ {
+ assert((test_case<TestFileTimeT<__int128_t, std::nano>, int64_t,
+ TestTimeSpec<int64_t, long> >::test()));
+ }
+ {
+ assert((test_case<TestFileTimeT<__int128_t, std::nano>, int32_t,
+ TestTimeSpec<int32_t, int32_t> >::test()));
+ }
+#endif
+}
diff --git a/test/libcxx/experimental/filesystem/lit.local.cfg b/test/libcxx/input.output/filesystems/lit.local.cfg
index 3d9360431f48..3d9360431f48 100644
--- a/test/libcxx/experimental/filesystem/lit.local.cfg
+++ b/test/libcxx/input.output/filesystems/lit.local.cfg
diff --git a/test/libcxx/experimental/optional/version.pass.cpp b/test/libcxx/input.output/filesystems/version.pass.cpp
index 585b7a24eea5..f680217ef2ca 100644
--- a/test/libcxx/experimental/optional/version.pass.cpp
+++ b/test/libcxx/input.output/filesystems/version.pass.cpp
@@ -7,9 +7,9 @@
//
//===----------------------------------------------------------------------===//
-// <optional>
+// <filesystem>
-#include <experimental/optional>
+#include <filesystem>
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp b/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
index baad3b47f3ec..a459ec4fb71b 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp
+++ b/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
@@ -7,27 +7,23 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
+// <istream>
-// constexpr const T& optional<T>::value() const;
+// template <class charT, class traits = char_traits<charT> >
+// class basic_istream;
-#include <experimental/optional>
+// The char type of the stream and the char_type of the traits have to match
+
+#include <istream>
#include <type_traits>
#include <cassert>
-using std::experimental::optional;
+struct test_istream
+ : public std::basic_istream<char, std::char_traits<wchar_t> > {};
-struct X
-{
- constexpr int test() const {return 3;}
- int test() {return 4;}
-};
int main()
{
- {
- constexpr optional<X> opt;
- static_assert(opt.value().test() == 3, "");
- }
+// expected-error-re@ios:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
}
+
diff --git a/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
new file mode 100644
index 000000000000..fab0dd436577
--- /dev/null
+++ b/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <ostream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ostream;
+
+// The char type of the stream and the char_type of the traits have to match
+
+#include <ostream>
+#include <type_traits>
+#include <cassert>
+
+struct test_ostream
+ : public std::basic_ostream<char, std::char_traits<wchar_t> > {};
+
+
+int main()
+{
+// expected-error-re@ios:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
+}
+
diff --git a/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
new file mode 100644
index 000000000000..f048cae0c565
--- /dev/null
+++ b/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <sstream>
+
+// template<class charT, class traits = char_traits<charT>,
+// class Allocator = allocator<charT>>
+// class basic_stringbuf;
+//
+// The char type of the stream and the char_type of the traits have to match
+
+#include <sstream>
+
+int main()
+{
+ std::basic_stringbuf<char, std::char_traits<wchar_t> > sb;
+// expected-error-re@streambuf:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
+// expected-error-re@string:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}}
+}
+
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp b/test/libcxx/iterators/failed.pass.cpp
index a5bfae240073..2e4717b38597 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp
+++ b/test/libcxx/iterators/failed.pass.cpp
@@ -7,25 +7,26 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
+// <iterator>
-// constexpr explicit optional<T>::operator bool() const noexcept;
+// class ostreambuf_iterator
-#include <experimental/optional>
-#include <type_traits>
+// bool failed() const throw();
+//
+// Extension: constructing from NULL is UB; we just make it a failed iterator
+
+#include <iterator>
+#include <sstream>
#include <cassert>
int main()
{
- using std::experimental::optional;
-
{
- constexpr optional<int> opt;
- static_assert(!opt, "");
+ std::ostreambuf_iterator<char> i(nullptr);
+ assert(i.failed());
}
{
- constexpr optional<int> opt(0);
- static_assert(opt, "");
+ std::ostreambuf_iterator<wchar_t> i(nullptr);
+ assert(i.failed());
}
}
diff --git a/test/libcxx/experimental/any/version.pass.cpp b/test/libcxx/language.support/cmp/version.pass.cpp
index 611d65027b19..570a7a6ada3e 100644
--- a/test/libcxx/experimental/any/version.pass.cpp
+++ b/test/libcxx/language.support/cmp/version.pass.cpp
@@ -7,9 +7,9 @@
//
//===----------------------------------------------------------------------===//
-// <experimental/any>
+// <compare>
-#include <experimental/any>
+#include <compare>
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
diff --git a/test/libcxx/experimental/utilities/ratio/version.pass.cpp b/test/libcxx/language.support/support.limits/version.pass.cpp
index 8bc583fb6d94..c79a690854b3 100644
--- a/test/libcxx/experimental/utilities/ratio/version.pass.cpp
+++ b/test/libcxx/language.support/support.limits/version.pass.cpp
@@ -7,12 +7,12 @@
//
//===----------------------------------------------------------------------===//
-// <experimental/ratio>
+// <version>
-#include <experimental/ratio>
+#include <version>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
+#if !defined(_LIBCPP_VERSION)
+#error "_LIBCPP_VERSION must be defined after including <version>"
#endif
int main()
diff --git a/test/libcxx/memory/is_allocator.pass.cpp b/test/libcxx/memory/is_allocator.pass.cpp
new file mode 100644
index 000000000000..95f1079d61a5
--- /dev/null
+++ b/test/libcxx/memory/is_allocator.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+
+// <memory>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template<typename _Alloc>
+// struct __is_allocator;
+
+// Is either true_type or false_type depending on if A is an allocator.
+
+#include <memory>
+#include <string>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+#include "test_allocator.h"
+
+template <typename T>
+void test_allocators()
+{
+ static_assert(!std::__is_allocator<T>::value, "" );
+ static_assert( std::__is_allocator<std::allocator<T>>::value, "" );
+ static_assert( std::__is_allocator<test_allocator<T>>::value, "" );
+ static_assert( std::__is_allocator<min_allocator<T>>::value, "" );
+}
+
+
+int main()
+{
+// test_allocators<void>();
+ test_allocators<char>();
+ test_allocators<int>();
+ test_allocators<std::string>();
+}
diff --git a/test/libcxx/min_max_macros.sh.cpp b/test/libcxx/min_max_macros.sh.cpp
index bae4175b1d63..087aa3645a50 100644
--- a/test/libcxx/min_max_macros.sh.cpp
+++ b/test/libcxx/min_max_macros.sh.cpp
@@ -237,10 +237,6 @@ TEST_MACROS();
#if __cplusplus >= 201103L
#include <experimental/algorithm>
TEST_MACROS();
-#include <experimental/any>
-TEST_MACROS();
-#include <experimental/chrono>
-TEST_MACROS();
#include <experimental/deque>
TEST_MACROS();
#include <experimental/dynarray>
@@ -259,26 +255,14 @@ TEST_MACROS();
TEST_MACROS();
#include <experimental/memory_resource>
TEST_MACROS();
-#include <experimental/numeric>
-TEST_MACROS();
-#include <experimental/optional>
-TEST_MACROS();
#include <experimental/propagate_const>
TEST_MACROS();
-#include <experimental/ratio>
-TEST_MACROS();
#include <experimental/regex>
TEST_MACROS();
#include <experimental/set>
TEST_MACROS();
#include <experimental/string>
TEST_MACROS();
-#include <experimental/string_view>
-TEST_MACROS();
-#include <experimental/system_error>
-TEST_MACROS();
-#include <experimental/tuple>
-TEST_MACROS();
#include <experimental/type_traits>
TEST_MACROS();
#include <experimental/unordered_map>
diff --git a/test/libcxx/numerics/complex.number/__sqr.pass.cpp b/test/libcxx/numerics/complex.number/__sqr.pass.cpp
new file mode 100644
index 000000000000..a3cc9dd388d3
--- /dev/null
+++ b/test/libcxx/numerics/complex.number/__sqr.pass.cpp
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <complex>
+
+// template<class T>
+// complex<T>
+// __sqr(const complex<T>& x);
+
+#include <complex>
+#include <cassert>
+
+template <class T>
+void
+test()
+{
+ const T tolerance = std::is_same<T, float>::value ? 1.e-6 : 1.e-14;
+
+ typedef std::complex<T> cplx;
+ struct test_case
+ {
+ cplx value;
+ cplx expected;
+ };
+
+ const test_case cases[] = {
+ {cplx( 0, 0), cplx( 0, 0)},
+ {cplx( 1, 0), cplx( 1, 0)},
+ {cplx( 2, 0), cplx( 4, 0)},
+ {cplx(-1, 0), cplx( 1, 0)},
+ {cplx( 0, 1), cplx(-1, 0)},
+ {cplx( 0, 2), cplx(-4, 0)},
+ {cplx( 0, -1), cplx(-1, 0)},
+ {cplx( 1, 1), cplx( 0, 2)},
+ {cplx( 1, -1), cplx( 0, -2)},
+ {cplx(-1, -1), cplx( 0, 2)},
+ {cplx(0.5, 0), cplx(0.25, 0)},
+ };
+
+ const unsigned num_cases = sizeof(cases) / sizeof(test_case);
+ for (unsigned i = 0; i < num_cases; ++i)
+ {
+ const test_case& test = cases[i];
+ const std::complex<T> actual = std::__sqr(test.value);
+ assert(std::abs(actual.real() - test.expected.real()) < tolerance);
+ assert(std::abs(actual.imag() - test.expected.imag()) < tolerance);
+ }
+
+ const cplx nan1 = std::__sqr(cplx(NAN, 0));
+ assert(std::isnan(nan1.real()));
+ assert(std::isnan(nan1.imag()));
+
+ const cplx nan2 = std::__sqr(cplx(0, NAN));
+ assert(std::isnan(nan2.real()));
+ assert(std::isnan(nan2.imag()));
+
+ const cplx nan3 = std::__sqr(cplx(NAN, NAN));
+ assert(std::isnan(nan3.real()));
+ assert(std::isnan(nan3.imag()));
+
+ const cplx inf1 = std::__sqr(cplx(INFINITY, 0));
+ assert(std::isinf(inf1.real()));
+ assert(inf1.real() > 0);
+
+ const cplx inf2 = std::__sqr(cplx(0, INFINITY));
+ assert(std::isinf(inf2.real()));
+ assert(inf2.real() < 0);
+}
+
+int main()
+{
+ test<float>();
+ test<double>();
+ test<long double>();
+}
diff --git a/test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp b/test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp
new file mode 100644
index 000000000000..920c0d185261
--- /dev/null
+++ b/test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call __clear_and_shrink() and ensure string invariants hold
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+int main()
+{
+ std::string l = "Long string so that allocation definitely, for sure, absolutely happens. Probably.";
+ std::string s = "short";
+
+ assert(l.__invariants());
+ assert(s.__invariants());
+
+ s.__clear_and_shrink();
+ assert(s.__invariants());
+ assert(s.size() == 0);
+
+ {
+ std::string::size_type cap = l.capacity();
+ l.__clear_and_shrink();
+ assert(l.__invariants());
+ assert(l.size() == 0);
+ assert(l.capacity() < cap);
+ }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif
diff --git a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
index 9efa597d73e1..805aee138972 100644
--- a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
+++ b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
@@ -11,6 +11,12 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
+
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
// <future>
// class promise<R>
@@ -18,9 +24,8 @@
// void set_exception(exception_ptr p);
// Test that a null exception_ptr is diagnosed.
-#define _LIBCPP_ASSERT(x, m) ((x) ? ((void)0) : throw 42)
-
#define _LIBCPP_DEBUG 0
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
#include <future>
#include <exception>
#include <cstdlib>
@@ -29,14 +34,14 @@
int main()
{
+ typedef std::__libcpp_debug_exception ExType;
{
typedef int T;
std::promise<T> p;
try {
p.set_exception(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const&) {
}
}
{
@@ -45,8 +50,7 @@ int main()
try {
p.set_exception(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const&) {
}
}
}
diff --git a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
index dca493382ba2..88061bb5f51f 100644
--- a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
+++ b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
@@ -11,6 +11,12 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
+
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
// <future>
// class promise<R>
@@ -18,9 +24,8 @@
// void set_exception_on_thread_exit(exception_ptr p);
// Test that a null exception_ptr is diagnosed.
-#define _LIBCPP_ASSERT(x, m) ((x) ? ((void)0) : throw 42)
-
#define _LIBCPP_DEBUG 0
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
#include <future>
#include <exception>
#include <cstdlib>
@@ -29,14 +34,14 @@
int main()
{
+ typedef std::__libcpp_debug_exception ExType;
{
typedef int T;
std::promise<T> p;
try {
p.set_exception_at_thread_exit(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const& value) {
}
}
{
@@ -45,8 +50,7 @@ int main()
try {
p.set_exception_at_thread_exit(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const& value) {
}
}
}
diff --git a/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/test/libcxx/type_traits/is_floating_point.pass.cpp
index ea7ef6cbc108..98452fad384b 100644
--- a/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
+++ b/test/libcxx/type_traits/is_floating_point.pass.cpp
@@ -6,18 +6,19 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// <type_traits>
+//
+// Test that is_floating_point<T>::value is true when T=__fp16 or T=_Float16.
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/ratio>
-
-// Test that <ratio> is included.
-
-#include <experimental/ratio>
+#include <type_traits>
-#ifndef _LIBCPP_RATIO
-# error " <experimental/ratio> must include <ratio>"
+int main() {
+#ifdef __clang__
+ static_assert(std::is_floating_point<__fp16>::value, "");
#endif
-
-int main()
-{
+#ifdef __FLT16_MANT_DIG__
+ static_assert(std::is_floating_point<_Float16>::value, "");
+#endif
+ return 0;
}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
deleted file mode 100644
index 1cc3c73d10fe..000000000000
--- a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <tuple>
-
-// Test the diagnostics libc++ generates for invalid reference binding.
-// Libc++ attempts to diagnose the following cases:
-// * Constructing an lvalue reference from an rvalue.
-// * Constructing an rvalue reference from an lvalue.
-
-#include <tuple>
-#include <string>
-
-int main() {
- std::allocator<void> alloc;
-
- // expected-error-re@tuple:* 4 {{static_assert failed{{.*}} "Attempted to construct a reference element in a tuple with an rvalue"}}
-
- // bind lvalue to rvalue
- std::tuple<int const&> t(42); // expected-note {{requested here}}
- std::tuple<int const&> t1(std::allocator_arg, alloc, 42); // expected-note {{requested here}}
- // bind rvalue to constructed non-rvalue
- std::tuple<std::string &&> t2("hello"); // expected-note {{requested here}}
- std::tuple<std::string &&> t3(std::allocator_arg, alloc, "hello"); // expected-note {{requested here}}
-
- // FIXME: The below warnings may get emitted as an error, a warning, or not emitted at all
- // depending on the flags used to compile this test.
- {
- // expected-warning@tuple:* 0+ {{binding reference member '__value_' to a temporary value}}
- // expected-error@tuple:* 0+ {{binding reference member '__value_' to a temporary value}}
- }
-}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
new file mode 100644
index 000000000000..cc222a70eb99
--- /dev/null
+++ b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <tuple>
+
+// See llvm.org/PR20855
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdangling-field"
+#endif
+
+#include <tuple>
+#include <string>
+#include "test_macros.h"
+
+template <class Tp>
+struct ConvertsTo {
+ using RawTp = typename std::remove_cv< typename std::remove_reference<Tp>::type>::type;
+
+ operator Tp() const {
+ return static_cast<Tp>(value);
+ }
+
+ mutable RawTp value;
+};
+
+struct Base {};
+struct Derived : Base {};
+
+template <class T> struct CannotDeduce {
+ using type = T;
+};
+
+template <class ...Args>
+void F(typename CannotDeduce<std::tuple<Args...>>::type const&) {}
+
+
+int main() {
+#if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary)
+ // Test that we emit our diagnostic from the library.
+ // expected-error@tuple:* 8 {{"Attempted construction of reference element binds to a temporary whose lifetime has ended"}}
+
+ // Good news everybody! Clang now diagnoses this for us!
+ // expected-error@tuple:* 0+ {{reference member '__value_' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object}}
+
+ {
+ F<int, const std::string&>(std::make_tuple(1, "abc")); // expected-note 1 {{requested here}}
+ }
+ {
+ std::tuple<int, const std::string&> t(1, "a"); // expected-note 1 {{requested here}}
+ }
+ {
+ F<int, const std::string&>(std::tuple<int, const std::string&>(1, "abc")); // expected-note 1 {{requested here}}
+ }
+ {
+ ConvertsTo<int&> ct;
+ std::tuple<const long&, int> t(ct, 42); // expected-note {{requested here}}
+ }
+ {
+ ConvertsTo<int> ct;
+ std::tuple<int const&, void*> t(ct, nullptr); // expected-note {{requested here}}
+ }
+ {
+ ConvertsTo<Derived> ct;
+ std::tuple<Base const&, int> t(ct, 42); // expected-note {{requested here}}
+ }
+ {
+ std::allocator<void> alloc;
+ std::tuple<std::string &&> t2("hello"); // expected-note {{requested here}}
+ std::tuple<std::string &&> t3(std::allocator_arg, alloc, "hello"); // expected-note {{requested here}}
+ }
+#else
+#error force failure
+// expected-error@-1 {{force failure}}
+#endif
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp b/test/libcxx/utilities/utility/pairs/pairs.pair/assign_tuple_like.pass.cpp
index ef7bebcf5c29..0e0117e4e3ea 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp
+++ b/test/libcxx/utilities/utility/pairs/pairs.pair/assign_tuple_like.pass.cpp
@@ -21,58 +21,22 @@
#include <memory>
#include <cassert>
+#include "archetypes.hpp"
+
// Clang warns about missing braces when initializing std::array.
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wmissing-braces"
#endif
-struct CountingType {
- static int constructed;
- static int copy_constructed;
- static int move_constructed;
- static int assigned;
- static int copy_assigned;
- static int move_assigned;
- static void reset() {
- constructed = copy_constructed = move_constructed = 0;
- assigned = copy_assigned = move_assigned = 0;
- }
- CountingType() : value(0) { ++constructed; }
- CountingType(int v) : value(v) { ++constructed; }
- CountingType(CountingType const& o) : value(o.value) { ++constructed; ++copy_constructed; }
- CountingType(CountingType&& o) : value(o.value) { ++constructed; ++move_constructed; o.value = -1;}
-
- CountingType& operator=(CountingType const& o) {
- ++assigned;
- ++copy_assigned;
- value = o.value;
- return *this;
- }
- CountingType& operator=(CountingType&& o) {
- ++assigned;
- ++move_assigned;
- value = o.value;
- o.value = -1;
- return *this;
- }
- int value;
-};
-int CountingType::constructed;
-int CountingType::copy_constructed;
-int CountingType::move_constructed;
-int CountingType::assigned;
-int CountingType::copy_assigned;
-int CountingType::move_assigned;
-
int main()
{
- using C = CountingType;
+ using C = TestTypes::TestType;
{
using P = std::pair<int, C>;
using T = std::tuple<int, C>;
T t(42, C{42});
P p(101, C{101});
- C::reset();
+ C::reset_constructors();
p = t;
assert(C::constructed == 0);
assert(C::assigned == 1);
@@ -86,7 +50,7 @@ int main()
using T = std::tuple<int, C>;
T t(42, -42);
P p(101, 101);
- C::reset();
+ C::reset_constructors();
p = std::move(t);
assert(C::constructed == 0);
assert(C::assigned == 1);
@@ -100,7 +64,7 @@ int main()
using T = std::array<C, 2>;
T t = {42, -42};
P p{101, 101};
- C::reset();
+ C::reset_constructors();
p = t;
assert(C::constructed == 0);
assert(C::assigned == 2);
@@ -114,7 +78,7 @@ int main()
using T = std::array<C, 2>;
T t = {42, -42};
P p{101, 101};
- C::reset();
+ C::reset_constructors();
p = t;
assert(C::constructed == 0);
assert(C::assigned == 2);
@@ -128,7 +92,7 @@ int main()
using T = std::array<C, 2>;
T t = {42, -42};
P p{101, 101};
- C::reset();
+ C::reset_constructors();
p = std::move(t);
assert(C::constructed == 0);
assert(C::assigned == 2);
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 72dcc3aefda3..53f797268f17 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -22,8 +22,12 @@ config.sysroot = "@LIBCXX_SYSROOT@"
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
config.generate_coverage = "@LIBCXX_GENERATE_COVERAGE@"
config.target_info = "@LIBCXX_TARGET_INFO@"
+config.test_linker_flags = "@LIBCXX_TEST_LINKER_FLAGS@"
+config.test_compiler_flags = "@LIBCXX_TEST_COMPILER_FLAGS@"
+
config.executor = "@LIBCXX_EXECUTOR@"
config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@"
+config.compiler_rt = "@LIBCXX_USE_COMPILER_RT@"
config.has_libatomic = "@LIBCXX_HAS_ATOMIC_LIB@"
config.use_libatomic = "@LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB@"
config.debug_build = "@LIBCXX_DEBUG_BUILD@"
diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp
index a20d6ab7df86..d2d567f317de 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp
@@ -10,14 +10,27 @@
// <algorithm>
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// copy(InIter first, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {1, 2, 3, 4, 5};
+// int ic[] = {6, 6, 6, 6, 6, 6, 6};
+//
+// auto p = std::copy(std::begin(ia), std::end(ia), std::begin(ic));
+// return std::equal(std::begin(ia), std::end(ia), std::begin(ic), p)
+// && std::all_of(p, std::end(ic), [](int a){return a == 6;})
+// ;
+// }
+// #endif
+
template <class InIter, class OutIter>
void
test()
@@ -70,4 +83,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+// #if TEST_STD_VER > 17
+// static_assert(test_constexpr());
+// #endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp
index 039fd2fe026a..3a2f0f62c2ec 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp
@@ -11,13 +11,28 @@
// template<BidirectionalIterator InIter, BidirectionalIterator OutIter>
// requires OutputIterator<OutIter, InIter::reference>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// copy_backward(InIter first, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#include "user_defined_integral.hpp"
+
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {1, 2, 3, 4, 5};
+// int ic[] = {6, 6, 6, 6, 6, 6, 6};
+//
+// size_t N = std::size(ia);
+// auto p = std::copy_backward(std::begin(ia), std::end(ia), std::begin(ic) + N);
+// return std::equal(std::begin(ic), p, std::begin(ia))
+// && std::all_of(p, std::end(ic), [](int a){return a == 6;})
+// ;
+// }
+// #endif
template <class InIter, class OutIter>
void
@@ -48,4 +63,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+// #if TEST_STD_VER > 17
+// static_assert(test_constexpr());
+// #endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp
index ab402a5eb8be..19018151f20f 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp
@@ -12,14 +12,27 @@
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter,
// Predicate<auto, InIter::value_type> Pred>
// requires CopyConstructible<Pred>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// copy_if(InIter first, InIter last, OutIter result, Pred pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {2, 4, 6, 8, 6};
+// int ic[] = {0, 0, 0, 0, 0, 0};
+//
+// auto p = std::copy_if(std::begin(ia), std::end(ia), std::begin(ic), is6);
+// return std::all_of(std::begin(ic), p, [](int a){return a == 6;})
+// && std::all_of(p, std::end(ic), [](int a){return a == 0;})
+// ;
+// }
+// #endif
+
struct Pred
{
bool operator()(int i) {return i % 3 == 0;}
@@ -77,4 +90,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+// #if TEST_STD_VER > 17
+// static_assert(test_constexpr());
+// #endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
index 1dba8847c7e5..0e5fa63a3257 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
@@ -10,15 +10,28 @@
// <algorithm>
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// copy_n(InIter first, InIter::difference_type n, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "user_defined_integral.hpp"
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {1, 2, 3, 4, 5};
+// int ic[] = {6, 6, 6, 6, 6, 6, 6};
+//
+// auto p = std::copy_n(std::begin(ia), 4, std::begin(ic));
+// return std::equal(std::begin(ic), p, std::begin(ia))
+// && std::all_of(p, std::end(ic), [](int a){return a == 6;})
+// ;
+// }
+// #endif
+
typedef UserDefinedIntegral<unsigned> UDI;
template <class InIter, class OutIter>
@@ -73,4 +86,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+// #if TEST_STD_VER > 17
+// static_assert(test_constexpr());
+// #endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp
index c72adac9e2e4..1c08fee40bc2 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp
@@ -11,14 +11,26 @@
// template<ForwardIterator Iter, class T>
// requires OutputIterator<Iter, const T&>
-// void
+// constexpr void // constexpr after C++17
// fill(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3, 4};
+
+ std::fill(std::begin(ia), std::end(ia), 5);
+
+ return std::all_of(std::begin(ia), std::end(ia), [](int a) {return a == 5; })
+ ;
+ }
+#endif
+
template <class Iter>
void
test_char()
@@ -56,4 +68,8 @@ int main()
test_int<bidirectional_iterator<int*> >();
test_int<random_access_iterator<int*> >();
test_int<int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
index f39436048aef..1e962990b8fe 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
@@ -11,15 +11,29 @@
// template<class Iter, IntegralLike Size, class T>
// requires OutputIterator<Iter, const T&>
-// OutputIterator
+// constexpr OutputIterator // constexpr after C++17
// fill_n(Iter first, Size n, const T& value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "user_defined_integral.hpp"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ const size_t N = 5;
+ int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N
+
+ auto it = std::fill_n(std::begin(ib), N, 5);
+ return it == (std::begin(ib) + N)
+ && std::all_of(std::begin(ib), it, [](int a) {return a == 5; })
+ && *it == 0 // don't overwrite the last value in the output array
+ ;
+ }
+#endif
+
typedef UserDefinedIntegral<unsigned> UDI;
template <class Iter>
@@ -153,4 +167,8 @@ int main()
test5();
test6();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp
index f166d67ba2f7..1b1562866f43 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp
@@ -12,19 +12,33 @@
// template<ForwardIterator Iter, Callable Generator>
// requires OutputIterator<Iter, Generator::result_type>
// && CopyConstructible<Generator>
-// void
+// constexpr void // constexpr after c++17
// generate(Iter first, Iter last, Generator gen);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct gen_test
{
- int operator()() const {return 1;}
+ TEST_CONSTEXPR int operator()() const {return 1;}
};
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3, 4};
+
+ std::generate(std::begin(ia), std::end(ia), gen_test());
+
+ return std::all_of(std::begin(ia), std::end(ia), [](int x) { return x == 1; })
+ ;
+ }
+#endif
+
+
template <class Iter>
void
test()
@@ -44,4 +58,8 @@ int main()
test<bidirectional_iterator<int*> >();
test<random_access_iterator<int*> >();
test<int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
index b7322542931d..7e81610acc83 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
@@ -12,25 +12,42 @@
// template<class Iter, IntegralLike Size, Callable Generator>
// requires OutputIterator<Iter, Generator::result_type>
// && CopyConstructible<Generator>
-// void
+// constexpr void // constexpr after c++17
// generate_n(Iter first, Size n, Generator gen);
-#ifdef _MSC_VER
+#include "test_macros.h"
+
+#ifdef TEST_COMPILER_C1XX
#pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
#endif
#include <algorithm>
#include <cassert>
-#include "test_macros.h"
#include "test_iterators.h"
#include "user_defined_integral.hpp"
struct gen_test
{
- int operator()() const {return 2;}
+ TEST_CONSTEXPR int operator()() const {return 2;}
};
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ const size_t N = 5;
+ int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N
+
+ auto it = std::generate_n(std::begin(ib), N, gen_test());
+
+ return it == (std::begin(ib) + N)
+ && std::all_of(std::begin(ib), it, [](int x) { return x == 2; })
+ && *it == 0 // don't overwrite the last value in the output array
+ ;
+ }
+#endif
+
+
template <class Iter, class Size>
void
test2()
@@ -64,4 +81,8 @@ int main()
test<bidirectional_iterator<int*> >();
test<random_access_iterator<int*> >();
test<int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
index 8597b08da8cf..b68b28de47c7 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
@@ -10,7 +10,7 @@
// <algorithm>
// template <class InputIterator, class Predicate>
-// bool
+// constpexr bool // constexpr after C++17
// is_partitioned(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
@@ -18,13 +18,24 @@
#include <cstddef>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "counting_predicates.hpp"
struct is_odd {
- bool operator()(const int &i) const { return i & 1; }
+ TEST_CONSTEXPR bool operator()(const int &i) const { return i & 1; }
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 4, 6};
+ int ib[] = {1, 2, 3, 4, 5, 6};
+ return std::is_partitioned(std::begin(ia), std::end(ia), is_odd())
+ && !std::is_partitioned(std::begin(ib), std::end(ib), is_odd());
+ }
+#endif
+
+
int main() {
{
const int ia[] = {1, 2, 3, 4, 5, 6};
@@ -80,4 +91,8 @@ int main() {
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
std::distance(std::begin(ia), std::end(ia)));
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
index 67e1cccaf730..9738fef3583d 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
@@ -11,7 +11,7 @@
// template <class InputIterator, class OutputIterator1,
// class OutputIterator2, class Predicate>
-// pair<OutputIterator1, OutputIterator2>
+// constexpr pair<OutputIterator1, OutputIterator2> // constexpr after C++17
// partition_copy(InputIterator first, InputIterator last,
// OutputIterator1 out_true, OutputIterator2 out_false,
// Predicate pred);
@@ -19,13 +19,31 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct is_odd
{
- bool operator()(const int& i) const {return i & 1;}
+ TEST_CONSTEXPR bool operator()(const int& i) const {return i & 1;}
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 4, 6};
+ int r1[10] = {0};
+ int r2[10] = {0};
+
+ auto p = std::partition_copy(std::begin(ia), std::end(ia),
+ std::begin(r1), std::begin(r2), is_odd());
+
+ return std::all_of(std::begin(r1), p.first, is_odd())
+ && std::all_of(p.first, std::end(r1), [](int a){return a == 0;})
+ && std::none_of(std::begin(r2), p.second, is_odd())
+ && std::all_of(p.second, std::end(r2), [](int a){return a == 0;})
+ ;
+ }
+#endif
+
int main()
{
{
@@ -47,4 +65,8 @@ int main()
assert(r2[2] == 6);
assert(r2[3] == 8);
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp
index f5b832c66397..1ea9885c1bd9 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp
@@ -10,19 +10,32 @@
// <algorithm>
// template<class ForwardIterator, class Predicate>
-// ForwardIterator
+// constpexr ForwardIterator // constexpr after C++17
// partition_point(ForwardIterator first, ForwardIterator last, Predicate pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct is_odd
{
- bool operator()(const int& i) const {return i & 1;}
+ TEST_CONSTEXPR bool operator()(const int& i) const {return i & 1;}
};
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 4, 6};
+ int ib[] = {1, 2, 3, 4, 5, 6};
+ return (std::partition_point(std::begin(ia), std::end(ia), is_odd()) == ia+3)
+ && (std::partition_point(std::begin(ib), std::end(ib), is_odd()) == ib+1)
+ ;
+ }
+#endif
+
+
int main()
{
{
@@ -73,4 +86,8 @@ int main()
forward_iterator<const int*>(std::begin(ia)),
is_odd()) == forward_iterator<const int*>(ia));
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
index a77a9eddb191..70b3316d3679 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
@@ -12,7 +12,7 @@
// template<ForwardIterator Iter, class T>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && HasEqualTo<Iter::value_type, T>
-// Iter
+// constexpr Iter // constexpr after C++17
// remove(Iter first, Iter last, const T& value);
#include <algorithm>
@@ -22,6 +22,18 @@
#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 5, 6};
+
+ auto it = std::remove(std::begin(ia), std::end(ia), 5);
+
+ return (std::begin(ia) + std::size(ia) - 2) == it // we removed two elements
+ && std::none_of(std::begin(ia), it, [](int a) {return a == 5; })
+ ;
+ }
+#endif
+
template <class Iter>
void
test()
@@ -75,4 +87,8 @@ int main()
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
#endif // TEST_STD_VER >= 11
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp
index bf5f79cf8359..4ace1494d858 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp
@@ -11,14 +11,29 @@
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter, class T>
// requires HasEqualTo<InIter::value_type, T>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// remove_copy(InIter first, InIter last, OutIter result, const T& value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 5, 6};
+ int ib[std::size(ia)] = {0};
+
+ auto it = std::remove_copy(std::begin(ia), std::end(ia), std::begin(ib), 5);
+
+ return std::distance(std::begin(ib), it) == (std::size(ia) - 2) // we removed two elements
+ && std::none_of(std::begin(ib), it, [](int a) {return a == 5;})
+ && std::all_of (it, std::end(ib), [](int a) {return a == 0;})
+ ;
+ }
+#endif
+
template <class InIter, class OutIter>
void
test()
@@ -67,4 +82,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
index 8532998eb08d..c13788690e88 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
@@ -12,16 +12,31 @@
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter,
// Predicate<auto, InIter::value_type> Pred>
// requires CopyConstructible<Pred>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// remove_copy_if(InIter first, InIter last, OutIter result, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-bool equalToTwo(int v) { return v == 2; }
+TEST_CONSTEXPR bool equalToTwo(int v) { return v == 2; }
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 5, 6};
+ int ib[std::size(ia)] = {0};
+
+ auto it = std::remove_copy_if(std::begin(ia), std::end(ia), std::begin(ib), equalToTwo);
+
+ return std::distance(std::begin(ib), it) == (std::size(ia) - 1) // we removed one element
+ && std::none_of(std::begin(ib), it, equalToTwo)
+ && std::all_of (it, std::end(ib), [](int a) {return a == 0;})
+ ;
+ }
+#endif
template <class InIter, class OutIter>
void
@@ -72,4 +87,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
index c40f3e727836..7a0f3405c606 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
@@ -12,7 +12,7 @@
// template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && CopyConstructible<Pred>
-// Iter
+// constexpr Iter // constexpr after C++17
// remove_if(Iter first, Iter last, Pred pred);
#include <algorithm>
@@ -24,7 +24,19 @@
#include "test_iterators.h"
#include "counting_predicates.hpp"
-bool equal2 ( int i ) { return i == 2; }
+TEST_CONSTEXPR bool equal2 ( int i ) { return i == 2; }
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 5, 6};
+
+ auto it = std::remove_if(std::begin(ia), std::end(ia), equal2);
+
+ return (std::begin(ia) + std::size(ia) - 1) == it // we removed one element
+ && std::none_of(std::begin(ia), it, equal2)
+ ;
+ }
+#endif
template <class Iter>
void
@@ -90,4 +102,8 @@ int main()
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
#endif // TEST_STD_VER >= 11
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp
index f6033351ffca..56a744b2c9d4 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp
@@ -13,14 +13,27 @@
// requires OutputIterator<Iter, Iter::reference>
// && OutputIterator<Iter, const T&>
// && HasEqualTo<Iter::value_type, T>
-// void
+// constexpr void // constexpr after C++17
// replace(Iter first, Iter last, const T& old_value, const T& new_value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3, 4};
+ const int expected[] = {0, 1, 5, 3, 4};
+
+ std::replace(std::begin(ia), std::end(ia), 2, 5);
+ return std::equal(std::begin(ia), std::end(ia), std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
template <class Iter>
void
test()
@@ -41,4 +54,8 @@ int main()
test<bidirectional_iterator<int*> >();
test<random_access_iterator<int*> >();
test<int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp
index 3c4d0e50817b..32be4e5bcee0 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp
@@ -13,15 +13,32 @@
// requires OutputIterator<OutIter, InIter::reference>
// && OutputIterator<OutIter, const T&>
// && HasEqualTo<InIter::value_type, T>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// replace_copy(InIter first, InIter last, OutIter result, const T& old_value,
// const T& new_value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3, 4};
+ int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger
+ const int expected[] = {0, 1, 5, 3, 4};
+
+ auto it = std::replace_copy(std::begin(ia), std::end(ia), std::begin(ib), 2, 5);
+
+ return it == (std::begin(ib) + std::size(ia))
+ && *it == 0 // don't overwrite the last value in the output array
+ && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
template <class InIter, class OutIter>
void
test()
@@ -69,4 +86,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
index f2ffece12e8b..3d9a5bb739a9 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
@@ -14,16 +14,33 @@
// requires OutputIterator<OutIter, InIter::reference>
// && OutputIterator<OutIter, const T&>
// && CopyConstructible<Pred>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// replace_copy_if(InIter first, InIter last, OutIter result, Pred pred, const T& new_value);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-bool equalToTwo(int v) { return v == 2; }
+TEST_CONSTEXPR bool equalToTwo(int v) { return v == 2; }
+
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3, 4};
+ int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger
+ const int expected[] = {0, 1, 5, 3, 4};
+
+ auto it = std::replace_copy_if(std::begin(ia), std::end(ia), std::begin(ib), equalToTwo, 5);
+
+ return it == (std::begin(ib) + std::size(ia))
+ && *it == 0 // don't overwrite the last value in the output array
+ && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
template <class InIter, class OutIter>
void
@@ -73,4 +90,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
index ebb2945d7c43..eeff4068740f 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
@@ -13,16 +13,29 @@
// requires OutputIterator<Iter, Iter::reference>
// && OutputIterator<Iter, const T&>
// && CopyConstructible<Pred>
-// void
+// constexpr void // constexpr after C++17
// replace_if(Iter first, Iter last, Pred pred, const T& new_value);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-bool equalToTwo(int v) { return v == 2; }
+TEST_CONSTEXPR bool equalToTwo(int v) { return v == 2; }
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3, 4};
+ const int expected[] = {0, 1, 5, 3, 4};
+
+ std::replace_if(std::begin(ia), std::end(ia), equalToTwo, 5);
+ return std::equal(std::begin(ia), std::end(ia), std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
template <class Iter>
void
@@ -44,4 +57,8 @@ int main()
test<bidirectional_iterator<int*> >();
test<random_access_iterator<int*> >();
test<int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
index 70840d187bfb..e5aa427b9f4c 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
@@ -10,14 +10,28 @@
// <algorithm>
// template<BidirectionalIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// reverse_copy(InIter first, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 5, 6};
+ int ib[std::size(ia)] = {0};
+
+ auto it = std::reverse_copy(std::begin(ia), std::end(ia), std::begin(ib));
+
+ return std::distance(std::begin(ib), it) == std::size(ia)
+ && std::equal (std::begin(ia), std::end(ia), std::rbegin(ib))
+ ;
+ }
+#endif
+
template <class InIter, class OutIter>
void
test()
@@ -78,4 +92,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
index f2ad535a2f99..e0e096a6f8fd 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
@@ -10,14 +10,31 @@
// <algorithm>
// template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// rotate_copy(InIter first, InIter middle, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {1, 3, 5, 2, 5, 6};
+// int ib[std::size(ia)] = {0};
+//
+// const size_t N = 2;
+// const auto middle = std::begin(ia) + N;
+// auto it = std::rotate_copy(std::begin(ia), middle, std::end(ia), std::begin(ib));
+//
+// return std::distance(std::begin(ib), it) == std::size(ia)
+// && std::equal (std::begin(ia), middle, std::begin(ib) + std::size(ia) - N)
+// && std::equal (middle, std::end(ia), std::begin(ib))
+// ;
+// }
+// #endif
+
template <class InIter, class OutIter>
void
test()
@@ -131,4 +148,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+// #if TEST_STD_VER > 17
+// static_assert(test_constexpr());
+// #endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp
index 8491ea59eff6..b2b894912c38 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp
@@ -12,15 +12,34 @@
// template<InputIterator InIter1, InputIterator InIter2, class OutIter,
// Callable<auto, const InIter1::value_type&, const InIter2::value_type&> BinaryOp>
// requires OutputIterator<OutIter, BinaryOp::result_type> && CopyConstructible<BinaryOp>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// transform(InIter1 first1, InIter1 last1, InIter2 first2, OutIter result, BinaryOp binary_op);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ const int ia[] = {1, 3, 6, 7};
+ const int ib[] = {2, 4, 7, 8};
+ int ic[] = {0, 0, 0, 0, 0}; // one bigger
+ const int expected[] = {3, 7, 13, 15};
+
+ auto it = std::transform(std::begin(ia), std::end(ia),
+ std::begin(ib), std::begin(ic), std::plus<int>());
+
+ return it == (std::begin(ic) + std::size(ia))
+ && *it == 0 // don't overwrite the last value in the output array
+ && std::equal(std::begin(expected), std::end(expected), std::begin(ic), it)
+ ;
+ }
+#endif
+
+
template<class InIter1, class InIter2, class OutIter>
void
test()
@@ -214,4 +233,8 @@ int main()
test<const int*, const int*, bidirectional_iterator<int*> >();
test<const int*, const int*, random_access_iterator<int*> >();
test<const int*, const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp
index 6c5e621e4b20..a929291adba1 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp
@@ -12,16 +12,34 @@
// template<InputIterator InIter, class OutIter,
// Callable<auto, const InIter::value_type&> Op>
// requires OutputIterator<OutIter, Op::result_type> && CopyConstructible<Op>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// transform(InIter first, InIter last, OutIter result, Op op);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-int plusOne(int v) { return v + 1; }
+TEST_CONSTEXPR int plusOne(int v) { return v + 1; }
+
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int ib[] = {0, 0, 0, 0, 0}; // one bigger
+ const int expected[] = {2, 4, 7, 8};
+
+ auto it = std::transform(std::begin(ia), std::end(ia), std::begin(ib), plusOne);
+
+ return it == (std::begin(ib) + std::size(ia))
+ && *it == 0 // don't overwrite the last value in the output array
+ && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
template <class InIter, class OutIter>
void
@@ -76,4 +94,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
index 049ccfe9871a..dcb09a181e13 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
@@ -12,7 +12,7 @@
// template<ForwardIterator Iter>
// requires OutputIterator<Iter, Iter::reference>
// && EqualityComparable<Iter::value_type>
-// Iter
+// constexpr Iter // constexpr after C++17
// unique(Iter first, Iter last);
#include <algorithm>
@@ -22,6 +22,19 @@
#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 1, 3, 4};
+ const int expected[] = {0, 1, 3, 4};
+ const size_t N = 4;
+
+ auto it = std::unique(std::begin(ia), std::end(ia));
+ return it == (std::begin(ia) + N)
+ && std::equal(std::begin(ia), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
template <class Iter>
void
test()
@@ -182,4 +195,8 @@ int main()
test1<random_access_iterator<Ptr*> >();
test1<Ptr*>();
#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp
index 761dad4ecd05..48ddcf921e49 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp
@@ -14,14 +14,29 @@
// && EqualityComparable<InIter::value_type>
// && HasAssign<InIter::value_type, InIter::reference>
// && Constructible<InIter::value_type, InIter::reference>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// unique_copy(InIter first, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 2, 4};
+ int ib[] = {0, 0, 0, 0, 0};
+ const int expected[] = {0, 1, 2, 4};
+
+ auto it = std::unique_copy(std::begin(ia), std::end(ia), std::begin(ib));
+ return it == (std::begin(ib) + std::size(expected))
+ && *it == 0 // don't overwrite final value in output
+ && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
template <class InIter, class OutIter>
void
test()
@@ -122,4 +137,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp
index 6819899a1145..55bfd36d5703 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp
@@ -15,14 +15,30 @@
// && HasAssign<InIter::value_type, InIter::reference>
// && Constructible<InIter::value_type, InIter::reference>
// && CopyConstructible<Pred>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// unique_copy(InIter first, InIter last, OutIter result, Pred pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 2, 4};
+ int ib[] = {0, 0, 0, 0, 0};
+ const int expected[] = {0, 1, 2, 4};
+
+ auto it = std::unique_copy(std::begin(ia), std::end(ia), std::begin(ib),
+ [](int a, int b) {return a == b; });
+ return it == (std::begin(ib) + std::size(expected))
+ && *it == 0 // don't overwrite final value in output
+ && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
struct count_equal
{
static unsigned count;
@@ -149,4 +165,8 @@ int main()
test<const int*, bidirectional_iterator<int*> >();
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
index 1640052058c7..2936a4e66f5c 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
@@ -12,7 +12,7 @@
// template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && CopyConstructible<Pred>
-// Iter
+// constexpr Iter // constexpr after C++17
// unique(Iter first, Iter last, Pred pred);
#include <algorithm>
@@ -22,6 +22,19 @@
#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 1, 3, 4};
+ const int expected[] = {0, 1, 3, 4};
+ const size_t N = 4;
+
+ auto it = std::unique(std::begin(ia), std::end(ia), [](int a, int b) {return a == b; });
+ return it == (std::begin(ia) + N)
+ && std::equal(std::begin(ia), it, std::begin(expected), std::end(expected))
+ ;
+ }
+#endif
+
struct count_equal
{
static unsigned count;
@@ -224,4 +237,8 @@ int main()
test1<random_access_iterator<Ptr*> >();
test1<Ptr*>();
#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp
index ee030925d55c..8de06ec7b4b0 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp
@@ -11,14 +11,26 @@
// template<ForwardIterator Iter>
// requires EqualityComparable<Iter::value_type>
-// Iter
+// constexpr Iter // constexpr after C++17
// adjacent_find(Iter first, Iter last);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
+ int ib[] = {0, 1, 2, 7, 0, 1, 2, 3};
+
+ return (std::adjacent_find(std::begin(ia), std::end(ia)) == ia+2)
+ && (std::adjacent_find(std::begin(ib), std::end(ib)) == std::end(ib))
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
@@ -32,4 +44,8 @@ int main()
assert(std::adjacent_find(forward_iterator<const int*>(ia+3),
forward_iterator<const int*>(ia + sa)) ==
forward_iterator<const int*>(ia+sa));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp
index 4d172ff81397..bf445c54d15c 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp
@@ -11,15 +11,30 @@
// template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
-// Iter
+// constexpr Iter // constexpr after C++17
// adjacent_find(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool eq (int a, int b) { return a == b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
+ int ib[] = {0, 1, 2, 7, 0, 1, 2, 3};
+
+ return (std::adjacent_find(std::begin(ia), std::end(ia), eq) == ia+2)
+ && (std::adjacent_find(std::begin(ib), std::end(ib), eq) == std::end(ib))
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
@@ -36,4 +51,8 @@ int main()
forward_iterator<const int*>(ia + sa),
std::equal_to<int>()) ==
forward_iterator<const int*>(ia+sa));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp
index c3c348088195..3840350a03cb 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp
@@ -10,22 +10,33 @@
// <algorithm>
// template <class InputIterator, class Predicate>
-// bool
+// constpexr bool // constexpr after C++17
// all_of(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct test1
{
- bool operator()(const int& i) const
+ TEST_CONSTEXPR bool operator()(const int& i) const
{
return i % 2 == 0;
}
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {2, 4, 6, 8};
+ int ib[] = {2, 4, 5, 8};
+ return std::all_of(std::begin(ia), std::end(ia), test1())
+ && !std::all_of(std::begin(ib), std::end(ib), test1())
+ ;
+ }
+#endif
+
int main()
{
{
@@ -44,4 +55,8 @@ int main()
assert(std::all_of(input_iterator<const int*>(ia),
input_iterator<const int*>(ia), test1()) == true);
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp
index d096e20d2d27..7c80f718f434 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp
@@ -10,22 +10,33 @@
// <algorithm>
// template <class InputIterator, class Predicate>
-// bool
+// constpexr bool // constexpr after C++17
// any_of(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct test1
{
- bool operator()(const int& i) const
+ TEST_CONSTEXPR bool operator()(const int& i) const
{
return i % 2 == 0;
}
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {2, 4, 6, 8};
+ int ib[] = {1, 3, 5, 7};
+ return std::any_of(std::begin(ia), std::end(ia), test1())
+ && !std::any_of(std::begin(ib), std::end(ib), test1())
+ ;
+ }
+#endif
+
int main()
{
{
@@ -52,4 +63,8 @@ int main()
assert(std::any_of(input_iterator<const int*>(ia),
input_iterator<const int*>(ia), test1()) == false);
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp
index 260e5edece5b..bce1095f2eaf 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp
@@ -11,14 +11,25 @@
// template<InputIterator Iter, class T>
// requires HasEqualTo<Iter::value_type, T>
-// Iter::difference_type
+// constexpr Iter::difference_type // constexpr after C++17
// count(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
+ int ib[] = {1, 2, 3, 4, 5, 6};
+ return (std::count(std::begin(ia), std::end(ia), 2) == 3)
+ && (std::count(std::begin(ib), std::end(ib), 9) == 0)
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
@@ -29,4 +40,8 @@ int main()
input_iterator<const int*>(ia + sa), 7) == 0);
assert(std::count(input_iterator<const int*>(ia),
input_iterator<const int*>(ia), 2) == 0);
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
index b837a0e514cf..ff3b6888aa02 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
@@ -11,21 +11,31 @@
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
-// Iter::difference_type
+// constexpr Iter::difference_type // constexpr after C++17
// count_if(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct eq {
- eq (int val) : v(val) {}
- bool operator () (int v2) const { return v == v2; }
+ TEST_CONSTEXPR eq (int val) : v(val) {}
+ TEST_CONSTEXPR bool operator () (int v2) const { return v == v2; }
int v;
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
+ int ib[] = {1, 2, 3, 4, 5, 6};
+ return (std::count_if(std::begin(ia), std::end(ia), eq(2)) == 3)
+ && (std::count_if(std::begin(ib), std::end(ib), eq(9)) == 0)
+ ;
+ }
+#endif
int main()
{
@@ -40,4 +50,8 @@ int main()
assert(std::count_if(input_iterator<const int*>(ia),
input_iterator<const int*>(ia),
eq(2)) == 0);
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
index e867b86b8312..656c7310f4d0 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
@@ -11,8 +11,13 @@
// template<InputIterator Iter1, InputIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
-// bool
+// constexpr bool // constexpr after c++17
// equal(Iter1 first1, Iter1 last1, Iter2 first2);
+//
+// Introduced in C++14:
+// template<InputIterator Iter1, InputIterator Iter2>
+// constexpr bool // constexpr after c++17
+// equal(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
@@ -20,6 +25,25 @@
#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int ib[] = {1, 3};
+ int ic[] = {1, 3, 5, 7};
+ typedef input_iterator<int*> II;
+ typedef bidirectional_iterator<int*> BI;
+
+ return !std::equal(std::begin(ia), std::end(ia), std::begin(ic))
+ && !std::equal(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic))
+ && std::equal(std::begin(ib), std::end(ib), std::begin(ic))
+ && !std::equal(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic))
+
+ && std::equal(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)))
+ && !std::equal(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)))
+ ;
+ }
+#endif
+
int main()
{
@@ -61,4 +85,8 @@ int main()
random_access_iterator<const int*>(ia+s-1)));
#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp
index d57e365a9192..c6bb06baf80a 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp
@@ -12,8 +12,16 @@
// template<InputIterator Iter1, InputIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
-// bool
+// constexpr bool // constexpr after c++17
// equal(Iter1 first1, Iter1 last1, Iter2 first2, Pred pred);
+//
+// Introduced in C++14:
+// template<InputIterator Iter1, InputIterator Iter2,
+// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
+// requires CopyConstructible<Pred>
+// constexpr bool // constexpr after c++17
+// equal(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred);
+
#include <algorithm>
#include <functional>
@@ -22,6 +30,28 @@
#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool eq(int a, int b) { return a == b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int ib[] = {1, 3};
+ int ic[] = {1, 3, 5, 7};
+ typedef input_iterator<int*> II;
+ typedef bidirectional_iterator<int*> BI;
+
+ return !std::equal(std::begin(ia), std::end(ia), std::begin(ic) , eq)
+ && !std::equal(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic), eq)
+ && std::equal(std::begin(ib), std::end(ib), std::begin(ic) , eq)
+ && !std::equal(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), eq)
+
+ && std::equal(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)) , eq)
+ && !std::equal(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)), eq)
+ ;
+ }
+#endif
+
+
int comparison_count = 0;
template <typename T>
bool counting_equals ( const T &a, const T &b ) {
@@ -81,4 +111,8 @@ int main()
random_access_iterator<const int*>(ib+s),
std::equal_to<int>()));
#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp
index e95162b4ad73..afcf27b5555b 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp
@@ -11,14 +11,34 @@
// template<ForwardIterator Iter1, ForwardIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
-// Iter1
+// constexpr Iter1 // constexpr after C++17
// find_end(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2};
+ int ib[] = {4, 5, 6};
+ int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0};
+ typedef forward_iterator<int*> FI;
+ typedef bidirectional_iterator<int*> BI;
+ typedef random_access_iterator<int*> RI;
+
+ return (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia))) == FI(ic+15))
+ && (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib))) == FI(std::end(ic)))
+ && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia))) == BI(ic+15))
+ && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib))) == BI(std::end(ic)))
+ && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia))) == RI(ic+15))
+ && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib))) == RI(std::end(ic)))
+ ;
+ }
+#endif
+
template <class Iter1, class Iter2>
void
test()
@@ -54,4 +74,8 @@ int main()
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp
index 411858d5b76d..76ac991653eb 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp
@@ -12,22 +12,42 @@
// template<ForwardIterator Iter1, ForwardIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
-// Iter1
+// constexpr Iter1 // constexpr after C++17
// find_end(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct count_equal
{
static unsigned count;
template <class T>
- bool operator()(const T& x, const T& y)
+ TEST_CONSTEXPR_CXX14 bool operator()(const T& x, const T& y)
{++count; return x == y;}
};
+#if TEST_STD_VER > 17
+constexpr bool test_constexpr() {
+ int ia[] = {0, 1, 2};
+ int ib[] = {4, 5, 6};
+ int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0};
+ typedef forward_iterator<int*> FI;
+ typedef bidirectional_iterator<int*> BI;
+ typedef random_access_iterator<int*> RI;
+ std::equal_to<int> eq{};
+ return (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia)), eq) == FI(ic+15))
+ && (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib)), eq) == FI(std::end(ic)))
+ && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia)), eq) == BI(ic+15))
+ && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib)), eq) == BI(std::end(ic)))
+ && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia)), eq) == RI(ic+15))
+ && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib)), eq) == RI(std::end(ic)))
+ ;
+ }
+#endif
+
unsigned count_equal::count = 0;
template <class Iter1, class Iter2>
@@ -83,4 +103,8 @@ int main()
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp
index 966207671fc2..2212285ae47e 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp
@@ -11,14 +11,34 @@
// template<InputIterator Iter1, ForwardIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
-// Iter1
+// constexpr Iter1 // constexpr after C++17
// find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 2, 3};
+ int ib[] = {7, 8, 9};
+ int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3};
+ typedef forward_iterator<int*> FI;
+ typedef bidirectional_iterator<int*> BI;
+ typedef random_access_iterator<int*> RI;
+
+ return (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia))) == FI(ic+1))
+ && (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib))) == FI(std::end(ic)))
+ && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia))) == BI(ic+1))
+ && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib))) == BI(std::end(ic)))
+ && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia))) == RI(ic+1))
+ && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib))) == RI(std::end(ic)))
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 3, 0, 1, 2, 3};
@@ -46,4 +66,8 @@ int main()
forward_iterator<const int*>(ic),
forward_iterator<const int*>(ic+1)) ==
input_iterator<const int*>(ia));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp
index d1d954ca0cae..f6f1725d6fa7 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp
@@ -12,15 +12,35 @@
// template<InputIterator Iter1, ForwardIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
-// Iter1
+// constexpr Iter1 // constexpr after C++17
// find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+constexpr bool test_constexpr() {
+ int ia[] = {1, 2, 3};
+ int ib[] = {7, 8, 9};
+ int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3};
+ typedef forward_iterator<int*> FI;
+ typedef bidirectional_iterator<int*> BI;
+ typedef random_access_iterator<int*> RI;
+ std::equal_to<int> eq{};
+ return (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia)), eq) == FI(ic+1))
+ && (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib)), eq) == FI(std::end(ic)))
+ && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia)), eq) == BI(ic+1))
+ && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib)), eq) == BI(std::end(ic)))
+ && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia)), eq) == RI(ic+1))
+ && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib)), eq) == RI(std::end(ic)))
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 3, 0, 1, 2, 3};
@@ -52,4 +72,8 @@ int main()
forward_iterator<const int*>(ic+1),
std::equal_to<int>()) ==
input_iterator<const int*>(ia));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
index 09f0f41215c2..faff926d3d67 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
@@ -11,14 +11,25 @@
// template<InputIterator Iter, class T>
// requires HasEqualTo<Iter::value_type, T>
-// Iter
+// constexpr Iter // constexpr after C++17
// find(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 4, 6};
+ int ib[] = {1, 2, 3, 4, 5, 6};
+ return (std::find(std::begin(ia), std::end(ia), 5) == ia+2)
+ && (std::find(std::begin(ib), std::end(ib), 9) == ib+6)
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 3, 4, 5};
@@ -28,4 +39,8 @@ int main()
assert(*r == 3);
r = std::find(input_iterator<const int*>(ia), input_iterator<const int*>(ia+s), 10);
assert(r == input_iterator<const int*>(ia+s));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
index fa1faf17e0f4..0fe084c01b5f 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
@@ -11,21 +11,33 @@
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
-// Iter
+// constexpr Iter // constexpr after C++17
// find_if(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct eq {
- eq (int val) : v(val) {}
- bool operator () (int v2) const { return v == v2; }
+ TEST_CONSTEXPR eq (int val) : v(val) {}
+ TEST_CONSTEXPR bool operator () (int v2) const { return v == v2; }
int v;
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 4, 6};
+ int ib[] = {1, 2, 3, 7, 5, 6};
+ eq c(4);
+ return (std::find_if(std::begin(ia), std::end(ia), c) == ia+4)
+ && (std::find_if(std::begin(ib), std::end(ib), c) == ib+6)
+ ;
+ }
+#endif
+
int main()
{
int ia[] = {0, 1, 2, 3, 4, 5};
@@ -38,4 +50,8 @@ int main()
input_iterator<const int*>(ia+s),
eq(10));
assert(r == input_iterator<const int*>(ia+s));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
index 1f3c34b2144f..971a94dce2e4 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
@@ -11,21 +11,32 @@
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
-// Iter
+// constexpr Iter // constexpr after C++17
// find_if_not(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct ne {
- ne (int val) : v(val) {}
- bool operator () (int v2) const { return v != v2; }
+ TEST_CONSTEXPR ne (int val) : v(val) {}
+ TEST_CONSTEXPR bool operator () (int v2) const { return v != v2; }
int v;
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 5, 2, 4, 6};
+ int ib[] = {1, 2, 3, 7, 5, 6};
+ ne c(4);
+ return (std::find_if_not(std::begin(ia), std::end(ia), c) == ia+4)
+ && (std::find_if_not(std::begin(ib), std::end(ib), c) == ib+6)
+ ;
+ }
+#endif
int main()
{
@@ -39,4 +50,8 @@ int main()
input_iterator<const int*>(ia+s),
ne(10));
assert(r == input_iterator<const int*>(ia+s));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
index 9b391f01cea5..6c6824fafa0a 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
@@ -11,14 +11,29 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14
// template<class InputIterator, class Size, class Function>
-// InputIterator for_each_n(InputIterator first, Size n, Function f);
+// constexpr InputIterator // constexpr after C++17
+// for_each_n(InputIterator first, Size n, Function f);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int expected[] = {3, 5, 8, 9};
+ const size_t N = 4;
+
+ auto it = std::for_each_n(std::begin(ia), N, [](int &a) { a += 2; });
+ return it == (std::begin(ia) + N)
+ && std::equal(std::begin(ia), std::end(ia), std::begin(expected))
+ ;
+ }
+#endif
+
struct for_each_test
{
for_each_test(int c) : count(c) {}
@@ -58,4 +73,8 @@ int main()
for (unsigned i = 0; i < 1; ++i)
assert(ia[i] == static_cast<int>(i+2));
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp
index d6fdd18968d1..a334c6093330 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp
@@ -11,14 +11,26 @@
// template<InputIterator Iter, Callable<auto, Iter::reference> Function>
// requires CopyConstructible<Function>
-// Function
+// constexpr Function // constexpr after C++17
// for_each(Iter first, Iter last, Function f);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int expected[] = {3, 5, 8, 9};
+
+ std::for_each(std::begin(ia), std::end(ia), [](int &a) { a += 2; });
+ return std::equal(std::begin(ia), std::end(ia), std::begin(expected))
+ ;
+ }
+#endif
+
struct for_each_test
{
for_each_test(int c) : count(c) {}
@@ -36,4 +48,8 @@ int main()
assert(f.count == s);
for (unsigned i = 0; i < s; ++i)
assert(ia[i] == static_cast<int>(i+1));
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp
index e3f7c3cd87db..52ad7befc640 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp
@@ -10,7 +10,7 @@
// <algorithm>
// template<class ForwardIterator1, class ForwardIterator2>
-// bool
+// constexpr bool // constexpr after C++17
// is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
// ForwardIterator2 first2);
@@ -21,6 +21,21 @@
#include "test_macros.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 0, 0};
+ int ib[] = {1, 1, 0};
+ int ic[] = {1, 0, 1};
+ int id[] = {1};
+ return !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib))
+ && !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib))
+ && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic))
+ && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic))
+ && !std::is_permutation(std::begin(ic), std::end(ic), std::begin(id), std::end(id))
+ ;
+ }
+#endif
+
int main()
{
{
@@ -600,4 +615,8 @@ int main()
forward_iterator<const int*>(ib + sa)) == false);
#endif
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp
index 6e9cdaabd308..12bd938d2968 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp
@@ -10,7 +10,7 @@
// <algorithm>
// template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
-// bool
+// constexpr bool // constexpr after C++17
// is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
// ForwardIterator2 first2, BinaryPredicate pred);
@@ -28,6 +28,21 @@ bool counting_equals ( const T &a, const T &b ) {
return a == b;
}
+#if TEST_STD_VER > 17
+constexpr bool test_constexpr() {
+ int ia[] = {0, 0, 0};
+ int ib[] = {1, 1, 0};
+ int ic[] = {1, 0, 1};
+ int id[] = {1};
+ std::equal_to<int> c{};
+ return !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib) , c)
+ && !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), c)
+ && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic) , c)
+ && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), c)
+ && !std::is_permutation(std::begin(ic), std::end(ic), std::begin(id), std::end(id), c)
+ ;
+ }
+#endif
int main()
{
@@ -723,4 +738,32 @@ int main()
std::equal_to<const int>()) == false);
#endif
}
+ {
+ struct S {
+ S(int i) : i_(i) {}
+ bool operator==(const S& other) = delete;
+ int i_;
+ };
+ struct eq {
+ bool operator()(const S& a, const S&b) { return a.i_ == b.i_; }
+ };
+ const S a[] = {S(0), S(1)};
+ const S b[] = {S(1), S(0)};
+ const unsigned sa = sizeof(a)/sizeof(a[0]);
+ assert(std::is_permutation(forward_iterator<const S*>(a),
+ forward_iterator<const S*>(a + sa),
+ forward_iterator<const S*>(b),
+ eq()));
+#if TEST_STD_VER >= 14
+ assert(std::is_permutation(forward_iterator<const S*>(a),
+ forward_iterator<const S*>(a + sa),
+ forward_iterator<const S*>(b),
+ forward_iterator<const S*>(b + sa),
+ eq()));
+#endif
+ }
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp
index f4ea161891b2..356c2fbb8a7f 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp
@@ -16,16 +16,27 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
struct test1
{
- bool operator()(const int& i) const
+ TEST_CONSTEXPR bool operator()(const int& i) const
{
return i % 2 == 0;
}
};
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int ib[] = {1, 3, 5, 7};
+ return !std::none_of(std::begin(ia), std::end(ia), test1())
+ && std::none_of(std::begin(ib), std::end(ib), test1())
+ ;
+ }
+#endif
+
int main()
{
{
@@ -52,4 +63,8 @@ int main()
assert(std::none_of(input_iterator<const int*>(ia),
input_iterator<const int*>(ia), test1()) == true);
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp
index e5c2dd29d11f..d483800c2091 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp
@@ -11,14 +11,52 @@
// template<ForwardIterator Iter1, ForwardIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
-// Iter1
+// constexpr Iter1 // constexpr after C++17
// search(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
+//
+// template<class ForwardIterator, class Searcher>
+// ForwardIterator search(ForwardIterator first, ForwardIterator last,
+// const Searcher& searcher); // C++17
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+struct MySearcherC {
+ template <typename Iterator>
+ std::pair<Iterator, Iterator>
+ TEST_CONSTEXPR operator() (Iterator b, Iterator e) const
+ {
+ return std::make_pair(b, e);
+ }
+};
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3};
+ int ib[] = {0, 1, 5, 3};
+ int ic[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ return (std::search(std::begin(ic), std::end(ic), std::begin(ia), std::end(ia)) == ic+3)
+ && (std::search(std::begin(ic), std::end(ic), std::begin(ib), std::end(ib)) == std::end(ic))
+ && (std::search(std::begin(ic), std::end(ic), MySearcherC()) == std::begin(ic))
+ ;
+ }
+#endif
+
+int searcher_called = 0;
+
+struct MySearcher {
+ template <typename Iterator>
+ std::pair<Iterator, Iterator>
+ operator() (Iterator b, Iterator e) const
+ {
+ ++searcher_called;
+ return std::make_pair(b, e);
+ }
+};
+
template <class Iter1, class Iter2>
void
test()
@@ -69,4 +107,19 @@ int main()
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+
+#if TEST_STD_VER > 14
+{
+ typedef int * RI;
+ static_assert((std::is_same<RI, decltype(std::search(RI(), RI(), MySearcher()))>::value), "" );
+
+ RI it(nullptr);
+ assert(it == std::search(it, it, MySearcher()));
+ assert(searcher_called == 1);
+}
+#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
index 4874bcad833e..528ec5696e8e 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
@@ -10,16 +10,27 @@
// <algorithm>
// template<class ForwardIterator, class Size, class T>
-// ForwardIterator
+// constexpr ForwardIterator // constexpr after C++17
// search_n(ForwardIterator first, ForwardIterator last, Size count,
// const T& value);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "user_defined_integral.hpp"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 0, 1, 1, 2, 2};
+ return (std::search_n(std::begin(ia), std::end(ia), 1, 0) == ia)
+ && (std::search_n(std::begin(ia), std::end(ia), 2, 1) == ia+2)
+ && (std::search_n(std::begin(ia), std::end(ia), 1, 3) == std::end(ia))
+ ;
+ }
+#endif
+
template <class Iter>
void
test()
@@ -74,4 +85,8 @@ int main()
test<forward_iterator<const int*> >();
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
index ff459b348932..d5780c7e7ddc 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
@@ -10,16 +10,29 @@
// <algorithm>
// template<class ForwardIterator, class Size, class T, class BinaryPredicate>
-// ForwardIterator
+// constexpr ForwardIterator // constexpr after C++17
// search_n(ForwardIterator first, ForwardIterator last, Size count,
// const T& value, BinaryPredicate pred);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "user_defined_integral.hpp"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool eq(int a, int b) { return a == b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 0, 1, 1, 2, 2};
+ return (std::search_n(std::begin(ia), std::end(ia), 1, 0, eq) == ia)
+ && (std::search_n(std::begin(ia), std::end(ia), 2, 1, eq) == ia+2)
+ && (std::search_n(std::begin(ia), std::end(ia), 1, 3, eq) == std::end(ia))
+ ;
+ }
+#endif
+
struct count_equal
{
static unsigned count;
@@ -151,4 +164,8 @@ int main()
test<forward_iterator<const int*> >();
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp
index 192da03d67b3..21a17116fc8d 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp
@@ -11,14 +11,28 @@
// template<ForwardIterator Iter1, ForwardIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
-// Iter1
+// constexpr Iter1 // constexpr after C++17
// search(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool eq(int a, int b) { return a == b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 2, 3};
+ int ib[] = {0, 1, 5, 3};
+ int ic[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ return (std::search(std::begin(ic), std::end(ic), std::begin(ia), std::end(ia), eq) == ic+3)
+ && (std::search(std::begin(ic), std::end(ic), std::begin(ib), std::end(ib), eq) == std::end(ic))
+ ;
+ }
+#endif
+
struct count_equal
{
static unsigned count;
@@ -108,4 +122,8 @@ int main()
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
index d4bc3fd70a81..4b5ddb191d4e 100644
--- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
@@ -11,8 +11,12 @@
// template<InputIterator Iter1, InputIterator Iter2>
// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
-// pair<Iter1, Iter2>
+// constexpr pair<Iter1, Iter2> // constexpr after c++17
// mismatch(Iter1 first1, Iter1 last1, Iter2 first2);
+//
+// template<InputIterator Iter1, InputIterator Iter2Pred>
+// constexpr pair<Iter1, Iter2> // constexpr after c++17
+// mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); // C++14
#include <algorithm>
#include <cassert>
@@ -20,6 +24,40 @@
#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int ib[] = {1, 3};
+ int ic[] = {1, 3, 5, 7};
+ typedef input_iterator<int*> II;
+ typedef bidirectional_iterator<int*> BI;
+
+ auto p1 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic));
+ if (p1.first != ia+2 || p1.second != ic+2)
+ return false;
+
+ auto p2 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic));
+ if (p2.first != ia+2 || p2.second != ic+2)
+ return false;
+
+ auto p3 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic));
+ if (p3.first != ib+2 || p3.second != ic+2)
+ return false;
+
+ auto p4 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic));
+ if (p4.first != ib+2 || p4.second != ic+2)
+ return false;
+
+ auto p5 = std::mismatch(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)));
+ if (p5.first != II(ib+2) || p5.second != II(ic+2))
+ return false;
+ auto p6 = std::mismatch(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)));
+ if (p6.first != BI(ib+2) || p6.second != BI(ic+2))
+ return false;
+
+ return true;
+ }
+#endif
int main()
{
@@ -48,4 +86,8 @@ int main()
assert(std::mismatch(II(ia), II(ia + sa), II(ib), II(ib+2))
== (std::pair<II, II>(II(ia+2), II(ib+2))));
#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
index 2a363826261e..ed9ba055aabc 100644
--- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
@@ -12,8 +12,12 @@
// template<InputIterator Iter1, InputIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
-// pair<Iter1, Iter2>
+// constexpr pair<Iter1, Iter2> // constexpr after c++17
// mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Pred pred);
+//
+// template<InputIterator Iter1, InputIterator Iter2, Predicate Pred>
+// constexpr pair<Iter1, Iter2> // constexpr after c++17
+// mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred); // C++14
#include <algorithm>
#include <functional>
@@ -23,6 +27,44 @@
#include "test_iterators.h"
#include "counting_predicates.hpp"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool eq(int a, int b) { return a == b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+ int ib[] = {1, 3};
+ int ic[] = {1, 3, 5, 7};
+ typedef input_iterator<int*> II;
+ typedef bidirectional_iterator<int*> BI;
+
+ auto p1 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), eq);
+ if (p1.first != ia+2 || p1.second != ic+2)
+ return false;
+
+ auto p2 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic), eq);
+ if (p2.first != ia+2 || p2.second != ic+2)
+ return false;
+
+ auto p3 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic), eq);
+ if (p3.first != ib+2 || p3.second != ic+2)
+ return false;
+
+ auto p4 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), eq);
+ if (p4.first != ib+2 || p4.second != ic+2)
+ return false;
+
+ auto p5 = std::mismatch(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)), eq);
+ if (p5.first != II(ib+2) || p5.second != II(ic+2))
+ return false;
+ auto p6 = std::mismatch(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)), eq);
+ if (p6.first != BI(ib+2) || p6.second != BI(ic+2))
+ return false;
+
+ return true;
+ }
+#endif
+
+
#if TEST_STD_VER > 11
#define HAS_FOUR_ITERATOR_VERSION
#endif
@@ -69,4 +111,8 @@ int main()
assert(std::mismatch(ia, ia + sa, ib, ib + 2, EQ()) ==
(std::pair<int*,int*>(ia+2,ib+2)));
#endif
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
index d4d31cb3088f..04c4c258be88 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
@@ -10,9 +10,7 @@
// <algorithm>
// template<ForwardIterator Iter, class T>
-// requires HasLess<T, Iter::value_type>
-// && HasLess<Iter::value_type, T>
-// bool
+// constexpr bool // constexpr after C++17
// binary_search(Iter first, Iter last, const T& value);
#include <algorithm>
@@ -20,8 +18,22 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool lt(int a, int b) { return a < b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 3, 6, 7};
+
+ return std::binary_search(std::begin(ia), std::end(ia), 1)
+ && std::binary_search(std::begin(ia), std::end(ia), 3)
+ && !std::binary_search(std::begin(ia), std::end(ia), 9)
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value, bool x)
@@ -61,4 +73,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
index e0b148499ca8..b27861022c43 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
@@ -10,9 +10,7 @@
// <algorithm>
// template<ForwardIterator Iter, class T, CopyConstructible Compare>
-// requires Predicate<Compare, T, Iter::value_type>
-// && Predicate<Compare, Iter::value_type, T>
-// bool
+// constexpr bool // constexpr after C++17
// binary_search(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
@@ -21,8 +19,22 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool lt(int a, int b) { return a < b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 3, 6, 7};
+
+ return std::binary_search(std::begin(ia), std::end(ia), 1, lt)
+ && std::binary_search(std::begin(ia), std::end(ia), 3, lt)
+ && !std::binary_search(std::begin(ia), std::end(ia), 9, lt)
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value, bool x)
@@ -62,4 +74,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
index bc968f5b2aab..02aea475c599 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
@@ -12,7 +12,7 @@
// template<ForwardIterator Iter, class T>
// requires HasLess<T, Iter::value_type>
// && HasLess<Iter::value_type, T>
-// pair<Iter, Iter>
+// constexpr pair<Iter, Iter> // constexpr after c++17
// equal_range(Iter first, Iter last, const T& value);
#include <algorithm>
@@ -20,8 +20,22 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool lt(int a, int b) { return a < b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 3, 6, 7};
+
+ return (std::equal_range(std::begin(ia), std::end(ia), 1, lt) == std::pair<int *, int *>(ia+0, ia+1))
+ && (std::equal_range(std::begin(ia), std::end(ia), 3, lt) == std::pair<int *, int *>(ia+1, ia+3))
+ && (std::equal_range(std::begin(ia), std::end(ia), 9, lt) == std::pair<int *, int *>(std::end(ia), std::end(ia)))
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value)
@@ -67,4 +81,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
index de0bbf25613e..960e2c1fa568 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
@@ -10,9 +10,7 @@
// <algorithm>
// template<ForwardIterator Iter, class T, CopyConstructible Compare>
-// requires Predicate<Compare, T, Iter::value_type>
-// && Predicate<Compare, Iter::value_type, T>
-// pair<Iter, Iter>
+// constexpr pair<Iter, Iter> // constexpr after c++17
// equal_range(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
@@ -21,8 +19,22 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool lt(int a, int b) { return a < b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 3, 6, 7};
+
+ return (std::equal_range(std::begin(ia), std::end(ia), 1, lt) == std::pair<int *, int *>(ia+0, ia+1))
+ && (std::equal_range(std::begin(ia), std::end(ia), 3, lt) == std::pair<int *, int *>(ia+1, ia+3))
+ && (std::equal_range(std::begin(ia), std::end(ia), 9, lt) == std::pair<int *, int *>(std::end(ia), std::end(ia)))
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value)
@@ -68,4 +80,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
index 1fff1d7f5b63..b6848ec9ef67 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
@@ -10,8 +10,7 @@
// <algorithm>
// template<ForwardIterator Iter, class T>
-// requires HasLess<Iter::value_type, T>
-// Iter
+// constexpr Iter // constexpr after c++17
// lower_bound(Iter first, Iter last, const T& value);
#include <algorithm>
@@ -19,8 +18,23 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool eq(int a, int b) { return a == b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+
+ return (std::lower_bound(std::begin(ia), std::end(ia), 2) == ia+1)
+ && (std::lower_bound(std::begin(ia), std::end(ia), 3) == ia+1)
+ && (std::lower_bound(std::begin(ia), std::end(ia), 9) == std::end(ia))
+ ;
+ }
+#endif
+
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value)
@@ -62,4 +76,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
index 4ec5f6c000d6..b3ef70eb0222 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
@@ -9,10 +9,9 @@
// <algorithm>
-// template<ForwardIterator Iter, class T>
-// requires HasLess<Iter::value_type, T>
-// Iter
-// lower_bound(Iter first, Iter last, const T& value);
+// template<ForwardIterator Iter, class T, class Compare>
+// constexpr Iter // constexpr after c++17
+// lower_bound(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
#include <functional>
@@ -20,8 +19,22 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool lt(int a, int b) { return a < b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+
+ return (std::lower_bound(std::begin(ia), std::end(ia), 2, lt) == ia+1)
+ && (std::lower_bound(std::begin(ia), std::end(ia), 3, lt) == ia+1)
+ && (std::lower_bound(std::begin(ia), std::end(ia), 9, lt) == std::end(ia))
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value)
@@ -63,4 +76,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
index 710edb61c9b6..43bb4c3cceb8 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
@@ -10,8 +10,7 @@
// <algorithm>
// template<ForwardIterator Iter, class T>
-// requires HasLess<T, Iter::value_type>
-// Iter
+// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value);
#include <algorithm>
@@ -19,8 +18,20 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+
+ return (std::upper_bound(std::begin(ia), std::end(ia), 2) == ia+1)
+ && (std::upper_bound(std::begin(ia), std::end(ia), 3) == ia+2)
+ && (std::upper_bound(std::begin(ia), std::end(ia), 9) == std::end(ia))
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value)
@@ -62,4 +73,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
index 3268075b1b0b..fa8e934b9d6f 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
@@ -10,8 +10,7 @@
// <algorithm>
// template<ForwardIterator Iter, class T, Predicate<auto, T, Iter::value_type> Compare>
-// requires CopyConstructible<Compare>
-// Iter
+// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
@@ -20,8 +19,22 @@
#include <cassert>
#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool lt(int a, int b) { return a < b; }
+
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 3, 6, 7};
+
+ return (std::upper_bound(std::begin(ia), std::end(ia), 2, lt) == ia+1)
+ && (std::upper_bound(std::begin(ia), std::end(ia), 3, lt) == ia+2)
+ && (std::upper_bound(std::begin(ia), std::end(ia), 9, lt) == std::end(ia))
+ ;
+ }
+#endif
+
template <class Iter, class T>
void
test(Iter first, Iter last, const T& value)
@@ -63,4 +76,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp
index f16b2c3c61ae..c3d6fd919cb5 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp
@@ -11,12 +11,23 @@
// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
-// bool
+// constexpr bool // constexpr after C++17
// is_heap(Iter first, Iter last);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 1, 1, 1, 0, 1, 1};
+ int ib[] = {0, 0, 1, 0, 0, 0, 0};
+ return std::is_heap(std::begin(ia), std::end(ia))
+ && !std::is_heap(std::begin(ib), std::end(ib));
+ }
+#endif
+
void test()
{
int i1[] = {0, 0};
@@ -518,4 +529,8 @@ void test()
int main()
{
test();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp
index af55cc499eda..3f290bb29449 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp
@@ -11,13 +11,24 @@
// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
-// bool
+// constexpr bool // constexpr after C++17
// is_heap(Iter first, Iter last);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 0, 1, 1, 1};
+ int ib[] = {1, 0, 4, 1, 0};
+ return std::is_heap(std::begin(ia), std::end(ia), std::greater<int>())
+ && !std::is_heap(std::begin(ib), std::end(ib), std::greater<int>());
+ }
+#endif
+
void test()
{
int i1[] = {0, 0};
@@ -519,4 +530,8 @@ void test()
int main()
{
test();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp
index 082c04451825..96369eb6053c 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp
@@ -11,12 +11,23 @@
// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
-// Iter
+// constexpr bool // constexpr after C++17
// is_heap_until(Iter first, Iter last);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 0, 0, 0, 1, 0};
+ int ib[] = {0, 0, 0, 1, 1, 1};
+ return (std::is_heap_until(std::begin(ia), std::end(ia)) == ia+4)
+ && (std::is_heap_until(std::begin(ib), std::end(ib)) == ib+3);
+ }
+#endif
+
void test()
{
int i1[] = {0, 0};
@@ -518,4 +529,8 @@ void test()
int main()
{
test();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp
index 657c177fee56..edd27b0d7902 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp
@@ -11,13 +11,24 @@
// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires CopyConstructible<Compare>
-// Iter
+// constexpr bool // constexpr after C++17
// is_heap_until(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 0, 0, 0};
+ int ib[] = {0, 1, 1, 0};
+ return (std::is_heap_until(std::begin(ia), std::end(ia), std::greater<int>()) == ia+1)
+ && (std::is_heap_until(std::begin(ib), std::end(ib), std::greater<int>()) == ib+3);
+ }
+#endif
+
void test()
{
int i1[] = {0, 0};
@@ -519,4 +530,8 @@ void test()
int main()
{
test();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp
index 71dfeefe7e41..adec6aec8015 100644
--- a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp
@@ -12,14 +12,26 @@
// template<InputIterator Iter1, InputIterator Iter2>
// requires HasLess<Iter1::value_type, Iter2::value_type>
// && HasLess<Iter2::value_type, Iter1::value_type>
-// bool
+// constexpr bool // constexpr after C++17
// lexicographical_compare(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 2, 3};
+ int ib[] = {1, 3, 5, 2, 4, 6};
+
+ return std::lexicographical_compare(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib))
+ && !std::lexicographical_compare(std::begin(ib), std::end(ib), std::begin(ia), std::end(ia))
+ ;
+ }
+#endif
+
template <class Iter1, class Iter2>
void
test()
@@ -66,4 +78,8 @@ int main()
test<const int*, bidirectional_iterator<const int*> >();
test<const int*, random_access_iterator<const int*> >();
test<const int*, const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp
index c1851560ef23..b7fbdbfa299f 100644
--- a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp
@@ -12,7 +12,7 @@
// template<InputIterator Iter1, InputIterator Iter2, CopyConstructible Compare>
// requires Predicate<Compare, Iter1::value_type, Iter2::value_type>
// && Predicate<Compare, Iter2::value_type, Iter1::value_type>
-// bool
+// constexpr bool // constexpr after C++17
// lexicographical_compare(Iter1 first1, Iter1 last1,
// Iter2 first2, Iter2 last2, Compare comp);
@@ -20,8 +20,21 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 2, 3};
+ int ib[] = {1, 3, 5, 2, 4, 6};
+
+ std::greater<int> pred{};
+ return !std::lexicographical_compare(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), pred)
+ && std::lexicographical_compare(std::begin(ib), std::end(ib), std::begin(ia), std::end(ia), pred)
+ ;
+ }
+#endif
+
template <class Iter1, class Iter2>
void
test()
@@ -70,4 +83,8 @@ int main()
test<const int*, bidirectional_iterator<const int*> >();
test<const int*, random_access_iterator<const int*> >();
test<const int*, const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
index 777461023e7d..a42936124fdf 100644
--- a/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
@@ -15,15 +15,32 @@
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && HasLess<InIter2::value_type, InIter1::value_type>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// merge(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2, OutIter result);
#include <algorithm>
#include <random>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {0, 1, 2, 3, 4};
+// int ib[] = {2, 4, 6, 8};
+// int ic[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+// const int expected[] = {0, 1, 2, 2, 3, 4, 4, 6, 8};
+//
+// auto it = std::merge(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), std::begin(ic));
+// return std::distance(std::begin(ic), it) == (std::size(ia) + std::size(ib))
+// && *it == 0
+// && std::equal(std::begin(ic), it, std::begin(expected), std::end(expected))
+// ;
+// }
+// #endif
+
std::mt19937 randomness;
template <class InIter1, class InIter2, class OutIter>
@@ -224,4 +241,9 @@ int main()
test<const int*, const int*, bidirectional_iterator<int*> >();
test<const int*, const int*, random_access_iterator<int*> >();
test<const int*, const int*, int*>();
+
+#if TEST_STD_VER > 17
+// Not yet - waiting on std::copy
+// static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
index 3daaeebbeae9..1506a8cd5114 100644
--- a/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
@@ -16,7 +16,7 @@
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && CopyConstructible<Compare>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// merge(InIter1 first1, InIter1 last1,
// InIter2 first2, InIter2 last2, OutIter result, Compare comp);
@@ -25,9 +25,27 @@
#include <random>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "counting_predicates.hpp"
+// #if TEST_STD_VER > 17
+// TEST_CONSTEXPR bool test_constexpr() {
+// int ia[] = {0, 1, 2, 3, 4};
+// int ib[] = {2, 4, 6, 8};
+// int ic[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+// const int expected[] = {0, 1, 2, 2, 3, 4, 4, 6, 8};
+//
+// auto it = std::merge(std::begin(ia), std::end(ia),
+// std::begin(ib), std::end(ib),
+// std::begin(ic), [](int a, int b) {return a == b; });
+// return std::distance(std::begin(ic), it) == (std::size(ia) + std::size(ib))
+// && *it == 0
+// && std::equal(std::begin(ic), it, std::begin(expected), std::end(expected))
+// ;
+// }
+// #endif
+
std::mt19937 randomness;
template <class InIter1, class InIter2, class OutIter>
@@ -234,4 +252,9 @@ int main()
test<const int*, const int*, bidirectional_iterator<int*> >();
test<const int*, const int*, random_access_iterator<int*> >();
test<const int*, const int*, int*>();
+
+#if TEST_STD_VER > 17
+// Not yet - waiting on std::copy
+// static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp
index 70abd1809753..ca1b422517c5 100644
--- a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp
@@ -12,14 +12,27 @@
// template<InputIterator Iter1, InputIterator Iter2>
// requires HasLess<Iter1::value_type, Iter2::value_type>
// && HasLess<Iter2::value_type, Iter1::value_type>
-// bool
+// constexpr bool // constexpr after C++17
// includes(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4};
+ int ib[] = {2, 4};
+ int ic[] = {3, 3, 3, 3};
+
+ return std::includes(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib))
+ && !std::includes(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic))
+ ;
+ }
+#endif
+
template <class Iter1, class Iter2>
void
test()
@@ -81,4 +94,8 @@ int main()
test<const int*, bidirectional_iterator<const int*> >();
test<const int*, random_access_iterator<const int*> >();
test<const int*, const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp
index 299dc893560f..06192f93bcc8 100644
--- a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp
@@ -12,15 +12,30 @@
// template<InputIterator Iter1, InputIterator Iter2, typename Compare>
// requires Predicate<Compare, Iter1::value_type, Iter2::value_type>
// && Predicate<Compare, Iter2::value_type, Iter1::value_type>
-// bool
+// constexpr bool // constexpr after C++17
// includes(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Compare comp);
#include <algorithm>
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4};
+ int ib[] = {2, 4};
+ int ic[] = {3, 3, 3, 3};
+
+ auto comp = [](int a, int b) {return a < b; };
+ return std::includes(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), comp)
+ && !std::includes(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic), comp)
+ ;
+ }
+#endif
+
+
template <class Iter1, class Iter2>
void
test()
@@ -82,4 +97,8 @@ int main()
test<const int*, bidirectional_iterator<const int*> >();
test<const int*, random_access_iterator<const int*> >();
test<const int*, const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp
index f371890d8e7e..8d18027eef7e 100644
--- a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp
@@ -14,15 +14,34 @@
// && OutputIterator<OutIter, InIter2::reference>
// && HasLess<InIter2::value_type, InIter1::value_type>
// && HasLess<InIter1::value_type, InIter2::value_type>
-// OutIter
+// constpexr OutIter // constexpr after C++17
// set_intersection(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2,
// OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ const int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4};
+ const int ib[] = {2, 4, 4, 6};
+ int results[std::size(ia)] = {0};
+
+ auto it = std::set_intersection(std::begin(ia), std::end(ia),
+ std::begin(ib), std::end(ib), std::begin(results));
+
+ return std::includes(std::begin(ia), std::end(ia), std::begin(results), it)
+ && std::includes(std::begin(ib), std::end(ib), std::begin(results), it)
+ && std::is_sorted(std::begin(results), it)
+ && std::all_of(it, std::end(results), [](int a) {return a == 0; })
+ ;
+ }
+#endif
+
+
template <class Iter1, class Iter2, class OutIter>
void
test()
@@ -195,4 +214,8 @@ int main()
test<const int*, const int*, bidirectional_iterator<int*> >();
test<const int*, const int*, random_access_iterator<int*> >();
test<const int*, const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp
index 035522b54624..6b0cfe16833c 100644
--- a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp
@@ -15,7 +15,7 @@
// && OutputIterator<OutIter, InIter2::reference>
// && Predicate<Compare, InIter1::value_type, InIter2::value_type>
// && Predicate<Compare, InIter2::value_type, InIter1::value_type>
-// OutIter
+// constpexr OutIter // constexpr after C++17
// set_intersection(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2,
// OutIter result, Compare comp);
@@ -23,8 +23,28 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ const int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4};
+ const int ib[] = {2, 4, 4, 6};
+ int results[std::size(ia)] = {0};
+
+ auto comp = [](int a, int b) {return a < b; };
+ auto it = std::set_intersection(std::begin(ia), std::end(ia),
+ std::begin(ib), std::end(ib), std::begin(results), comp);
+
+ return std::includes(std::begin(ia), std::end(ia), std::begin(results), it)
+ && std::includes(std::begin(ib), std::end(ib), std::begin(results), it)
+ && std::is_sorted(std::begin(results), it, comp)
+ && std::all_of(it, std::end(results), [](int a) {return a == 0; })
+ ;
+ }
+#endif
+
+
template <class Iter1, class Iter2, class OutIter>
void
test()
@@ -197,4 +217,8 @@ int main()
test<const int*, const int*, bidirectional_iterator<int*> >();
test<const int*, const int*, random_access_iterator<int*> >();
test<const int*, const int*, int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp
index dd6b5c1766ad..3652c089cfbe 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp
@@ -19,6 +19,15 @@
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 0, 1, 1};
+ int ib[] = {1, 1, 0, 0};
+ return std::is_sorted(std::begin(ia), std::end(ia))
+ && !std::is_sorted(std::begin(ib), std::end(ib));
+ }
+#endif
+
template <class Iter>
void
test()
@@ -180,4 +189,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp
index d5a34e2f2cb3..228aacac622e 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp
@@ -20,6 +20,15 @@
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 1, 0, 0};
+ int ib[] = {0, 0, 1, 1};
+ return std::is_sorted(std::begin(ia), std::end(ia), std::greater<int>())
+ && !std::is_sorted(std::begin(ib), std::end(ib), std::greater<int>());
+ }
+#endif
+
template <class Iter>
void
test()
@@ -181,4 +190,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp
index bef01027472c..b2ed76f519a4 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp
@@ -19,6 +19,15 @@
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {0, 1, 0};
+ int ib[] = {0, 1, 1};
+ return (std::is_sorted_until(std::begin(ia), std::end(ia)) == ia+2)
+ && (std::is_sorted_until(std::begin(ib), std::end(ib)) == ib+3);
+ }
+#endif
+
template <class Iter>
void
test()
@@ -180,4 +189,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp
index 68ed29c6f4b8..76724bc397e1 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp
@@ -20,6 +20,15 @@
#include "test_iterators.h"
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int ia[] = {1, 0, 1};
+ int ib[] = {1, 1, 0};
+ return (std::is_sorted_until(std::begin(ia), std::end(ia), std::greater<int>()) == ia+2)
+ && (std::is_sorted_until(std::begin(ib), std::end(ib), std::greater<int>()) == ib+3);
+ }
+#endif
+
template <class Iter>
void
test()
@@ -181,4 +190,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp b/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
index 7a4090b9c252..7a8d4c1f4a69 100644
--- a/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+++ b/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
@@ -89,6 +89,7 @@ int main()
CHECK_ALWAYS_LOCK_FREE(float);
CHECK_ALWAYS_LOCK_FREE(double);
CHECK_ALWAYS_LOCK_FREE(long double);
+#if __has_attribute(vector_size) && defined(_LIBCPP_VERSION)
CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(1 * sizeof(int)))));
CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(2 * sizeof(int)))));
CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(4 * sizeof(int)))));
@@ -104,6 +105,7 @@ int main()
CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(4 * sizeof(double)))));
CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(16 * sizeof(double)))));
CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(32 * sizeof(double)))));
+#endif // __has_attribute(vector_size) && defined(_LIBCPP_VERSION)
CHECK_ALWAYS_LOCK_FREE(struct Empty {});
CHECK_ALWAYS_LOCK_FREE(struct OneInt { int i; });
CHECK_ALWAYS_LOCK_FREE(struct IntArr2 { int i[2]; });
diff --git a/test/std/containers/associative/map/map.cons/move.pass.cpp b/test/std/containers/associative/map/map.cons/move.pass.cpp
index dd68f9c39ec8..69f762ac5d6f 100644
--- a/test/std/containers/associative/map/map.cons/move.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move.pass.cpp
@@ -35,7 +35,7 @@ int main()
assert(m.size() == 0);
assert(distance(m.begin(), m.end()) == 0);
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
@@ -65,7 +65,7 @@ int main()
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
diff --git a/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp b/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp
new file mode 100644
index 000000000000..899757e54c44
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <map>
+
+// class map
+
+// template<typename K>
+// size_type count(const K& x) const; // C++14
+
+#include <cassert>
+#include <map>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::map<std::pair<int, int>, int, Comp> s{
+ {{2, 1}, 1}, {{1, 2}, 2}, {{1, 3}, 3}, {{1, 4}, 4}, {{2, 2}, 5}};
+
+ auto cnt = s.count(1);
+ assert(cnt == 3);
+}
diff --git a/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp
new file mode 100644
index 000000000000..cce90c69572d
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <map>
+
+// class map
+
+// template<typename K>
+// pair<iterator,iterator> equal_range(const K& x); // C++14
+// template<typename K>
+// pair<const_iterator,const_iterator> equal_range(const K& x) const;
+// // C++14
+
+#include <cassert>
+#include <map>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::map<std::pair<int, int>, int, Comp> s{
+ {{2, 1}, 1}, {{1, 2}, 2}, {{1, 3}, 3}, {{1, 4}, 4}, {{2, 2}, 5}};
+
+ auto er = s.equal_range(1);
+ long nels = 0;
+
+ for (auto it = er.first; it != er.second; it++) {
+ assert(it->first.first == 1);
+ nels++;
+ }
+
+ assert(nels == 3);
+}
diff --git a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
index 769c709cf203..1dc6404b07c9 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
@@ -35,7 +35,7 @@ int main()
assert(m.size() == 0);
assert(distance(m.begin(), m.end()) == 0);
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
@@ -71,7 +71,7 @@ int main()
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
diff --git a/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp
new file mode 100644
index 000000000000..a1dbf806a307
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <map>
+
+// class multimap
+
+// template<typename K>
+// size_type count(const K& x) const; // C++14
+
+#include <cassert>
+#include <map>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::multimap<std::pair<int, int>, int, Comp> s{
+ {{2, 1}, 1}, {{1, 1}, 2}, {{1, 1}, 3}, {{1, 1}, 4}, {{2, 2}, 5}};
+
+ auto cnt = s.count(1);
+ assert(cnt == 3);
+}
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp
new file mode 100644
index 000000000000..2b199d23c29b
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <map>
+
+// class multimap
+
+// template<typename K>
+// pair<iterator,iterator> equal_range(const K& x); // C++14
+// template<typename K>
+// pair<const_iterator,const_iterator> equal_range(const K& x) const;
+// // C++14
+
+#include <cassert>
+#include <map>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::multimap<std::pair<int, int>, int, Comp> s{
+ {{2, 1}, 1}, {{1, 1}, 2}, {{1, 1}, 3}, {{1, 1}, 4}, {{2, 2}, 5}};
+
+ auto er = s.equal_range(1);
+ long nels = 0;
+
+ for (auto it = er.first; it != er.second; it++) {
+ assert(it->first.first == 1);
+ nels++;
+ }
+
+ assert(nels == 3);
+}
diff --git a/test/std/containers/associative/multiset/count_transparent.pass.cpp b/test/std/containers/associative/multiset/count_transparent.pass.cpp
new file mode 100644
index 000000000000..9ef223345862
--- /dev/null
+++ b/test/std/containers/associative/multiset/count_transparent.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <set>
+
+// class multiset
+
+// template<typename K>
+// iterator lower_bound(const K& x); // C++14
+// template<typename K>
+// const_iterator lower_bound(const K& x) const; // C++14
+
+#include <cassert>
+#include <set>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::multiset<std::pair<int, int>, Comp> s{{2, 1}, {1, 1}, {1, 1}, {1, 1}, {2, 2}};
+
+ auto cnt = s.count(1);
+ assert(cnt == 3);
+}
diff --git a/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp b/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp
new file mode 100644
index 000000000000..ffd87acfd321
--- /dev/null
+++ b/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <set>
+
+// class multiset
+
+// template<typename K>
+// pair<iterator,iterator> equal_range(const K& x); //
+// C++14
+// template<typename K>
+// pair<const_iterator,const_iterator> equal_range(const K& x) const; //
+// C++14
+
+#include <cassert>
+#include <set>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::multiset<std::pair<int, int>, Comp> s{{2, 1}, {1, 1}, {1, 1}, {1, 1}, {2, 2}};
+
+ auto er = s.equal_range(1);
+ long nels = 0;
+
+ for (auto it = er.first; it != er.second; it++) {
+ assert(it->first == 1);
+ nels++;
+ }
+
+ assert(nels == 3);
+}
diff --git a/test/std/containers/associative/multiset/insert_cv.pass.cpp b/test/std/containers/associative/multiset/insert_cv.pass.cpp
index 2aa920d70972..fe756428223a 100644
--- a/test/std/containers/associative/multiset/insert_cv.pass.cpp
+++ b/test/std/containers/associative/multiset/insert_cv.pass.cpp
@@ -18,56 +18,44 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_cv_test()
{
- {
- typedef std::multiset<int> M;
- typedef M::iterator R;
- M m;
- R r = m.insert(M::value_type(2));
- assert(r == m.begin());
- assert(m.size() == 1);
- assert(*r == 2);
-
- r = m.insert(M::value_type(1));
- assert(r == m.begin());
- assert(m.size() == 2);
- assert(*r == 1);
-
- r = m.insert(M::value_type(3));
- assert(r == prev(m.end()));
- assert(m.size() == 3);
- assert(*r == 3);
+ typedef Container M;
+ typedef typename M::iterator R;
+ typedef typename M::value_type VT;
+ M m;
+ const VT v1(2);
+ R r = m.insert(v1);
+ assert(r == m.begin());
+ assert(m.size() == 1);
+ assert(*r == 2);
+
+ const VT v2(1);
+ r = m.insert(v2);
+ assert(r == m.begin());
+ assert(m.size() == 2);
+ assert(*r == 1);
+
+ const VT v3(3);
+ r = m.insert(v3);
+ assert(r == prev(m.end()));
+ assert(m.size() == 3);
+ assert(*r == 3);
+
+ r = m.insert(v3);
+ assert(r == prev(m.end()));
+ assert(m.size() == 4);
+ assert(*r == 3);
+}
- r = m.insert(M::value_type(3));
- assert(r == prev(m.end()));
- assert(m.size() == 4);
- assert(*r == 3);
- }
+int main()
+{
+ do_insert_cv_test<std::multiset<int> >();
#if TEST_STD_VER >= 11
{
typedef std::multiset<int, std::less<int>, min_allocator<int>> M;
- typedef M::iterator R;
- M m;
- R r = m.insert(M::value_type(2));
- assert(r == m.begin());
- assert(m.size() == 1);
- assert(*r == 2);
-
- r = m.insert(M::value_type(1));
- assert(r == m.begin());
- assert(m.size() == 2);
- assert(*r == 1);
-
- r = m.insert(M::value_type(3));
- assert(r == prev(m.end()));
- assert(m.size() == 3);
- assert(*r == 3);
-
- r = m.insert(M::value_type(3));
- assert(r == prev(m.end()));
- assert(m.size() == 4);
- assert(*r == 3);
+ do_insert_cv_test<M>();
}
#endif
}
diff --git a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
index 2adfb5c37a4f..7a43cc1c65aa 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
@@ -35,7 +35,7 @@ int main()
assert(m.size() == 0);
assert(distance(m.begin(), m.end()) == 0);
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
@@ -72,7 +72,7 @@ int main()
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
diff --git a/test/std/containers/associative/set/count_transparent.pass.cpp b/test/std/containers/associative/set/count_transparent.pass.cpp
new file mode 100644
index 000000000000..26908eacd23b
--- /dev/null
+++ b/test/std/containers/associative/set/count_transparent.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <set>
+
+// class set
+
+// template<typename K>
+// iterator lower_bound(const K& x); // C++14
+// template<typename K>
+// const_iterator lower_bound(const K& x) const; // C++14
+
+#include <cassert>
+#include <set>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::set<std::pair<int, int>, Comp> s{{2, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 2}};
+
+ auto cnt = s.count(1);
+ assert(cnt == 3);
+}
diff --git a/test/std/containers/associative/set/equal_range_transparent.pass.cpp b/test/std/containers/associative/set/equal_range_transparent.pass.cpp
new file mode 100644
index 000000000000..88030847abcd
--- /dev/null
+++ b/test/std/containers/associative/set/equal_range_transparent.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <set>
+
+// class set
+
+// template<typename K>
+// pair<iterator,iterator> equal_range(const K& x); //
+// C++14
+// template<typename K>
+// pair<const_iterator,const_iterator> equal_range(const K& x) const; //
+// C++14
+
+#include <cassert>
+#include <set>
+#include <utility>
+
+#include "min_allocator.h"
+#include "private_constructor.hpp"
+#include "test_macros.h"
+
+struct Comp {
+ using is_transparent = void;
+
+ bool operator()(const std::pair<int, int> &lhs,
+ const std::pair<int, int> &rhs) const {
+ return lhs < rhs;
+ }
+
+ bool operator()(const std::pair<int, int> &lhs, int rhs) const {
+ return lhs.first < rhs;
+ }
+
+ bool operator()(int lhs, const std::pair<int, int> &rhs) const {
+ return lhs < rhs.first;
+ }
+};
+
+int main() {
+ std::set<std::pair<int, int>, Comp> s{{2, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 2}};
+
+ auto er = s.equal_range(1);
+ long nels = 0;
+
+ for (auto it = er.first; it != er.second; it++) {
+ assert(it->first == 1);
+ nels++;
+ }
+
+ assert(nels == 3);
+}
diff --git a/test/std/containers/associative/set/insert_cv.pass.cpp b/test/std/containers/associative/set/insert_cv.pass.cpp
index 8d5290a97af9..17d3c26237c0 100644
--- a/test/std/containers/associative/set/insert_cv.pass.cpp
+++ b/test/std/containers/associative/set/insert_cv.pass.cpp
@@ -18,64 +18,49 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_cv_test()
{
- {
- typedef std::set<int> M;
- typedef std::pair<M::iterator, bool> R;
- M m;
- R r = m.insert(M::value_type(2));
- assert(r.second);
- assert(r.first == m.begin());
- assert(m.size() == 1);
- assert(*r.first == 2);
+ typedef Container M;
+ typedef std::pair<typename M::iterator, bool> R;
+ typedef typename M::value_type VT;
+ M m;
- r = m.insert(M::value_type(1));
- assert(r.second);
- assert(r.first == m.begin());
- assert(m.size() == 2);
- assert(*r.first == 1);
+ const VT v1(2);
+ R r = m.insert(v1);
+ assert(r.second);
+ assert(r.first == m.begin());
+ assert(m.size() == 1);
+ assert(*r.first == 2);
- r = m.insert(M::value_type(3));
- assert(r.second);
- assert(r.first == prev(m.end()));
- assert(m.size() == 3);
- assert(*r.first == 3);
+ const VT v2(1);
+ r = m.insert(v2);
+ assert(r.second);
+ assert(r.first == m.begin());
+ assert(m.size() == 2);
+ assert(*r.first == 1);
- r = m.insert(M::value_type(3));
- assert(!r.second);
- assert(r.first == prev(m.end()));
- assert(m.size() == 3);
- assert(*r.first == 3);
- }
+ const VT v3(3);
+ r = m.insert(v3);
+ assert(r.second);
+ assert(r.first == prev(m.end()));
+ assert(m.size() == 3);
+ assert(*r.first == 3);
+
+ r = m.insert(v3);
+ assert(!r.second);
+ assert(r.first == prev(m.end()));
+ assert(m.size() == 3);
+ assert(*r.first == 3);
+}
+
+int main()
+{
+ do_insert_cv_test<std::set<int> >();
#if TEST_STD_VER >= 11
{
typedef std::set<int, std::less<int>, min_allocator<int>> M;
- typedef std::pair<M::iterator, bool> R;
- M m;
- R r = m.insert(M::value_type(2));
- assert(r.second);
- assert(r.first == m.begin());
- assert(m.size() == 1);
- assert(*r.first == 2);
-
- r = m.insert(M::value_type(1));
- assert(r.second);
- assert(r.first == m.begin());
- assert(m.size() == 2);
- assert(*r.first == 1);
-
- r = m.insert(M::value_type(3));
- assert(r.second);
- assert(r.first == prev(m.end()));
- assert(m.size() == 3);
- assert(*r.first == 3);
-
- r = m.insert(M::value_type(3));
- assert(!r.second);
- assert(r.first == prev(m.end()));
- assert(m.size() == 3);
- assert(*r.first == 3);
+ do_insert_cv_test<M>();
}
#endif
}
diff --git a/test/std/containers/associative/set/set.cons/move.pass.cpp b/test/std/containers/associative/set/set.cons/move.pass.cpp
index dd313e4cd5e3..ff87799b90f7 100644
--- a/test/std/containers/associative/set/set.cons/move.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move.pass.cpp
@@ -35,7 +35,7 @@ int main()
assert(m.size() == 0);
assert(distance(m.begin(), m.end()) == 0);
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
@@ -66,7 +66,7 @@ int main()
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
- assert(mo.get_allocator() == A(7));
+ assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0);
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..f3b0527946e3
--- /dev/null
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+#include <queue>
+#include <deque>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+// queue(Compare, Container, const Alloc);
+// The '45' is not an allocator
+ std::priority_queue pri(std::greater<int>(), std::deque<int>({1,2,3}), 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}}
+ }
+
+ {
+// queue(const queue&, const Alloc&);
+// The '45' is not an allocator
+ std::priority_queue<int> source;
+ std::priority_queue pri(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}}
+ }
+
+ {
+// priority_queue(Iter, Iter, Comp)
+// int is not an iterator
+ std::priority_queue pri(15, 17, std::greater<double>()); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}}
+ }
+
+ {
+// priority_queue(Iter, Iter, Comp, Container)
+// float is not an iterator
+ std::priority_queue pri(23.f, 2.f, std::greater<float>(), std::deque<float>()); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}}
+ }
+
+// Test the implicit deduction guides
+ {
+// priority_queue (allocator &)
+ std::priority_queue pri((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// stack<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..bcbe1276af55
--- /dev/null
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+// template<class Compare, class Container>
+// priority_queue(Compare, Container)
+// -> priority_queue<typename Container::value_type, Container, Compare>;
+//
+// template<class InputIterator,
+// class Compare = less<typename iterator_traits<InputIterator>::value_type>,
+// class Container = vector<typename iterator_traits<InputIterator>::value_type>>
+// priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container())
+// -> priority_queue<typename iterator_traits<InputIterator>::value_type, Container, Compare>;
+//
+// template<class Compare, class Container, class Allocator>
+// priority_queue(Compare, Container, Allocator)
+// -> priority_queue<typename Container::value_type, Container, Compare>;
+
+
+#include <queue>
+#include <vector>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ std::vector<int> v{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::priority_queue pri(std::greater<int>(), v); // priority_queue(Compare, Container)
+
+ static_assert(std::is_same_v<decltype(pri), std::priority_queue<int, std::vector<int>, std::greater<int>>>, "");
+ assert(pri.size() == v.size());
+ assert(pri.top() == 0);
+ }
+
+ {
+ std::vector<long, test_allocator<long>> v{10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
+ std::priority_queue pri(std::greater<long>(), v, test_allocator<long>(2)); // priority_queue(Compare, Container, Allocator)
+
+ static_assert(std::is_same_v<decltype(pri),
+ std::priority_queue<long, std::vector<long, test_allocator<long>>, std::greater<long>>>, "");
+ assert(pri.size() == v.size());
+ assert(pri.top() == 10);
+ }
+
+ {
+ std::vector<short> v{10, 11, 12, 13, 14, 15, 28, 17, 18, 19 };
+ std::priority_queue pri(v.begin(), v.end()); // priority_queue(Iter, Iter)
+
+ static_assert(std::is_same_v<decltype(pri), std::priority_queue<short>>, "");
+ assert(pri.size() == v.size());
+ assert(pri.top() == 28);
+ }
+
+ {
+ std::vector<double> v{10, 11, 12, 13, 6, 15, 28, 17, 18, 19 };
+ std::priority_queue pri(v.begin(), v.end(), std::greater<double>()); // priority_queue(Iter, Iter, Comp)
+
+ static_assert(std::is_same_v<decltype(pri), std::priority_queue<double, std::vector<double>, std::greater<double>>>, "");
+ assert(pri.size() == v.size());
+ assert(pri.top() == 6);
+ }
+
+ {
+ std::vector<double> v{10, 6, 15, 28, 4, 18, 19 };
+ std::deque<double> deq;
+ std::priority_queue pri(v.begin(), v.end(), std::greater<double>(), deq); // priority_queue(Iter, Iter, Comp, Container)
+
+ static_assert(std::is_same_v<decltype(pri), std::priority_queue<double, std::deque<double>, std::greater<double>>>, "");
+ assert(pri.size() == v.size());
+ assert(pri.top() == 4);
+ }
+
+// Test the implicit deduction guides
+ {
+// We don't expect this one to work - no way to implicitly get value_type
+// std::priority_queue pri(std::allocator<int>()); // queue (allocator &)
+ }
+
+ {
+ std::priority_queue<float> source;
+ std::priority_queue pri(source); // priority_queue(priority_queue &)
+ static_assert(std::is_same_v<decltype(pri)::value_type, float>, "");
+ static_assert(std::is_same_v<decltype(pri)::container_type, std::vector<float>>, "");
+ assert(pri.size() == 0);
+ }
+
+ {
+// This one is odd - you can pass an allocator in to use, but the allocator
+// has to match the type of the one used by the underlying container
+ typedef long double T;
+ typedef std::greater<T> Comp;
+ typedef test_allocator<T> A;
+ typedef std::deque<T, A> Cont;
+
+ Cont c{2,3,0,1};
+ std::priority_queue<T, Cont, Comp> source(Comp(), c);
+ std::priority_queue pri(source, A(2)); // queue(queue &, allocator)
+ static_assert(std::is_same_v<decltype(pri)::value_type, T>, "");
+ static_assert(std::is_same_v<decltype(pri)::container_type, Cont>, "");
+ assert(pri.size() == 4);
+ assert(pri.top() == 0);
+ }
+}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp b/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..1605b96b13bc
--- /dev/null
+++ b/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+#include <queue>
+#include <list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+// queue(const Container&, const Alloc&);
+// The '45' is not an allocator
+ std::queue que(std::list<int>{1,2,3}, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}}
+ }
+
+ {
+// queue(const queue&, const Alloc&);
+// The '45' is not an allocator
+ std::queue<int> source;
+ std::queue que(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}}
+ }
+
+// Test the implicit deduction guides
+ {
+// queue (allocator &)
+ std::queue que((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// stack<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..58cb7f535766
--- /dev/null
+++ b/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp
@@ -0,0 +1,91 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-5, apple-clang-9
+// UNSUPPORTED: libcpp-no-deduction-guides
+// Clang 5 will generate bad implicit deduction guides
+// Specifically, for the copy constructor.
+
+// template<class Container>
+// queue(Container) -> queue<typename Container::value_type, Container>;
+//
+// template<class Container, class Allocator>
+// queue(Container, Allocator) -> queue<typename Container::value_type, Container>;
+
+
+#include <queue>
+#include <list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ std::list<int> l{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::queue que(l);
+
+ static_assert(std::is_same_v<decltype(que), std::queue<int, std::list<int>>>, "");
+ assert(que.size() == l.size());
+ assert(que.back() == l.back());
+ }
+
+ {
+ std::list<long, test_allocator<long>> l{10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
+ std::queue que(l, test_allocator<long>(0,2)); // different allocator
+ static_assert(std::is_same_v<decltype(que)::container_type, std::list<long, test_allocator<long>>>, "");
+ static_assert(std::is_same_v<decltype(que)::value_type, long>, "");
+ assert(que.size() == 10);
+ assert(que.back() == 19);
+// I'd like to assert that we've gotten the right allocator in the queue, but
+// I don't know how to get at the underlying container.
+ }
+
+// Test the implicit deduction guides
+ {
+// We don't expect this one to work - no way to implicitly get value_type
+// std::queue que(std::allocator<int>()); // queue (allocator &)
+ }
+
+ {
+ std::queue<A> source;
+ std::queue que(source); // queue(queue &)
+ static_assert(std::is_same_v<decltype(que)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(que)::container_type, std::deque<A>>, "");
+ assert(que.size() == 0);
+ }
+
+ {
+// This one is odd - you can pass an allocator in to use, but the allocator
+// has to match the type of the one used by the underlying container
+ typedef short T;
+ typedef test_allocator<T> A;
+ typedef std::deque<T, A> C;
+
+ C c{0,1,2,3};
+ std::queue<T, C> source(c);
+ std::queue que(source, A(2)); // queue(queue &, allocator)
+ static_assert(std::is_same_v<decltype(que)::value_type, T>, "");
+ static_assert(std::is_same_v<decltype(que)::container_type, C>, "");
+ assert(que.size() == 4);
+ assert(que.back() == 3);
+ }
+
+}
diff --git a/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
index 4142bc3694d1..ead9ad0bcdf8 100644
--- a/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
@@ -11,19 +11,38 @@
// <queue>
-// template <class... Args> reference emplace(Args&&... args);
-// return type is 'reference' in C++17; 'void' before
+// template <class... Args> decltype(auto) emplace(Args&&... args);
+// return type is 'decltype(auto)' in C++17; 'void' before
+// whatever the return type of the underlying container's emplace_back() returns.
#include <queue>
#include <cassert>
+#include <list>
#include "test_macros.h"
#include "../../../Emplaceable.h"
+template <typename Queue>
+void test_return_type() {
+ typedef typename Queue::container_type Container;
+ typedef typename Container::value_type value_type;
+ typedef decltype(std::declval<Queue>().emplace(std::declval<value_type &>())) queue_return_type;
+
+#if TEST_STD_VER > 14
+ typedef decltype(std::declval<Container>().emplace_back(std::declval<value_type>())) container_return_type;
+ static_assert(std::is_same<queue_return_type, container_return_type>::value, "");
+#else
+ static_assert(std::is_same<queue_return_type, void>::value, "");
+#endif
+}
+
int main()
{
+ test_return_type<std::queue<int> > ();
+ test_return_type<std::queue<int, std::list<int> > > ();
+
typedef Emplaceable T;
std::queue<Emplaceable> q;
#if TEST_STD_VER > 14
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp b/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..e54b51084430
--- /dev/null
+++ b/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <stack>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// vector(InputIterator, InputIterator, Allocator = Allocator())
+// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <stack>
+#include <list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+// stack(const Container&, const Alloc&);
+// The '45' is not an allocator
+ std::stack stk(std::list<int>({1,2,3}), 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'stack'}}
+ }
+
+ {
+// stack(const stack&, const Alloc&);
+// The '45' is not an allocator
+ std::stack<int> source;
+ std::stack stk(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'stack'}}
+ }
+
+// Test the implicit deduction guides
+ {
+// stack (allocator &)
+ std::stack stk((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'stack'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// stack<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..bb48f0e5e22e
--- /dev/null
+++ b/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp
@@ -0,0 +1,94 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <stack>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-5, apple-clang-9
+// UNSUPPORTED: libcpp-no-deduction-guides
+// Clang 5 will generate bad implicit deduction guides
+// Specifically, for the copy constructor.
+
+
+// template<class Container>
+// stack(Container) -> stack<typename Container::value_type, Container>;
+//
+// template<class Container, class Allocator>
+// stack(Container, Allocator) -> stack<typename Container::value_type, Container>;
+
+
+#include <stack>
+#include <vector>
+#include <list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ std::vector<int> v{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::stack stk(v);
+
+ static_assert(std::is_same_v<decltype(stk), std::stack<int, std::vector<int>>>, "");
+ assert(stk.size() == v.size());
+ assert(stk.top() == v.back());
+ }
+
+ {
+ std::list<long, test_allocator<long>> l{10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
+ std::stack stk(l, test_allocator<long>(0,2)); // different allocator
+ static_assert(std::is_same_v<decltype(stk)::container_type, std::list<long, test_allocator<long>>>, "");
+ static_assert(std::is_same_v<decltype(stk)::value_type, long>, "");
+ assert(stk.size() == 10);
+ assert(stk.top() == 19);
+// I'd like to assert that we've gotten the right allocator in the stack, but
+// I don't know how to get at the underlying container.
+ }
+
+// Test the implicit deduction guides
+
+ {
+// We don't expect this one to work - no way to implicitly get value_type
+// std::stack stk(std::allocator<int>()); // stack (allocator &)
+ }
+
+ {
+ std::stack<A> source;
+ std::stack stk(source); // stack(stack &)
+ static_assert(std::is_same_v<decltype(stk)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(stk)::container_type, std::deque<A>>, "");
+ assert(stk.size() == 0);
+ }
+
+ {
+// This one is odd - you can pass an allocator in to use, but the allocator
+// has to match the type of the one used by the underlying container
+ typedef short T;
+ typedef test_allocator<T> A;
+ typedef std::deque<T, A> C;
+
+ C c{0,1,2,3};
+ std::stack<T, C> source(c);
+ std::stack stk(source, A(2)); // stack(stack &, allocator)
+ static_assert(std::is_same_v<decltype(stk)::value_type, T>, "");
+ static_assert(std::is_same_v<decltype(stk)::container_type, C>, "");
+ assert(stk.size() == 4);
+ assert(stk.top() == 3);
+ }
+
+}
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
index 8b19972eb32e..bb6ff8f91670 100644
--- a/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
@@ -11,18 +11,37 @@
// <stack>
-// template <class... Args> reference emplace(Args&&... args);
-// return type is 'reference' in C++17; 'void' before
+// template <class... Args> decltype(auto) emplace(Args&&... args);
+// return type is 'decltype(auto)' in C++17; 'void' before
+// whatever the return type of the underlying container's emplace_back() returns.
#include <stack>
#include <cassert>
+#include <vector>
#include "test_macros.h"
#include "../../../Emplaceable.h"
+template <typename Stack>
+void test_return_type() {
+ typedef typename Stack::container_type Container;
+ typedef typename Container::value_type value_type;
+ typedef decltype(std::declval<Stack>().emplace(std::declval<value_type &>())) stack_return_type;
+
+#if TEST_STD_VER > 14
+ typedef decltype(std::declval<Container>().emplace_back(std::declval<value_type>())) container_return_type;
+ static_assert(std::is_same<stack_return_type, container_return_type>::value, "");
+#else
+ static_assert(std::is_same<stack_return_type, void>::value, "");
+#endif
+}
+
int main()
{
+ test_return_type<std::stack<int> > ();
+ test_return_type<std::stack<int, std::vector<int> > > ();
+
typedef Emplaceable T;
std::stack<Emplaceable> q;
#if TEST_STD_VER > 14
diff --git a/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp b/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp
new file mode 100644
index 000000000000..81f4ad8934d8
--- /dev/null
+++ b/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp
@@ -0,0 +1,106 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// C++2a[container.requirements.general]p8
+// Move constructors obtain an allocator by move construction from the allocator
+// belonging to the container being moved. Such move construction of the
+// allocator shall not exit via an exception.
+
+#include <vector>
+#include <deque>
+#include <list>
+#include <forward_list>
+#include <set>
+#include <map>
+#include <unordered_map>
+#include <unordered_set>
+
+#include "test_macros.h"
+#include "test_allocator.h"
+
+template <class C>
+void test(int expected_num_allocs = 1) {
+ {
+ test_alloc_base::clear();
+ using AllocT = typename C::allocator_type;
+ C v(AllocT(42, 101));
+
+ assert(test_alloc_base::count == expected_num_allocs);
+
+ const int num_stored_allocs = test_alloc_base::count;
+ {
+ const AllocT& a = v.get_allocator();
+ assert(test_alloc_base::count == 1 + num_stored_allocs);
+ assert(a.get_data() == 42);
+ assert(a.get_id() == 101);
+ }
+ assert(test_alloc_base::count == num_stored_allocs);
+ test_alloc_base::clear_ctor_counters();
+
+ C v2 = std::move(v);
+ assert(test_alloc_base::count == num_stored_allocs * 2);
+ assert(test_alloc_base::copied == 0);
+ assert(test_alloc_base::moved == num_stored_allocs);
+ {
+ const AllocT& a = v.get_allocator();
+ assert(a.get_id() == test_alloc_base::moved_value);
+ assert(a.get_data() == test_alloc_base::moved_value);
+ }
+ {
+ const AllocT& a = v2.get_allocator();
+ assert(a.get_id() == 101);
+ assert(a.get_data() == 42);
+ }
+ }
+}
+
+int main() {
+ { // test sequence containers
+ test<std::vector<int, test_allocator<int> > >();
+ test<std::vector<bool, test_allocator<bool> > >();
+ test<std::list<int, test_allocator<int> > >();
+ test<std::forward_list<int, test_allocator<int> > >();
+
+ // libc++ stores two allocators in deque
+#ifdef _LIBCPP_VERSION
+ int stored_allocators = 2;
+#else
+ int stored_allocators = 1;
+#endif
+ test<std::deque<int, test_allocator<int> > >(stored_allocators);
+ }
+ { // test associative containers
+ test<std::set<int, std::less<int>, test_allocator<int> > >();
+ test<std::multiset<int, std::less<int>, test_allocator<int> > >();
+
+ using KV = std::pair<const int, int>;
+ test<std::map<int, int, std::less<int>, test_allocator<KV> > >();
+ test<std::multimap<int, int, std::less<int>, test_allocator<KV> > >();
+ }
+ { // test unordered containers
+ // libc++ stores two allocators in the unordered containers.
+#ifdef _LIBCPP_VERSION
+ int stored_allocators = 2;
+#else
+ int stored_allocators = 1;
+#endif
+ test<std::unordered_set<int, std::hash<int>, std::equal_to<int>,
+ test_allocator<int> > >(stored_allocators);
+ test<std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
+ test_allocator<int> > >(stored_allocators);
+
+ using KV = std::pair<const int, int>;
+ test<std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
+ test_allocator<KV> > >(stored_allocators);
+ test<std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>,
+ test_allocator<KV> > >(stored_allocators);
+ }
+}
diff --git a/test/std/containers/sequences/array/array.cons/deduct.fail.cpp b/test/std/containers/sequences/array/array.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..c04c9b60786d
--- /dev/null
+++ b/test/std/containers/sequences/array/array.cons/deduct.fail.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class T, class... U>
+// array(T, U...) -> array<T, 1 + sizeof...(U)>;
+//
+// Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed.
+
+
+#include <array>
+#include <cassert>
+#include <cstddef>
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+
+#include "test_macros.h"
+
+int main()
+{
+ {
+ std::array arr{1,2,3L}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'array'}}
+ }
+}
diff --git a/test/std/containers/sequences/array/array.cons/deduct.pass.cpp b/test/std/containers/sequences/array/array.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..bfa0bb79189d
--- /dev/null
+++ b/test/std/containers/sequences/array/array.cons/deduct.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-5, apple-clang-9
+// UNSUPPORTED: libcpp-no-deduction-guides
+// Clang 5 will generate bad implicit deduction guides
+// Specifically, for the copy constructor.
+
+
+// template <class T, class... U>
+// array(T, U...) -> array<T, 1 + sizeof...(U)>;
+//
+// Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed.
+
+
+#include <array>
+#include <cassert>
+#include <cstddef>
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+#include "test_macros.h"
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+ std::array arr{1,2,3}; // array(T, U...)
+ static_assert(std::is_same_v<decltype(arr), std::array<int, 3>>, "");
+ assert(arr[0] == 1);
+ assert(arr[1] == 2);
+ assert(arr[2] == 3);
+ }
+
+ {
+ const long l1 = 42;
+ std::array arr{1L, 4L, 9L, l1}; // array(T, U...)
+ static_assert(std::is_same_v<decltype(arr)::value_type, long>, "");
+ static_assert(arr.size() == 4, "");
+ assert(arr[0] == 1);
+ assert(arr[1] == 4);
+ assert(arr[2] == 9);
+ assert(arr[3] == l1);
+ }
+
+// Test the implicit deduction guides
+ {
+ std::array<double, 2> source = {4.0, 5.0};
+ std::array arr(source); // array(array)
+ static_assert(std::is_same_v<decltype(arr), decltype(source)>, "");
+ static_assert(std::is_same_v<decltype(arr), std::array<double, 2>>, "");
+ assert(arr[0] == 4.0);
+ assert(arr[1] == 5.0);
+ }
+}
diff --git a/test/std/containers/sequences/array/array.cons/default.pass.cpp b/test/std/containers/sequences/array/array.cons/default.pass.cpp
index 7bc62b759c35..9a2a6eaa3070 100644
--- a/test/std/containers/sequences/array/array.cons/default.pass.cpp
+++ b/test/std/containers/sequences/array/array.cons/default.pass.cpp
@@ -14,6 +14,14 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+struct NoDefault {
+ NoDefault(int) {}
+};
+
int main()
{
{
@@ -28,4 +36,13 @@ int main()
C c;
assert(c.size() == 0);
}
+ {
+ typedef std::array<NoDefault, 0> C;
+ C c;
+ assert(c.size() == 0);
+ C c1 = {};
+ assert(c1.size() == 0);
+ C c2 = {{}};
+ assert(c2.size() == 0);
+ }
}
diff --git a/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp b/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp
new file mode 100644
index 000000000000..7814085e8a7d
--- /dev/null
+++ b/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// implicitly generated array constructors / assignment operators
+
+#include <array>
+#include <type_traits>
+#include <cassert>
+#include "test_macros.h"
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+// In C++03 the copy assignment operator is not deleted when the implicitly
+// generated operator would be ill-formed; like in the case of a struct with a
+// const member.
+#if TEST_STD_VER < 11
+#define TEST_NOT_COPY_ASSIGNABLE(T) ((void)0)
+#else
+#define TEST_NOT_COPY_ASSIGNABLE(T) static_assert(!std::is_copy_assignable<T>::value, "")
+#endif
+
+struct NoDefault {
+ NoDefault(int) {}
+};
+
+int main() {
+ {
+ typedef double T;
+ typedef std::array<T, 3> C;
+ C c = {1.1, 2.2, 3.3};
+ C c2 = c;
+ c2 = c;
+ static_assert(std::is_copy_constructible<C>::value, "");
+ static_assert(std::is_copy_assignable<C>::value, "");
+ }
+ {
+ typedef double T;
+ typedef std::array<const T, 3> C;
+ C c = {1.1, 2.2, 3.3};
+ C c2 = c;
+ ((void)c2);
+ static_assert(std::is_copy_constructible<C>::value, "");
+ TEST_NOT_COPY_ASSIGNABLE(C);
+ }
+ {
+ typedef double T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ C c2 = c;
+ c2 = c;
+ static_assert(std::is_copy_constructible<C>::value, "");
+ static_assert(std::is_copy_assignable<C>::value, "");
+ }
+ {
+ // const arrays of size 0 should disable the implicit copy assignment operator.
+ typedef double T;
+ typedef std::array<const T, 0> C;
+ C c = {{}};
+ C c2 = c;
+ ((void)c2);
+ static_assert(std::is_copy_constructible<C>::value, "");
+ TEST_NOT_COPY_ASSIGNABLE(C);
+ }
+ {
+ typedef NoDefault T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ C c2 = c;
+ c2 = c;
+ static_assert(std::is_copy_constructible<C>::value, "");
+ static_assert(std::is_copy_assignable<C>::value, "");
+ }
+ {
+ typedef NoDefault T;
+ typedef std::array<const T, 0> C;
+ C c = {{}};
+ C c2 = c;
+ ((void)c2);
+ static_assert(std::is_copy_constructible<C>::value, "");
+ TEST_NOT_COPY_ASSIGNABLE(C);
+ }
+
+}
diff --git a/test/std/containers/sequences/array/array.data/data.pass.cpp b/test/std/containers/sequences/array/array.data/data.pass.cpp
index d7aed70c98ad..714894308f00 100644
--- a/test/std/containers/sequences/array/array.data/data.pass.cpp
+++ b/test/std/containers/sequences/array/array.data/data.pass.cpp
@@ -13,6 +13,7 @@
#include <array>
#include <cassert>
+#include "test_macros.h"
// std::array is explicitly allowed to be initialized with A a = { init-list };.
// Disable the missing braces warning for this reason.
@@ -34,6 +35,33 @@ int main()
typedef std::array<T, 0> C;
C c = {};
T* p = c.data();
- (void)p; // to placate scan-build
+ assert(p != nullptr);
+ }
+ {
+ typedef double T;
+ typedef std::array<const T, 0> C;
+ C c = {{}};
+ const T* p = c.data();
+ static_assert((std::is_same<decltype(c.data()), const T*>::value), "");
+ assert(p != nullptr);
+ }
+ {
+ typedef std::max_align_t T;
+ typedef std::array<T, 0> C;
+ const C c = {};
+ const T* p = c.data();
+ assert(p != nullptr);
+ std::uintptr_t pint = reinterpret_cast<std::uintptr_t>(p);
+ assert(pint % TEST_ALIGNOF(std::max_align_t) == 0);
+ }
+ {
+ struct NoDefault {
+ NoDefault(int) {}
+ };
+ typedef NoDefault T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ T* p = c.data();
+ assert(p != nullptr);
}
}
diff --git a/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/test/std/containers/sequences/array/array.data/data_const.pass.cpp
index 5be082eeb843..b99bf6af8627 100644
--- a/test/std/containers/sequences/array/array.data/data_const.pass.cpp
+++ b/test/std/containers/sequences/array/array.data/data_const.pass.cpp
@@ -38,6 +38,25 @@ int main()
const T* p = c.data();
(void)p; // to placate scan-build
}
+ {
+ struct NoDefault {
+ NoDefault(int) {}
+ };
+ typedef NoDefault T;
+ typedef std::array<T, 0> C;
+ const C c = {};
+ const T* p = c.data();
+ assert(p != nullptr);
+ }
+ {
+ typedef std::max_align_t T;
+ typedef std::array<T, 0> C;
+ const C c = {};
+ const T* p = c.data();
+ assert(p != nullptr);
+ std::uintptr_t pint = reinterpret_cast<std::uintptr_t>(p);
+ assert(pint % TEST_ALIGNOF(std::max_align_t) == 0);
+ }
#if TEST_STD_VER > 14
{
typedef std::array<int, 5> C;
diff --git a/test/std/containers/sequences/array/array.fill/fill.fail.cpp b/test/std/containers/sequences/array/array.fill/fill.fail.cpp
new file mode 100644
index 000000000000..4cd8e60ac13d
--- /dev/null
+++ b/test/std/containers/sequences/array/array.fill/fill.fail.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// void fill(const T& u);
+
+#include <array>
+#include <cassert>
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+int main() {
+ {
+ typedef double T;
+ typedef std::array<const T, 0> C;
+ C c = {};
+ // expected-error-re@array:* {{static_assert failed {{.*}}"cannot fill zero-sized array of type 'const T'"}}
+ c.fill(5.5); // expected-note {{requested here}}
+ }
+}
diff --git a/test/std/containers/sequences/array/array.swap/swap.fail.cpp b/test/std/containers/sequences/array/array.swap/swap.fail.cpp
new file mode 100644
index 000000000000..638c5b3212f1
--- /dev/null
+++ b/test/std/containers/sequences/array/array.swap/swap.fail.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// void swap(array& a);
+
+#include <array>
+#include <cassert>
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+int main() {
+ {
+ typedef double T;
+ typedef std::array<const T, 0> C;
+ C c = {};
+ C c2 = {};
+ // expected-error-re@array:* {{static_assert failed {{.*}}"cannot swap zero-sized array of type 'const T'"}}
+ c.swap(c2); // expected-note {{requested here}}
+ }
+}
diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index 27b326fa7ce4..84a8d6f9d18e 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -56,6 +56,26 @@ int main()
catch (const std::out_of_range &) {}
#endif
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ typedef double T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ C const& cc = c;
+ try
+ {
+ TEST_IGNORE_NODISCARD c.at(0);
+ assert(false);
+ }
+ catch (const std::out_of_range &) {}
+ try
+ {
+ TEST_IGNORE_NODISCARD cc.at(0);
+ assert(false);
+ }
+ catch (const std::out_of_range &) {}
+ }
+#endif
{
typedef double T;
typedef std::array<T, 3> C;
diff --git a/test/std/containers/sequences/array/begin.pass.cpp b/test/std/containers/sequences/array/begin.pass.cpp
index b12ffc851b84..282a947fefec 100644
--- a/test/std/containers/sequences/array/begin.pass.cpp
+++ b/test/std/containers/sequences/array/begin.pass.cpp
@@ -18,6 +18,7 @@
// Disable the missing braces warning for this reason.
#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -31,4 +32,13 @@ int main()
*i = 5.5;
assert(c[0] == 5.5);
}
+ {
+ struct NoDefault {
+ NoDefault(int) {}
+ };
+ typedef NoDefault T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ assert(c.begin() == c.end());
+ }
}
diff --git a/test/std/containers/sequences/array/compare.fail.cpp b/test/std/containers/sequences/array/compare.fail.cpp
new file mode 100644
index 000000000000..2aa7cd896d9e
--- /dev/null
+++ b/test/std/containers/sequences/array/compare.fail.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// bool operator==(array<T, N> const&, array<T, N> const&);
+// bool operator!=(array<T, N> const&, array<T, N> const&);
+// bool operator<(array<T, N> const&, array<T, N> const&);
+// bool operator<=(array<T, N> const&, array<T, N> const&);
+// bool operator>(array<T, N> const&, array<T, N> const&);
+// bool operator>=(array<T, N> const&, array<T, N> const&);
+
+
+#include <array>
+#include <vector>
+#include <cassert>
+
+#include "test_macros.h"
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+template <class Array>
+void test_compare(const Array& LHS, const Array& RHS) {
+ typedef std::vector<typename Array::value_type> Vector;
+ const Vector LHSV(LHS.begin(), LHS.end());
+ const Vector RHSV(RHS.begin(), RHS.end());
+ assert((LHS == RHS) == (LHSV == RHSV));
+ assert((LHS != RHS) == (LHSV != RHSV));
+ assert((LHS < RHS) == (LHSV < RHSV));
+ assert((LHS <= RHS) == (LHSV <= RHSV));
+ assert((LHS > RHS) == (LHSV > RHSV));
+ assert((LHS >= RHS) == (LHSV >= RHSV));
+}
+
+template <int Dummy> struct NoCompare {};
+
+int main()
+{
+ {
+ typedef NoCompare<0> T;
+ typedef std::array<T, 3> C;
+ C c1 = {{}};
+ // expected-error@algorithm:* 2 {{invalid operands to binary expression}}
+ TEST_IGNORE_NODISCARD (c1 == c1);
+ TEST_IGNORE_NODISCARD (c1 < c1);
+ }
+ {
+ typedef NoCompare<1> T;
+ typedef std::array<T, 3> C;
+ C c1 = {{}};
+ // expected-error@algorithm:* 2 {{invalid operands to binary expression}}
+ TEST_IGNORE_NODISCARD (c1 != c1);
+ TEST_IGNORE_NODISCARD (c1 > c1);
+ }
+ {
+ typedef NoCompare<2> T;
+ typedef std::array<T, 0> C;
+ C c1 = {{}};
+ // expected-error@algorithm:* 2 {{invalid operands to binary expression}}
+ TEST_IGNORE_NODISCARD (c1 == c1);
+ TEST_IGNORE_NODISCARD (c1 < c1);
+ }
+}
diff --git a/test/std/containers/sequences/array/compare.pass.cpp b/test/std/containers/sequences/array/compare.pass.cpp
new file mode 100644
index 000000000000..c8bcf75a0934
--- /dev/null
+++ b/test/std/containers/sequences/array/compare.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// bool operator==(array<T, N> const&, array<T, N> const&);
+// bool operator!=(array<T, N> const&, array<T, N> const&);
+// bool operator<(array<T, N> const&, array<T, N> const&);
+// bool operator<=(array<T, N> const&, array<T, N> const&);
+// bool operator>(array<T, N> const&, array<T, N> const&);
+// bool operator>=(array<T, N> const&, array<T, N> const&);
+
+
+#include <array>
+#include <vector>
+#include <cassert>
+
+#include "test_macros.h"
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+template <class Array>
+void test_compare(const Array& LHS, const Array& RHS) {
+ typedef std::vector<typename Array::value_type> Vector;
+ const Vector LHSV(LHS.begin(), LHS.end());
+ const Vector RHSV(RHS.begin(), RHS.end());
+ assert((LHS == RHS) == (LHSV == RHSV));
+ assert((LHS != RHS) == (LHSV != RHSV));
+ assert((LHS < RHS) == (LHSV < RHSV));
+ assert((LHS <= RHS) == (LHSV <= RHSV));
+ assert((LHS > RHS) == (LHSV > RHSV));
+ assert((LHS >= RHS) == (LHSV >= RHSV));
+}
+
+int main()
+{
+ {
+ typedef int T;
+ typedef std::array<T, 3> C;
+ C c1 = {1, 2, 3};
+ C c2 = {1, 2, 3};
+ C c3 = {3, 2, 1};
+ C c4 = {1, 2, 1};
+ test_compare(c1, c2);
+ test_compare(c1, c3);
+ test_compare(c1, c4);
+ }
+ {
+ typedef int T;
+ typedef std::array<T, 0> C;
+ C c1 = {};
+ C c2 = {};
+ test_compare(c1, c2);
+ }
+}
diff --git a/test/std/containers/sequences/array/empty.fail.cpp b/test/std/containers/sequences/array/empty.fail.cpp
index 85bf5a7c9dab..fe118c5f19b5 100644
--- a/test/std/containers/sequences/array/empty.fail.cpp
+++ b/test/std/containers/sequences/array/empty.fail.cpp
@@ -23,6 +23,9 @@
int main ()
{
+
std::array<int, 1> c;
- c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
+ c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::array<int, 0> c0;
+ c0.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/test/std/containers/sequences/array/front_back.pass.cpp b/test/std/containers/sequences/array/front_back.pass.cpp
index 0591ca7fac31..443f28ddf517 100644
--- a/test/std/containers/sequences/array/front_back.pass.cpp
+++ b/test/std/containers/sequences/array/front_back.pass.cpp
@@ -64,7 +64,38 @@ int main()
C::const_reference r2 = c.back();
assert(r2 == 3.5);
}
-
+ {
+ typedef double T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ C const& cc = c;
+ static_assert((std::is_same<decltype(c.front()), T &>::value), "");
+ static_assert((std::is_same<decltype(cc.front()), const T &>::value), "");
+ static_assert((std::is_same<decltype(c.back()), T &>::value), "");
+ static_assert((std::is_same<decltype(cc.back()), const T &>::value), "");
+ if (c.size() > (0)) { // always false
+ TEST_IGNORE_NODISCARD c.front();
+ TEST_IGNORE_NODISCARD c.back();
+ TEST_IGNORE_NODISCARD cc.front();
+ TEST_IGNORE_NODISCARD cc.back();
+ }
+ }
+ {
+ typedef double T;
+ typedef std::array<const T, 0> C;
+ C c = {{}};
+ C const& cc = c;
+ static_assert((std::is_same<decltype(c.front()), const T &>::value), "");
+ static_assert((std::is_same<decltype(cc.front()), const T &>::value), "");
+ static_assert((std::is_same<decltype(c.back()), const T &>::value), "");
+ static_assert((std::is_same<decltype(cc.back()), const T &>::value), "");
+ if (c.size() > (0)) {
+ TEST_IGNORE_NODISCARD c.front();
+ TEST_IGNORE_NODISCARD c.back();
+ TEST_IGNORE_NODISCARD cc.front();
+ TEST_IGNORE_NODISCARD cc.back();
+ }
+ }
#if TEST_STD_VER > 11
{
typedef double T;
diff --git a/test/std/containers/sequences/array/indexing.pass.cpp b/test/std/containers/sequences/array/indexing.pass.cpp
index 43c494777a9d..7718b92f989e 100644
--- a/test/std/containers/sequences/array/indexing.pass.cpp
+++ b/test/std/containers/sequences/array/indexing.pass.cpp
@@ -56,7 +56,34 @@ int main()
C::const_reference r2 = c[2];
assert(r2 == 3.5);
}
-
+ { // Test operator[] "works" on zero sized arrays
+ typedef double T;
+ typedef std::array<T, 0> C;
+ C c = {};
+ C const& cc = c;
+ static_assert((std::is_same<decltype(c[0]), T &>::value), "");
+ static_assert((std::is_same<decltype(cc[0]), const T &>::value), "");
+ if (c.size() > (0)) { // always false
+ C::reference r1 = c[0];
+ C::const_reference r2 = cc[0];
+ ((void)r1);
+ ((void)r2);
+ }
+ }
+ { // Test operator[] "works" on zero sized arrays
+ typedef double T;
+ typedef std::array<const T, 0> C;
+ C c = {{}};
+ C const& cc = c;
+ static_assert((std::is_same<decltype(c[0]), const T &>::value), "");
+ static_assert((std::is_same<decltype(cc[0]), const T &>::value), "");
+ if (c.size() > (0)) { // always false
+ C::reference r1 = c[0];
+ C::const_reference r2 = cc[0];
+ ((void)r1);
+ ((void)r2);
+ }
+ }
#if TEST_STD_VER > 11
{
typedef double T;
diff --git a/test/std/containers/sequences/array/size_and_alignment.pass.cpp b/test/std/containers/sequences/array/size_and_alignment.pass.cpp
new file mode 100644
index 000000000000..966d063fe17a
--- /dev/null
+++ b/test/std/containers/sequences/array/size_and_alignment.pass.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// template <class T, size_t N >
+// struct array
+
+// Test the size and alignment matches that of an array of a given type.
+
+#include <array>
+#include <iterator>
+#include <type_traits>
+#include <cstddef>
+
+#include "test_macros.h"
+
+
+template <class T, size_t Size>
+struct MyArray {
+ T elems[Size];
+};
+
+template <class T, size_t Size>
+void test() {
+ typedef T CArrayT[Size == 0 ? 1 : Size];
+ typedef std::array<T, Size> ArrayT;
+ typedef MyArray<T, Size == 0 ? 1 : Size> MyArrayT;
+ static_assert(sizeof(ArrayT) == sizeof(CArrayT), "");
+ static_assert(sizeof(ArrayT) == sizeof(MyArrayT), "");
+ static_assert(TEST_ALIGNOF(ArrayT) == TEST_ALIGNOF(MyArrayT), "");
+#if defined(_LIBCPP_VERSION)
+ ArrayT a;
+ ((void)a);
+ static_assert(sizeof(ArrayT) == sizeof(a.__elems_), "");
+ static_assert(TEST_ALIGNOF(ArrayT) == __alignof__(a.__elems_), "");
+#endif
+}
+
+template <class T>
+void test_type() {
+ test<T, 1>();
+ test<T, 42>();
+ test<T, 0>();
+}
+
+struct TEST_ALIGNAS(TEST_ALIGNOF(std::max_align_t) * 2) TestType1 {
+
+};
+
+struct TEST_ALIGNAS(TEST_ALIGNOF(std::max_align_t) * 2) TestType2 {
+ char data[1000];
+};
+
+//static_assert(sizeof(void*) == 4, "");
+
+int main() {
+ test_type<char>();
+ test_type<int>();
+ test_type<double>();
+ test_type<long double>();
+ test_type<std::max_align_t>();
+ test_type<TestType1>();
+ test_type<TestType2>();
+}
diff --git a/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp b/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..61ab9c8421bb
--- /dev/null
+++ b/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// deque(InputIterator, InputIterator, Allocator = Allocator())
+// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <deque>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+struct A {};
+
+int main()
+{
+// Test the explicit deduction guides
+
+// Test the implicit deduction guides
+ {
+// deque (allocator &)
+ std::deque deq((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'deque'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// deque<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp b/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..a2ec262f1583
--- /dev/null
+++ b/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
@@ -0,0 +1,98 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// deque(InputIterator, InputIterator, Allocator = Allocator())
+// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <deque>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::deque deq(std::begin(arr), std::end(arr));
+
+ static_assert(std::is_same_v<decltype(deq), std::deque<int>>, "");
+ assert(std::equal(deq.begin(), deq.end(), std::begin(arr), std::end(arr)));
+ }
+
+ {
+ const long arr[] = {INT_MAX, 1L, 2L, 3L };
+ std::deque deq(std::begin(arr), std::end(arr), std::allocator<long>());
+ static_assert(std::is_same_v<decltype(deq)::value_type, long>, "");
+ assert(deq.size() == 4);
+ assert(deq[0] == INT_MAX);
+ assert(deq[1] == 1L);
+ assert(deq[2] == 2L);
+ }
+
+// Test the implicit deduction guides
+
+ {
+// We don't expect this one to work.
+// std::deque deq(std::allocator<int>()); // deque (allocator &)
+ }
+
+ {
+ std::deque deq(1, A{}); // deque (size_type, T)
+ static_assert(std::is_same_v<decltype(deq)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(deq)::allocator_type, std::allocator<A>>, "");
+ assert(deq.size() == 1);
+ }
+
+ {
+ std::deque deq(1, A{}, test_allocator<A>()); // deque (size_type, T, allocator)
+ static_assert(std::is_same_v<decltype(deq)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(deq)::allocator_type, test_allocator<A>>, "");
+ assert(deq.size() == 1);
+ }
+
+ {
+ std::deque deq{1U, 2U, 3U, 4U, 5U}; // deque(initializer-list)
+ static_assert(std::is_same_v<decltype(deq)::value_type, unsigned>, "");
+ assert(deq.size() == 5);
+ assert(deq[2] == 3U);
+ }
+
+ {
+ std::deque deq({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // deque(initializer-list, allocator)
+ static_assert(std::is_same_v<decltype(deq)::value_type, double>, "");
+ static_assert(std::is_same_v<decltype(deq)::allocator_type, test_allocator<double>>, "");
+ assert(deq.size() == 4);
+ assert(deq[3] == 4.0);
+ }
+
+ {
+ std::deque<long double> source;
+ std::deque deq(source); // deque(deque &)
+ static_assert(std::is_same_v<decltype(deq)::value_type, long double>, "");
+ static_assert(std::is_same_v<decltype(deq)::allocator_type, std::allocator<long double>>, "");
+ assert(deq.size() == 0);
+ }
+}
diff --git a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
index 6e935a52bb24..a7264a55633c 100644
--- a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
@@ -32,10 +32,12 @@ int main()
std::deque<MoveOnly, A> c2(A(2));
for (int* p = ab; p < an; ++p)
c2.push_back(MoveOnly(*p));
+ A old_a = c1.get_allocator();
std::deque<MoveOnly, A> c3 = std::move(c1);
assert(c2 == c3);
assert(c1.size() == 0);
- assert(c3.get_allocator() == c1.get_allocator());
+ assert(c3.get_allocator() == old_a);
+ assert(c1.get_allocator() == A(test_alloc_base::moved_value));
}
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..ef5b20ee7b0c
--- /dev/null
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <forward_list>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// forward_list(InputIterator, InputIterator, Allocator = Allocator())
+// -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <forward_list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+struct A {};
+
+int main()
+{
+// Test the explicit deduction guides
+
+// Test the implicit deduction guides
+ {
+// forward_list (allocator &)
+ std::forward_list fwl((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'forward_list'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// forward_list<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..c3969a4623e5
--- /dev/null
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp
@@ -0,0 +1,103 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <forward_list>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// deque(InputIterator, InputIterator, Allocator = Allocator())
+// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <forward_list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::forward_list fwl(std::begin(arr), std::end(arr));
+
+ static_assert(std::is_same_v<decltype(fwl), std::forward_list<int>>, "");
+ assert(std::equal(fwl.begin(), fwl.end(), std::begin(arr), std::end(arr)));
+ }
+
+ {
+ const long arr[] = {INT_MAX, 1L, 2L, 3L };
+ std::forward_list fwl(std::begin(arr), std::end(arr), std::allocator<long>());
+ static_assert(std::is_same_v<decltype(fwl)::value_type, long>, "");
+ assert(std::distance(fwl.begin(), fwl.end()) == 4); // no size for forward_list
+ auto it = fwl.begin();
+ assert(*it++ == INT_MAX);
+ assert(*it++ == 1L);
+ assert(*it++ == 2L);
+ }
+
+// Test the implicit deduction guides
+
+ {
+// We don't expect this one to work.
+// std::forward_list fwl(std::allocator<int>()); // deque (allocator &)
+ }
+
+ {
+ std::forward_list fwl(1, A{}); // deque (size_type, T)
+ static_assert(std::is_same_v<decltype(fwl)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(fwl)::allocator_type, std::allocator<A>>, "");
+ assert(std::distance(fwl.begin(), fwl.end()) == 1); // no size for forward_list
+ }
+
+ {
+ std::forward_list fwl(1, A{}, test_allocator<A>()); // deque (size_type, T, allocator)
+ static_assert(std::is_same_v<decltype(fwl)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(fwl)::allocator_type, test_allocator<A>>, "");
+ assert(std::distance(fwl.begin(), fwl.end()) == 1); // no size for forward_list
+ }
+
+ {
+ std::forward_list fwl{1U, 2U, 3U, 4U, 5U}; // deque(initializer-list)
+ static_assert(std::is_same_v<decltype(fwl)::value_type, unsigned>, "");
+ assert(std::distance(fwl.begin(), fwl.end()) == 5); // no size for forward_list
+ auto it = fwl.begin();
+ std::advance(it, 2);
+ assert(*it == 3U);
+ }
+
+ {
+ std::forward_list fwl({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // deque(initializer-list, allocator)
+ static_assert(std::is_same_v<decltype(fwl)::value_type, double>, "");
+ static_assert(std::is_same_v<decltype(fwl)::allocator_type, test_allocator<double>>, "");
+ assert(std::distance(fwl.begin(), fwl.end()) == 4); // no size for forward_list
+ auto it = fwl.begin();
+ std::advance(it, 3);
+ assert(*it == 4.0);
+ }
+
+ {
+ std::forward_list<long double> source;
+ std::forward_list fwl(source); // deque(deque &)
+ static_assert(std::is_same_v<decltype(fwl)::value_type, long double>, "");
+ static_assert(std::is_same_v<decltype(fwl)::allocator_type, std::allocator<long double>>, "");
+ assert(std::distance(fwl.begin(), fwl.end()) == 0); // no size for forward_list
+ }
+}
diff --git a/test/std/containers/sequences/list/list.cons/deduct.fail.cpp b/test/std/containers/sequences/list/list.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..5708d73734e6
--- /dev/null
+++ b/test/std/containers/sequences/list/list.cons/deduct.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// list(InputIterator, InputIterator, Allocator = Allocator())
+// -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+struct A {};
+
+int main()
+{
+// Test the explicit deduction guides
+
+// Test the implicit deduction guides
+ {
+// list (allocator &)
+ std::list lst((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'list'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// deque<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/sequences/list/list.cons/deduct.pass.cpp b/test/std/containers/sequences/list/list.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..b8021ef980c4
--- /dev/null
+++ b/test/std/containers/sequences/list/list.cons/deduct.pass.cpp
@@ -0,0 +1,103 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// list(InputIterator, InputIterator, Allocator = Allocator())
+// -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <list>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::list lst(std::begin(arr), std::end(arr));
+
+ static_assert(std::is_same_v<decltype(lst), std::list<int>>, "");
+ assert(std::equal(lst.begin(), lst.end(), std::begin(arr), std::end(arr)));
+ }
+
+ {
+ const long arr[] = {INT_MAX, 1L, 2L, 3L };
+ std::list lst(std::begin(arr), std::end(arr), std::allocator<long>());
+ static_assert(std::is_same_v<decltype(lst)::value_type, long>, "");
+ assert(lst.size() == 4);
+ auto it = lst.begin();
+ assert(*it++ == INT_MAX);
+ assert(*it++ == 1L);
+ assert(*it++ == 2L);
+ }
+
+// Test the implicit deduction guides
+
+ {
+// We don't expect this one to work.
+// std::list lst(std::allocator<int>()); // list (allocator &)
+ }
+
+ {
+ std::list lst(1, A{}); // list (size_type, T)
+ static_assert(std::is_same_v<decltype(lst)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(lst)::allocator_type, std::allocator<A>>, "");
+ assert(lst.size() == 1);
+ }
+
+ {
+ std::list lst(1, A{}, test_allocator<A>()); // list (size_type, T, allocator)
+ static_assert(std::is_same_v<decltype(lst)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(lst)::allocator_type, test_allocator<A>>, "");
+ assert(lst.size() == 1);
+ }
+
+ {
+ std::list lst{1U, 2U, 3U, 4U, 5U}; // list(initializer-list)
+ static_assert(std::is_same_v<decltype(lst)::value_type, unsigned>, "");
+ assert(lst.size() == 5);
+ auto it = lst.begin();
+ std::advance(it, 2);
+ assert(*it == 3U);
+ }
+
+ {
+ std::list lst({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // list(initializer-list, allocator)
+ static_assert(std::is_same_v<decltype(lst)::value_type, double>, "");
+ static_assert(std::is_same_v<decltype(lst)::allocator_type, test_allocator<double>>, "");
+ assert(lst.size() == 4);
+ auto it = lst.begin();
+ std::advance(it, 3);
+ assert(*it == 4.0);
+ }
+
+ {
+ std::list<long double> source;
+ std::list lst(source); // list(list &)
+ static_assert(std::is_same_v<decltype(lst)::value_type, long double>, "");
+ static_assert(std::is_same_v<decltype(lst)::allocator_type, std::allocator<long double>>, "");
+ assert(lst.size() == 0);
+ }
+}
diff --git a/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp b/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp
index 517eb62ccae2..33f2fab0d8a4 100644
--- a/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp
@@ -13,10 +13,29 @@
#include <list>
#include <functional>
+#include <algorithm> // for is_permutation
#include <cassert>
#include "min_allocator.h"
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+template <typename T>
+struct throwingLess {
+ throwingLess() : num_(1) {}
+ throwingLess(int num) : num_(num) {}
+
+ bool operator() (const T& lhs, const T& rhs) const
+ {
+ if ( --num_ == 0) throw 1;
+ return lhs < rhs;
+ }
+
+ mutable int num_;
+ };
+#endif
+
+
int main()
{
{
@@ -26,6 +45,28 @@ int main()
c1.sort(std::greater<int>());
assert(c1 == std::list<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
}
+
+// Test with throwing comparison; make sure that nothing is lost.
+// This is (sort of) LWG #2824
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ int a1[] = {4, 8, 1, 0, 5, 7, 2, 3, 6, 11, 10, 9};
+ const int sz = sizeof(a1)/sizeof(a1[0]);
+ for (int i = 0; i < 10; ++i)
+ {
+ std::list<int> c1(a1, a1 + sz);
+ try
+ {
+ throwingLess<int> comp(i);
+ c1.sort(std::cref(comp));
+ }
+ catch (int) {}
+ assert((c1.size() == sz));
+ assert((std::is_permutation(c1.begin(), c1.end(), a1)));
+ }
+ }
+#endif
+
#if TEST_STD_VER >= 11
{
int a1[] = {4, 8, 1, 0, 5, 7, 2, 3, 6, 11, 10, 9};
diff --git a/test/std/containers/sequences/vector.bool/move.pass.cpp b/test/std/containers/sequences/vector.bool/move.pass.cpp
index f189e2b97092..ab2b7ce6d316 100644
--- a/test/std/containers/sequences/vector.bool/move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move.pass.cpp
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -59,4 +60,34 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
+ {
+ test_alloc_base::clear();
+ using Vect = std::vector<bool, test_allocator<bool> >;
+ using AllocT = Vect::allocator_type;
+ Vect v(test_allocator<bool>(42, 101));
+ assert(test_alloc_base::count == 1);
+ {
+ const AllocT& a = v.get_allocator();
+ assert(test_alloc_base::count == 2);
+ assert(a.get_data() == 42);
+ assert(a.get_id() == 101);
+ }
+ assert(test_alloc_base::count == 1);
+ test_alloc_base::clear_ctor_counters();
+
+ Vect v2 = std::move(v);
+ assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::copied == 0);
+ assert(test_alloc_base::moved == 1);
+ {
+ const AllocT& a = v.get_allocator();
+ assert(a.get_id() == test_alloc_base::moved_value);
+ assert(a.get_data() == test_alloc_base::moved_value);
+ }
+ {
+ const AllocT& a = v2.get_allocator();
+ assert(a.get_id() == 101);
+ assert(a.get_data() == 42);
+ }
+ }
}
diff --git a/test/std/containers/sequences/vector/iterators.pass.cpp b/test/std/containers/sequences/vector/iterators.pass.cpp
index a1ce2be32718..33093e151aa2 100644
--- a/test/std/containers/sequences/vector/iterators.pass.cpp
+++ b/test/std/containers/sequences/vector/iterators.pass.cpp
@@ -77,6 +77,8 @@ int main()
typedef std::vector<T> C;
C::iterator i;
C::const_iterator j;
+ (void) i;
+ (void) j;
}
#if TEST_STD_VER >= 11
{
@@ -125,6 +127,8 @@ int main()
typedef std::vector<T, min_allocator<T>> C;
C::iterator i;
C::const_iterator j;
+ (void) i;
+ (void) j;
}
{
typedef A T;
diff --git a/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp b/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp
new file mode 100644
index 000000000000..d479800120fc
--- /dev/null
+++ b/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// vector(InputIterator, InputIterator, Allocator = Allocator())
+// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <deque>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+
+int main()
+{
+// Test the explicit deduction guides
+
+// Test the implicit deduction guides
+ {
+// vector (allocator &)
+ std::vector vec((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'vector'}}
+// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
+// Also, we can't use {} instead of parens, because that constructs a
+// deque<allocator<int>, allocator<allocator<int>>>
+ }
+
+}
diff --git a/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp b/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..175fede78193
--- /dev/null
+++ b/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
@@ -0,0 +1,116 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// deque(InputIterator, InputIterator, Allocator = Allocator())
+// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <vector>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+#include <climits> // INT_MAX
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+ const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ std::vector vec(std::begin(arr), std::end(arr));
+
+ static_assert(std::is_same_v<decltype(vec), std::vector<int>>, "");
+ assert(std::equal(vec.begin(), vec.end(), std::begin(arr), std::end(arr)));
+ }
+
+ {
+ const long arr[] = {INT_MAX, 1L, 2L, 3L };
+ std::vector vec(std::begin(arr), std::end(arr), std::allocator<long>());
+ static_assert(std::is_same_v<decltype(vec)::value_type, long>, "");
+ assert(vec.size() == 4);
+ assert(vec[0] == INT_MAX);
+ assert(vec[1] == 1L);
+ assert(vec[2] == 2L);
+ }
+
+// Test the implicit deduction guides
+
+ {
+// We don't expect this one to work.
+// std::vector vec(std::allocator<int>()); // vector (allocator &)
+ }
+
+ {
+ std::vector vec(1, A{}); // vector (size_type, T)
+ static_assert(std::is_same_v<decltype(vec)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<A>>, "");
+ assert(vec.size() == 1);
+ }
+
+ {
+ std::vector vec(1, A{}, test_allocator<A>()); // vector (size_type, T, allocator)
+ static_assert(std::is_same_v<decltype(vec)::value_type, A>, "");
+ static_assert(std::is_same_v<decltype(vec)::allocator_type, test_allocator<A>>, "");
+ assert(vec.size() == 1);
+ }
+
+ {
+ std::vector vec{1U, 2U, 3U, 4U, 5U}; // vector(initializer-list)
+ static_assert(std::is_same_v<decltype(vec)::value_type, unsigned>, "");
+ assert(vec.size() == 5);
+ assert(vec[2] == 3U);
+ }
+
+ {
+ std::vector vec({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // vector(initializer-list, allocator)
+ static_assert(std::is_same_v<decltype(vec)::value_type, double>, "");
+ static_assert(std::is_same_v<decltype(vec)::allocator_type, test_allocator<double>>, "");
+ assert(vec.size() == 4);
+ assert(vec[3] == 4.0);
+ }
+
+ {
+ std::vector<long double> source;
+ std::vector vec(source); // vector(vector &)
+ static_assert(std::is_same_v<decltype(vec)::value_type, long double>, "");
+ static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<long double>>, "");
+ assert(vec.size() == 0);
+ }
+
+
+// A couple of vector<bool> tests, too!
+ {
+ std::vector vec(3, true); // vector(initializer-list)
+ static_assert(std::is_same_v<decltype(vec)::value_type, bool>, "");
+ static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<bool>>, "");
+ assert(vec.size() == 3);
+ assert(vec[0] && vec[1] && vec[2]);
+ }
+
+ {
+ std::vector<bool> source;
+ std::vector vec(source); // vector(vector &)
+ static_assert(std::is_same_v<decltype(vec)::value_type, bool>, "");
+ static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<bool>>, "");
+ assert(vec.size() == 0);
+ }
+}
diff --git a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
index cd50d5432349..6938aa679eba 100644
--- a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
@@ -15,10 +15,13 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
+#include "verbose_assert.h"
int main()
{
@@ -98,4 +101,34 @@ int main()
assert(*j == 3);
assert(is_contiguous_container_asan_correct(c2));
}
+ {
+ test_alloc_base::clear();
+ using Vect = std::vector<int, test_allocator<int> >;
+ Vect v(test_allocator<int>(42, 101));
+ assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::copied == 1);
+ assert(test_alloc_base::moved == 0);
+ {
+ const test_allocator<int>& a = v.get_allocator();
+ assert(a.get_data() == 42);
+ assert(a.get_id() == 101);
+ }
+ assert(test_alloc_base::count == 1);
+ test_alloc_base::clear_ctor_counters();
+
+ Vect v2 = std::move(v);
+ assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::copied == 0);
+ assert(test_alloc_base::moved == 1);
+ {
+ const test_allocator<int>& a = v.get_allocator();
+ assert(a.get_id() == test_alloc_base::moved_value);
+ assert(a.get_data() == test_alloc_base::moved_value);
+ }
+ {
+ const test_allocator<int>& a = v2.get_allocator();
+ assert(a.get_id() == 101);
+ assert(a.get_data() == 42);
+ }
+ }
}
diff --git a/test/std/containers/test_compare.h b/test/std/containers/test_compare.h
index 35f4640f1cad..32d831d40f4a 100644
--- a/test/std/containers/test_compare.h
+++ b/test/std/containers/test_compare.h
@@ -37,8 +37,8 @@ public:
template <class C>
class non_const_compare
{
-// operator() deliberately not marked as 'const'
- bool operator()(const C& x,const C&y) { return x < y; }
+// operator() deliberately not marked as 'const'
+ bool operator()(const C& x, const C& y) { return x < y; }
};
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp
index fe2b24707fb3..a191ad7036cc 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp
@@ -37,28 +37,29 @@ void do_insert_cv_test()
assert(r.first->first == 2.5);
assert(r.first->second == 2);
- r = m.insert(VT(2.5, 3)); // test rvalue insertion works in C++03
+ const VT v2(2.5, 3);
+ r = m.insert(v2);
assert(!r.second);
assert(m.size() == 1);
assert(r.first->first == 2.5);
assert(r.first->second == 2);
- const VT v2(1.5, 1);
- r = m.insert(v2);
+ const VT v3(1.5, 1);
+ r = m.insert(v3);
assert(r.second);
assert(m.size() == 2);
assert(r.first->first == 1.5);
assert(r.first->second == 1);
- const VT v3(3.5, 3);
- r = m.insert(v3);
+ const VT v4(3.5, 3);
+ r = m.insert(v4);
assert(r.second);
assert(m.size() == 3);
assert(r.first->first == 3.5);
assert(r.first->second == 3);
- const VT v4(3.5, 4);
- r = m.insert(v4);
+ const VT v5(3.5, 4);
+ r = m.insert(v5);
assert(!r.second);
assert(m.size() == 3);
assert(r.first->first == 3.5);
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp
index d40a8a61a3d4..5c653ee8fb34 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp
@@ -24,61 +24,48 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_hint_const_lvalue_test()
{
- {
- typedef std::unordered_map<double, int> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
+ typedef Container C;
+ typedef typename C::iterator R;
+ typedef typename C::value_type VT;
+ C c;
+ typename C::const_iterator e = c.end();
+ const VT v1(3.5, 3);
+ R r = c.insert(e, v1);
+ assert(c.size() == 1);
+ assert(r->first == 3.5);
+ assert(r->second == 3);
- r = c.insert(c.end(), P(3.5, 4));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
+ const VT v2(3.5, 4);
+ r = c.insert(c.end(), v2);
+ assert(c.size() == 1);
+ assert(r->first == 3.5);
+ assert(r->second == 3);
- r = c.insert(c.end(), P(4.5, 4));
- assert(c.size() == 2);
- assert(r->first == 4.5);
- assert(r->second == 4);
+ const VT v3(4.5, 4);
+ r = c.insert(c.end(), v3);
+ assert(c.size() == 2);
+ assert(r->first == 4.5);
+ assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
- assert(c.size() == 3);
- assert(r->first == 5.5);
- assert(r->second == 4);
- }
+ const VT v4(5.5, 4);
+ r = c.insert(c.end(), v4);
+ assert(c.size() == 3);
+ assert(r->first == 5.5);
+ assert(r->second == 4);
+}
+
+int main()
+{
+ do_insert_hint_const_lvalue_test<std::unordered_map<double, int> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_map<double, int, std::hash<double>, std::equal_to<double>,
min_allocator<std::pair<const double, int>>> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
-
- r = c.insert(c.end(), P(3.5, 4));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
-
- r = c.insert(c.end(), P(4.5, 4));
- assert(c.size() == 2);
- assert(r->first == 4.5);
- assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
- assert(c.size() == 3);
- assert(r->first == 5.5);
- assert(r->second == 4);
+ do_insert_hint_const_lvalue_test<C>();
}
#endif
#if _LIBCPP_DEBUG >= 1
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp
index 320fbc8fe2ea..b87b7e372ff0 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp
@@ -20,59 +20,46 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_const_lvalue_test()
{
- {
- typedef std::unordered_multimap<double, int> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- R r = c.insert(P(3.5, 3));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
+ typedef Container C;
+ typedef typename C::iterator R;
+ typedef typename C::value_type VT;
+ C c;
+ const VT v1(3.5, 3);
+ R r = c.insert(v1);
+ assert(c.size() == 1);
+ assert(r->first == 3.5);
+ assert(r->second == 3);
- r = c.insert(P(3.5, 4));
- assert(c.size() == 2);
- assert(r->first == 3.5);
- assert(r->second == 4);
+ const VT v2(3.5, 4);
+ r = c.insert(v2);
+ assert(c.size() == 2);
+ assert(r->first == 3.5);
+ assert(r->second == 4);
- r = c.insert(P(4.5, 4));
- assert(c.size() == 3);
- assert(r->first == 4.5);
- assert(r->second == 4);
+ const VT v3(4.5, 4);
+ r = c.insert(v3);
+ assert(c.size() == 3);
+ assert(r->first == 4.5);
+ assert(r->second == 4);
- r = c.insert(P(5.5, 4));
- assert(c.size() == 4);
- assert(r->first == 5.5);
- assert(r->second == 4);
- }
+ const VT v4(5.5, 4);
+ r = c.insert(v4);
+ assert(c.size() == 4);
+ assert(r->first == 5.5);
+ assert(r->second == 4);
+}
+
+int main()
+{
+ do_insert_const_lvalue_test<std::unordered_multimap<double, int> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>,
min_allocator<std::pair<const double, int>>> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- R r = c.insert(P(3.5, 3));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
-
- r = c.insert(P(3.5, 4));
- assert(c.size() == 2);
- assert(r->first == 3.5);
- assert(r->second == 4);
-
- r = c.insert(P(4.5, 4));
- assert(c.size() == 3);
- assert(r->first == 4.5);
- assert(r->second == 4);
-
- r = c.insert(P(5.5, 4));
- assert(c.size() == 4);
- assert(r->first == 5.5);
- assert(r->second == 4);
+ do_insert_const_lvalue_test<C>();
}
#endif
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp
index c920ae93553f..34cb1b293c8e 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp
@@ -24,61 +24,47 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_const_lvalue_test()
{
- {
- typedef std::unordered_multimap<double, int> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
+ typedef Container C;
+ typedef typename C::iterator R;
+ typedef typename C::value_type VT;
+ C c;
+ typename C::const_iterator e = c.end();
+ const VT v1(3.5, 3);
+ R r = c.insert(e, v1);
+ assert(c.size() == 1);
+ assert(r->first == 3.5);
+ assert(r->second == 3);
- r = c.insert(c.end(), P(3.5, 4));
- assert(c.size() == 2);
- assert(r->first == 3.5);
- assert(r->second == 4);
+ const VT v2(3.5, 4);
+ r = c.insert(c.end(), v2);
+ assert(c.size() == 2);
+ assert(r->first == 3.5);
+ assert(r->second == 4);
- r = c.insert(c.end(), P(4.5, 4));
- assert(c.size() == 3);
- assert(r->first == 4.5);
- assert(r->second == 4);
+ const VT v3(4.5, 4);
+ r = c.insert(c.end(), v3);
+ assert(c.size() == 3);
+ assert(r->first == 4.5);
+ assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
- assert(c.size() == 4);
- assert(r->first == 5.5);
- assert(r->second == 4);
- }
+ const VT v4(5.5, 4);
+ r = c.insert(c.end(), v4);
+ assert(c.size() == 4);
+ assert(r->first == 5.5);
+ assert(r->second == 4);
+}
+
+int main()
+{
+ do_insert_const_lvalue_test<std::unordered_multimap<double, int> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>,
min_allocator<std::pair<const double, int>>> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
- assert(c.size() == 1);
- assert(r->first == 3.5);
- assert(r->second == 3);
-
- r = c.insert(c.end(), P(3.5, 4));
- assert(c.size() == 2);
- assert(r->first == 3.5);
- assert(r->second == 4);
-
- r = c.insert(c.end(), P(4.5, 4));
- assert(c.size() == 3);
- assert(r->first == 4.5);
- assert(r->second == 4);
-
- r = c.insert(c.end(), P(5.5, 4));
- assert(c.size() == 4);
- assert(r->first == 5.5);
- assert(r->second == 4);
+ do_insert_const_lvalue_test<C>();
}
#endif
#if _LIBCPP_DEBUG >= 1
diff --git a/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp
index 946858ea53dc..414e8fa48781 100644
--- a/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp
@@ -20,51 +20,41 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_const_lvalue_test()
{
- {
- typedef std::unordered_multiset<double> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- R r = c.insert(P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
-
- r = c.insert(P(3.5));
- assert(c.size() == 2);
- assert(*r == 3.5);
-
- r = c.insert(P(4.5));
- assert(c.size() == 3);
- assert(*r == 4.5);
+ typedef Container C;
+ typedef typename C::iterator R;
+ typedef typename C::value_type VT;
+ C c;
+ const VT v1(3.5);
+ R r = c.insert(v1);
+ assert(c.size() == 1);
+ assert(*r == 3.5);
+
+ r = c.insert(v1);
+ assert(c.size() == 2);
+ assert(*r == 3.5);
+
+ const VT v2(4.5);
+ r = c.insert(v2);
+ assert(c.size() == 3);
+ assert(*r == 4.5);
+
+ const VT v3(5.5);
+ r = c.insert(v3);
+ assert(c.size() == 4);
+ assert(*r == 5.5);
+}
- r = c.insert(P(5.5));
- assert(c.size() == 4);
- assert(*r == 5.5);
- }
+int main()
+{
+ do_insert_const_lvalue_test<std::unordered_multiset<double> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<double, std::hash<double>,
- std::equal_to<double>, min_allocator<double>> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- R r = c.insert(P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
-
- r = c.insert(P(3.5));
- assert(c.size() == 2);
- assert(*r == 3.5);
-
- r = c.insert(P(4.5));
- assert(c.size() == 3);
- assert(*r == 4.5);
-
- r = c.insert(P(5.5));
- assert(c.size() == 4);
- assert(*r == 5.5);
+ std::equal_to<double>, min_allocator<double>> C;
+ do_insert_const_lvalue_test<C>();
}
#endif
}
diff --git a/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp
index a6ab26659b55..8ce6a5efbc1e 100644
--- a/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp
@@ -24,53 +24,42 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_hint_const_lvalue_test()
{
- {
- typedef std::unordered_multiset<double> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
+ typedef Container C;
+ typedef typename C::iterator R;
+ typedef typename C::value_type VT;
+ C c;
+ typename C::const_iterator e = c.end();
+ const VT v1(3.5);
+ R r = c.insert(e, v1);
+ assert(c.size() == 1);
+ assert(*r == 3.5);
- r = c.insert(c.end(), P(3.5));
- assert(c.size() == 2);
- assert(*r == 3.5);
+ r = c.insert(c.end(), v1);
+ assert(c.size() == 2);
+ assert(*r == 3.5);
- r = c.insert(c.end(), P(4.5));
- assert(c.size() == 3);
- assert(*r == 4.5);
+ const VT v2(4.5);
+ r = c.insert(c.end(), v2);
+ assert(c.size() == 3);
+ assert(*r == 4.5);
- r = c.insert(c.end(), P(5.5));
- assert(c.size() == 4);
- assert(*r == 5.5);
- }
+ const VT v3(5.5);
+ r = c.insert(c.end(), v3);
+ assert(c.size() == 4);
+ assert(*r == 5.5);
+}
+
+int main()
+{
+ do_insert_hint_const_lvalue_test<std::unordered_multiset<double> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<double, std::hash<double>,
- std::equal_to<double>, min_allocator<double>> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
-
- r = c.insert(c.end(), P(3.5));
- assert(c.size() == 2);
- assert(*r == 3.5);
-
- r = c.insert(c.end(), P(4.5));
- assert(c.size() == 3);
- assert(*r == 4.5);
-
- r = c.insert(c.end(), P(5.5));
- assert(c.size() == 4);
- assert(*r == 5.5);
+ std::equal_to<double>, min_allocator<double>> C;
+ do_insert_hint_const_lvalue_test<C>();
}
#endif
#if _LIBCPP_DEBUG >= 1
diff --git a/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp
index fe45b98a33a6..712176ede592 100644
--- a/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp
@@ -20,59 +20,45 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_const_lvalue_test()
{
- {
- typedef std::unordered_set<double> C;
- typedef std::pair<C::iterator, bool> R;
- typedef C::value_type P;
- C c;
- R r = c.insert(P(3.5));
- assert(c.size() == 1);
- assert(*r.first == 3.5);
- assert(r.second);
+ typedef Container C;
+ typedef std::pair<typename C::iterator, bool> R;
+ typedef typename C::value_type VT;
+ C c;
+ const VT v1(3.5);
+ R r = c.insert(v1);
+ assert(c.size() == 1);
+ assert(*r.first == 3.5);
+ assert(r.second);
- r = c.insert(P(3.5));
- assert(c.size() == 1);
- assert(*r.first == 3.5);
- assert(!r.second);
+ r = c.insert(v1);
+ assert(c.size() == 1);
+ assert(*r.first == 3.5);
+ assert(!r.second);
- r = c.insert(P(4.5));
- assert(c.size() == 2);
- assert(*r.first == 4.5);
- assert(r.second);
+ const VT v2(4.5);
+ r = c.insert(v2);
+ assert(c.size() == 2);
+ assert(*r.first == 4.5);
+ assert(r.second);
- r = c.insert(P(5.5));
- assert(c.size() == 3);
- assert(*r.first == 5.5);
- assert(r.second);
- }
+ const VT v3(5.5);
+ r = c.insert(v3);
+ assert(c.size() == 3);
+ assert(*r.first == 5.5);
+ assert(r.second);
+}
+
+int main()
+{
+ do_insert_const_lvalue_test<std::unordered_set<double> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_set<double, std::hash<double>,
std::equal_to<double>, min_allocator<double>> C;
- typedef std::pair<C::iterator, bool> R;
- typedef C::value_type P;
- C c;
- R r = c.insert(P(3.5));
- assert(c.size() == 1);
- assert(*r.first == 3.5);
- assert(r.second);
-
- r = c.insert(P(3.5));
- assert(c.size() == 1);
- assert(*r.first == 3.5);
- assert(!r.second);
-
- r = c.insert(P(4.5));
- assert(c.size() == 2);
- assert(*r.first == 4.5);
- assert(r.second);
-
- r = c.insert(P(5.5));
- assert(c.size() == 3);
- assert(*r.first == 5.5);
- assert(r.second);
+ do_insert_const_lvalue_test<C>();
}
#endif
}
diff --git a/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp
index d3bbecc95ad7..50f0f6bc8477 100644
--- a/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp
@@ -24,53 +24,42 @@
#include "min_allocator.h"
-int main()
+template<class Container>
+void do_insert_hint_const_lvalue_test()
{
- {
- typedef std::unordered_set<double> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
+ typedef Container C;
+ typedef typename C::iterator R;
+ typedef typename C::value_type VT;
+ C c;
+ typename C::const_iterator e = c.end();
+ const VT v1(3.5);
+ R r = c.insert(e, v1);
+ assert(c.size() == 1);
+ assert(*r == 3.5);
- r = c.insert(e, P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
+ r = c.insert(e, v1);
+ assert(c.size() == 1);
+ assert(*r == 3.5);
- r = c.insert(e, P(4.5));
- assert(c.size() == 2);
- assert(*r == 4.5);
+ const VT v2(4.5);
+ r = c.insert(e, v2);
+ assert(c.size() == 2);
+ assert(*r == 4.5);
- r = c.insert(e, P(5.5));
- assert(c.size() == 3);
- assert(*r == 5.5);
- }
+ const VT v3(5.5);
+ r = c.insert(e, v3);
+ assert(c.size() == 3);
+ assert(*r == 5.5);
+}
+
+int main()
+{
+ do_insert_hint_const_lvalue_test<std::unordered_set<double> >();
#if TEST_STD_VER >= 11
{
typedef std::unordered_set<double, std::hash<double>,
std::equal_to<double>, min_allocator<double>> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
-
- r = c.insert(e, P(3.5));
- assert(c.size() == 1);
- assert(*r == 3.5);
-
- r = c.insert(e, P(4.5));
- assert(c.size() == 2);
- assert(*r == 4.5);
-
- r = c.insert(e, P(5.5));
- assert(c.size() == 3);
- assert(*r == 5.5);
+ do_insert_hint_const_lvalue_test<C>();
}
#endif
#if _LIBCPP_DEBUG >= 1
diff --git a/test/std/containers/views/span.comparison/op.eq.pass.cpp b/test/std/containers/views/span.comparison/op.eq.pass.cpp
new file mode 100644
index 000000000000..963054580466
--- /dev/null
+++ b/test/std/containers/views/span.comparison/op.eq.pass.cpp
@@ -0,0 +1,168 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
+// constexpr bool operator==(span<T, X> l, span<U, Y> r);
+//
+//
+// Effects: Equivalent to: return equal(l.begin(), l.end(), r.begin(), r.end());
+//
+
+#include <span>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+ int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+ float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+
+
+int main () {
+
+ constexpr std::span<const int> csp0d{};
+ constexpr std::span<const int> csp1d{iArr1, 10};
+ constexpr std::span<const int> csp2d{iArr1 + 3, 2};
+ constexpr std::span<const int> csp3d{iArr1 + 1, 2};
+ constexpr std::span<const int> csp4d{iArr1 + 6, 2};
+
+ constexpr std::span<const int, 0> csp0s{};
+ constexpr std::span<const int, 10> csp1s{iArr1, 10};
+ constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2};
+ constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2};
+ constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2};
+
+ static_assert( (csp0d == csp0d), "");
+ static_assert( (csp0s == csp0s), "");
+ static_assert( (csp0s == csp0d), "");
+ static_assert( (csp0d == csp0s), "");
+
+ static_assert(!(csp0d == csp1d), "");
+ static_assert(!(csp0s == csp1s), "");
+ static_assert(!(csp0s == csp1d), "");
+ static_assert(!(csp0d == csp1s), "");
+
+ static_assert( (csp1d == csp1s), "");
+ static_assert( (csp1s == csp1d), "");
+
+ static_assert( (csp2d == csp3d), "");
+ static_assert( (csp2s == csp3s), "");
+ static_assert( (csp2d == csp3s), "");
+ static_assert( (csp2s == csp3d), "");
+
+ static_assert( (csp2d == csp3d), "");
+ static_assert( (csp2s == csp3s), "");
+ static_assert( (csp2d == csp3s), "");
+ static_assert( (csp2s == csp3d), "");
+
+ static_assert(!(csp2d == csp4d), "");
+ static_assert(!(csp2s == csp4s), "");
+ static_assert(!(csp2d == csp4s), "");
+ static_assert(!(csp2s == csp4d), "");
+
+ static_assert(!(csp4d == csp2d), "");
+ static_assert(!(csp4s == csp2s), "");
+ static_assert(!(csp4d == csp2s), "");
+ static_assert(!(csp4s == csp2d), "");
+
+ std::span<int> sp0d{};
+ std::span<int> sp1d{iArr2, 10};
+ std::span<int> sp2d{iArr2 + 3, 2};
+ std::span<int> sp3d{iArr2 + 1, 2};
+ std::span<int> sp4d{iArr2 + 6, 2};
+
+ std::span<int, 0> sp0s{};
+ std::span<int, 10> sp1s{iArr2, 10};
+ std::span<int, 2> sp2s{iArr2 + 3, 2};
+ std::span<int, 2> sp3s{iArr2 + 1, 2};
+ std::span<int, 2> sp4s{iArr2 + 6, 2};
+
+ assert( (sp0d == sp0d));
+ assert( (sp0s == sp0s));
+ assert( (sp0s == sp0d));
+ assert( (sp0d == sp0s));
+
+ assert(!(sp0d == sp1d));
+ assert(!(sp0s == sp1s));
+ assert(!(sp0s == sp1d));
+ assert(!(sp0d == sp1s));
+
+ assert( (sp1d == sp1s));
+ assert( (sp1s == sp1d));
+
+ assert( (sp2d == sp3d));
+ assert( (sp2s == sp3s));
+ assert( (sp2d == sp3s));
+ assert( (sp2s == sp3d));
+
+ assert( (sp2d == sp3d));
+ assert( (sp2s == sp3s));
+ assert( (sp2d == sp3s));
+ assert( (sp2s == sp3d));
+
+ assert(!(sp2d == sp4d));
+ assert(!(sp2s == sp4s));
+ assert(!(sp2d == sp4s));
+ assert(!(sp2s == sp4d));
+
+ assert(!(sp4d == sp2d));
+ assert(!(sp4s == sp2s));
+ assert(!(sp4d == sp2s));
+ assert(!(sp4s == sp2d));
+
+// cross type comparisons
+ assert( (csp0d == sp0d));
+ assert( (csp0s == sp0s));
+ assert( (csp0s == sp0d));
+ assert( (csp0d == sp0s));
+
+ assert(!(csp0d == sp1d));
+ assert(!(csp0s == sp1s));
+ assert(!(csp0s == sp1d));
+ assert(!(csp0d == sp1s));
+
+ assert( (csp1d == sp1s));
+ assert( (csp1s == sp1d));
+
+ assert( (csp2d == sp3d));
+ assert( (csp2s == sp3s));
+ assert( (csp2d == sp3s));
+ assert( (csp2s == sp3d));
+
+ assert( (csp2d == sp3d));
+ assert( (csp2s == sp3s));
+ assert( (csp2d == sp3s));
+ assert( (csp2s == sp3d));
+
+ assert(!(csp2d == sp4d));
+ assert(!(csp2s == sp4s));
+ assert(!(csp2d == sp4s));
+ assert(!(csp2s == sp4d));
+
+ assert(!(csp4d == sp2d));
+ assert(!(csp4s == sp2s));
+ assert(!(csp4d == sp2s));
+ assert(!(csp4s == sp2d));
+
+// More cross-type comparisons (int vs float)
+ static_assert(std::span<const float>{fArr1} == std::span<const int>{iArr1}, "");
+ static_assert(std::span<const int>{iArr1} == std::span<const float>{fArr1}, "");
+ assert(std::span<float>{fArr2} == std::span<int>{iArr2});
+ assert(std::span<int>{iArr2} == std::span<float>{fArr2});
+
+ static_assert(!(std::span<const int>{iArr1, 9} == std::span<const float>{fArr1, 8}), "");
+} \ No newline at end of file
diff --git a/test/std/containers/views/span.comparison/op.ge.pass.cpp b/test/std/containers/views/span.comparison/op.ge.pass.cpp
new file mode 100644
index 000000000000..8ec1b9a590eb
--- /dev/null
+++ b/test/std/containers/views/span.comparison/op.ge.pass.cpp
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
+// constexpr bool operator>=(span<T, X> l, span<U, Y> r);
+//
+//
+// Effects: Equivalent to: return !(l < r);
+//
+
+#include <span>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+ int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+ float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+
+
+int main () {
+
+ constexpr std::span<const int> csp0d{};
+ constexpr std::span<const int> csp1d{iArr1, 10};
+ constexpr std::span<const int> csp2d{iArr1 + 3, 2};
+ constexpr std::span<const int> csp3d{iArr1 + 1, 2};
+ constexpr std::span<const int> csp4d{iArr1 + 6, 2};
+
+ constexpr std::span<const int, 0> csp0s{};
+ constexpr std::span<const int, 10> csp1s{iArr1, 10};
+ constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2};
+ constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2};
+ constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2};
+
+ static_assert( (csp0d >= csp0d), "");
+ static_assert( (csp0s >= csp0s), "");
+ static_assert( (csp0s >= csp0d), "");
+ static_assert( (csp0d >= csp0s), "");
+
+ static_assert(!(csp0d >= csp1d), "");
+ static_assert(!(csp0s >= csp1s), "");
+ static_assert(!(csp0s >= csp1d), "");
+ static_assert(!(csp0d >= csp1s), "");
+
+ static_assert( (csp1d >= csp1s), "");
+ static_assert( (csp1s >= csp1d), "");
+
+ static_assert( (csp2d >= csp3d), "");
+ static_assert( (csp2s >= csp3s), "");
+ static_assert( (csp2d >= csp3s), "");
+ static_assert( (csp2s >= csp3d), "");
+
+ static_assert(!(csp2d >= csp4d), "");
+ static_assert(!(csp2s >= csp4s), "");
+ static_assert(!(csp2d >= csp4s), "");
+ static_assert(!(csp2s >= csp4d), "");
+
+ static_assert( (csp4d >= csp2d), "");
+ static_assert( (csp4s >= csp2s), "");
+ static_assert( (csp4d >= csp2s), "");
+ static_assert( (csp4s >= csp2d), "");
+
+ std::span<int> sp0d{};
+ std::span<int> sp1d{iArr2, 10};
+ std::span<int> sp2d{iArr2 + 3, 2};
+ std::span<int> sp3d{iArr2 + 1, 2};
+ std::span<int> sp4d{iArr2 + 6, 2};
+
+ std::span<int, 0> sp0s{};
+ std::span<int, 10> sp1s{iArr2, 10};
+ std::span<int, 2> sp2s{iArr2 + 3, 2};
+ std::span<int, 2> sp3s{iArr2 + 1, 2};
+ std::span<int, 2> sp4s{iArr2 + 6, 2};
+
+ assert( (sp0d >= sp0d));
+ assert( (sp0s >= sp0s));
+ assert( (sp0s >= sp0d));
+ assert( (sp0d >= sp0s));
+
+ assert(!(sp0d >= sp1d));
+ assert(!(sp0s >= sp1s));
+ assert(!(sp0s >= sp1d));
+ assert(!(sp0d >= sp1s));
+
+ assert( (sp1d >= sp1s));
+ assert( (sp1s >= sp1d));
+
+ assert( (sp2d >= sp3d));
+ assert( (sp2s >= sp3s));
+ assert( (sp2d >= sp3s));
+ assert( (sp2s >= sp3d));
+
+ assert(!(sp2d >= sp4d));
+ assert(!(sp2s >= sp4s));
+ assert(!(sp2d >= sp4s));
+ assert(!(sp2s >= sp4d));
+
+ assert( (sp4d > sp2d));
+ assert( (sp4s > sp2s));
+ assert( (sp4d > sp2s));
+ assert( (sp4s > sp2d));
+
+// cross type comparisons
+ assert( (csp0d >= sp0d));
+ assert( (csp0s >= sp0s));
+ assert( (csp0s >= sp0d));
+ assert( (csp0d >= sp0s));
+
+ assert(!(csp0d >= sp1d));
+ assert(!(csp0s >= sp1s));
+ assert(!(csp0s >= sp1d));
+ assert(!(csp0d >= sp1s));
+
+ assert( (csp1d >= sp1s));
+ assert( (csp1s >= sp1d));
+
+ assert( (csp2d >= sp3d));
+ assert( (csp2s >= sp3s));
+ assert( (csp2d >= sp3s));
+ assert( (csp2s >= sp3d));
+
+ assert(!(csp2d >= sp4d));
+ assert(!(csp2s >= sp4s));
+ assert(!(csp2d >= sp4s));
+ assert(!(csp2s >= sp4d));
+
+ assert( (csp4d > sp2d));
+ assert( (csp4s > sp2s));
+ assert( (csp4d > sp2s));
+ assert( (csp4s > sp2d));
+
+// More cross-type comparisons (int vs float)
+ static_assert(!(std::span<const float>{fArr1, 8} >= std::span<const int>{iArr1, 9}), "");
+ static_assert(!(std::span<const int>{iArr1, 8} >= std::span<const float>{fArr1, 9}), "");
+ assert( (std::span<float>{fArr2} >= std::span<int>{iArr2}));
+ assert( (std::span<int>{iArr2} >= std::span<float>{fArr2}));
+
+ static_assert( (std::span<const int>{iArr1, 9} >= std::span<const float>{fArr1, 8}), "");
+}
diff --git a/test/std/containers/views/span.comparison/op.gt.pass.cpp b/test/std/containers/views/span.comparison/op.gt.pass.cpp
new file mode 100644
index 000000000000..345a291a62b3
--- /dev/null
+++ b/test/std/containers/views/span.comparison/op.gt.pass.cpp
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
+// constexpr bool operator>(span<T, X> l, span<U, Y> r);
+//
+//
+// Effects: Equivalent to: return (r < l);
+//
+
+#include <span>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+ int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+ float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+
+
+int main () {
+
+ constexpr std::span<const int> csp0d{};
+ constexpr std::span<const int> csp1d{iArr1, 10};
+ constexpr std::span<const int> csp2d{iArr1 + 3, 2};
+ constexpr std::span<const int> csp3d{iArr1 + 1, 2};
+ constexpr std::span<const int> csp4d{iArr1 + 6, 2};
+
+ constexpr std::span<const int, 0> csp0s{};
+ constexpr std::span<const int, 10> csp1s{iArr1, 10};
+ constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2};
+ constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2};
+ constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2};
+
+ static_assert(!(csp0d > csp0d), "");
+ static_assert(!(csp0s > csp0s), "");
+ static_assert(!(csp0s > csp0d), "");
+ static_assert(!(csp0d > csp0s), "");
+
+ static_assert(!(csp0d > csp1d), "");
+ static_assert(!(csp0s > csp1s), "");
+ static_assert(!(csp0s > csp1d), "");
+ static_assert(!(csp0d > csp1s), "");
+
+ static_assert(!(csp1d > csp1s), "");
+ static_assert(!(csp1s > csp1d), "");
+
+ static_assert(!(csp2d > csp3d), "");
+ static_assert(!(csp2s > csp3s), "");
+ static_assert(!(csp2d > csp3s), "");
+ static_assert(!(csp2s > csp3d), "");
+
+ static_assert(!(csp2d > csp4d), "");
+ static_assert(!(csp2s > csp4s), "");
+ static_assert(!(csp2d > csp4s), "");
+ static_assert(!(csp2s > csp4d), "");
+
+ static_assert( (csp4d > csp2d), "");
+ static_assert( (csp4s > csp2s), "");
+ static_assert( (csp4d > csp2s), "");
+ static_assert( (csp4s > csp2d), "");
+
+ std::span<int> sp0d{};
+ std::span<int> sp1d{iArr2, 10};
+ std::span<int> sp2d{iArr2 + 3, 2};
+ std::span<int> sp3d{iArr2 + 1, 2};
+ std::span<int> sp4d{iArr2 + 6, 2};
+
+ std::span<int, 0> sp0s{};
+ std::span<int, 10> sp1s{iArr2, 10};
+ std::span<int, 2> sp2s{iArr2 + 3, 2};
+ std::span<int, 2> sp3s{iArr2 + 1, 2};
+ std::span<int, 2> sp4s{iArr2 + 6, 2};
+
+ assert(!(sp0d > sp0d));
+ assert(!(sp0s > sp0s));
+ assert(!(sp0s > sp0d));
+ assert(!(sp0d > sp0s));
+
+ assert(!(sp0d > sp1d));
+ assert(!(sp0s > sp1s));
+ assert(!(sp0s > sp1d));
+ assert(!(sp0d > sp1s));
+
+ assert(!(sp1d > sp1s));
+ assert(!(sp1s > sp1d));
+
+ assert(!(sp2d > sp3d));
+ assert(!(sp2s > sp3s));
+ assert(!(sp2d > sp3s));
+ assert(!(sp2s > sp3d));
+
+ assert(!(sp2d > sp4d));
+ assert(!(sp2s > sp4s));
+ assert(!(sp2d > sp4s));
+ assert(!(sp2s > sp4d));
+
+ assert( (sp4d > sp2d));
+ assert( (sp4s > sp2s));
+ assert( (sp4d > sp2s));
+ assert( (sp4s > sp2d));
+
+// cross type comparisons
+ assert(!(csp0d > sp0d));
+ assert(!(csp0s > sp0s));
+ assert(!(csp0s > sp0d));
+ assert(!(csp0d > sp0s));
+
+ assert(!(csp0d > sp1d));
+ assert(!(csp0s > sp1s));
+ assert(!(csp0s > sp1d));
+ assert(!(csp0d > sp1s));
+
+ assert(!(csp1d > sp1s));
+ assert(!(csp1s > sp1d));
+
+ assert(!(csp2d > sp3d));
+ assert(!(csp2s > sp3s));
+ assert(!(csp2d > sp3s));
+ assert(!(csp2s > sp3d));
+
+ assert(!(csp2d > sp4d));
+ assert(!(csp2s > sp4s));
+ assert(!(csp2d > sp4s));
+ assert(!(csp2s > sp4d));
+
+ assert( (csp4d > sp2d));
+ assert( (csp4s > sp2s));
+ assert( (csp4d > sp2s));
+ assert( (csp4s > sp2d));
+
+
+// More cross-type comparisons (int vs float)
+ static_assert(!(std::span<const float>{fArr1, 8} > std::span<const int>{iArr1, 9}), "");
+ static_assert(!(std::span<const int>{iArr1, 8} > std::span<const float>{fArr1, 9}), "");
+ assert(!(std::span<float>{fArr2} > std::span<int>{iArr2}));
+ assert(!(std::span<int>{iArr2} > std::span<float>{fArr2}));
+
+ static_assert( (std::span<const int>{iArr1, 9} > std::span<const float>{fArr1, 8}), "");
+} \ No newline at end of file
diff --git a/test/std/containers/views/span.comparison/op.le.pass.cpp b/test/std/containers/views/span.comparison/op.le.pass.cpp
new file mode 100644
index 000000000000..f2fbc8609082
--- /dev/null
+++ b/test/std/containers/views/span.comparison/op.le.pass.cpp
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
+// constexpr bool operator<=(span<T, X> l, span<U, Y> r);
+//
+//
+// Effects: Equivalent to: return !(r < l);
+//
+
+#include <span>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+ int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+ float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+
+
+int main () {
+
+ constexpr std::span<const int> csp0d{};
+ constexpr std::span<const int> csp1d{iArr1, 10};
+ constexpr std::span<const int> csp2d{iArr1 + 3, 2};
+ constexpr std::span<const int> csp3d{iArr1 + 1, 2};
+ constexpr std::span<const int> csp4d{iArr1 + 6, 2};
+
+ constexpr std::span<const int, 0> csp0s{};
+ constexpr std::span<const int, 10> csp1s{iArr1, 10};
+ constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2};
+ constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2};
+ constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2};
+
+ static_assert( (csp0d <= csp0d), "");
+ static_assert( (csp0s <= csp0s), "");
+ static_assert( (csp0s <= csp0d), "");
+ static_assert( (csp0d <= csp0s), "");
+
+ static_assert( (csp0d <= csp1d), "");
+ static_assert( (csp0s <= csp1s), "");
+ static_assert( (csp0s <= csp1d), "");
+ static_assert( (csp0d <= csp1s), "");
+
+ static_assert( (csp1d <= csp1s), "");
+ static_assert( (csp1s <= csp1d), "");
+
+ static_assert( (csp2d <= csp3d), "");
+ static_assert( (csp2s <= csp3s), "");
+ static_assert( (csp2d <= csp3s), "");
+ static_assert( (csp2s <= csp3d), "");
+
+ static_assert( (csp2d <= csp4d), "");
+ static_assert( (csp2s <= csp4s), "");
+ static_assert( (csp2d <= csp4s), "");
+ static_assert( (csp2s <= csp4d), "");
+
+ static_assert(!(csp4d <= csp2d), "");
+ static_assert(!(csp4s <= csp2s), "");
+ static_assert(!(csp4d <= csp2s), "");
+ static_assert(!(csp4s <= csp2d), "");
+
+ std::span<int> sp0d{};
+ std::span<int> sp1d{iArr2, 10};
+ std::span<int> sp2d{iArr2 + 3, 2};
+ std::span<int> sp3d{iArr2 + 1, 2};
+ std::span<int> sp4d{iArr2 + 6, 2};
+
+ std::span<int, 0> sp0s{};
+ std::span<int, 10> sp1s{iArr2, 10};
+ std::span<int, 2> sp2s{iArr2 + 3, 2};
+ std::span<int, 2> sp3s{iArr2 + 1, 2};
+ std::span<int, 2> sp4s{iArr2 + 6, 2};
+
+ assert( (sp0d <= sp0d));
+ assert( (sp0s <= sp0s));
+ assert( (sp0s <= sp0d));
+ assert( (sp0d <= sp0s));
+
+ assert( (sp0d <= sp1d));
+ assert( (sp0s <= sp1s));
+ assert( (sp0s <= sp1d));
+ assert( (sp0d <= sp1s));
+
+ assert( (sp1d <= sp1s));
+ assert( (sp1s <= sp1d));
+
+ assert( (sp2d <= sp3d));
+ assert( (sp2s <= sp3s));
+ assert( (sp2d <= sp3s));
+ assert( (sp2s <= sp3d));
+
+ assert( (sp2d <= sp4d));
+ assert( (sp2s <= sp4s));
+ assert( (sp2d <= sp4s));
+ assert( (sp2s <= sp4d));
+
+ assert(!(sp4d <= sp2d));
+ assert(!(sp4s <= sp2s));
+ assert(!(sp4d <= sp2s));
+ assert(!(sp4s <= sp2d));
+
+// cross type comparisons
+ assert( (csp0d <= sp0d));
+ assert( (csp0s <= sp0s));
+ assert( (csp0s <= sp0d));
+ assert( (csp0d <= sp0s));
+
+ assert( (csp0d <= sp1d));
+ assert( (csp0s <= sp1s));
+ assert( (csp0s <= sp1d));
+ assert( (csp0d <= sp1s));
+
+ assert( (csp1d <= sp1s));
+ assert( (csp1s <= sp1d));
+
+ assert( (csp2d <= sp3d));
+ assert( (csp2s <= sp3s));
+ assert( (csp2d <= sp3s));
+ assert( (csp2s <= sp3d));
+
+ assert( (csp2d <= sp4d));
+ assert( (csp2s <= sp4s));
+ assert( (csp2d <= sp4s));
+ assert( (csp2s <= sp4d));
+
+ assert(!(csp4d <= sp2d));
+ assert(!(csp4s <= sp2s));
+ assert(!(csp4d <= sp2s));
+ assert(!(csp4s <= sp2d));
+
+// More cross-type comparisons (int vs float)
+ static_assert(std::span<const float>{fArr1, 8} <= std::span<const int>{iArr1, 9}, "");
+ static_assert(std::span<const int>{iArr1, 8} <= std::span<const float>{fArr1, 9}, "");
+ assert( (std::span<float>{fArr2} <= std::span<int>{iArr2}));
+ assert( (std::span<int>{iArr2} <= std::span<float>{fArr2}));
+
+ static_assert(!(std::span<const int>{iArr1, 9} <= std::span<const float>{fArr1, 8}), "");
+} \ No newline at end of file
diff --git a/test/std/containers/views/span.comparison/op.lt.pass.cpp b/test/std/containers/views/span.comparison/op.lt.pass.cpp
new file mode 100644
index 000000000000..1a7de292e901
--- /dev/null
+++ b/test/std/containers/views/span.comparison/op.lt.pass.cpp
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
+// constexpr bool operator<(span<T, X> l, span<U, Y> r);
+//
+//
+// Effects: Equivalent to:
+// return lexicographical_compare(l.begin(), l.end(), r.begin(), r.end());
+//
+
+#include <span>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+ int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+ float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+
+
+int main () {
+
+ constexpr std::span<const int> csp0d{};
+ constexpr std::span<const int> csp1d{iArr1, 10};
+ constexpr std::span<const int> csp2d{iArr1 + 3, 2};
+ constexpr std::span<const int> csp3d{iArr1 + 1, 2};
+ constexpr std::span<const int> csp4d{iArr1 + 6, 2};
+
+ constexpr std::span<const int, 0> csp0s{};
+ constexpr std::span<const int, 10> csp1s{iArr1, 10};
+ constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2};
+ constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2};
+ constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2};
+
+ static_assert(!(csp0d < csp0d), "");
+ static_assert(!(csp0s < csp0s), "");
+ static_assert(!(csp0s < csp0d), "");
+ static_assert(!(csp0d < csp0s), "");
+
+ static_assert( (csp0d < csp1d), "");
+ static_assert( (csp0s < csp1s), "");
+ static_assert( (csp0s < csp1d), "");
+ static_assert( (csp0d < csp1s), "");
+
+ static_assert(!(csp1d < csp1s), "");
+ static_assert(!(csp1s < csp1d), "");
+
+ static_assert(!(csp2d < csp3d), "");
+ static_assert(!(csp2s < csp3s), "");
+ static_assert(!(csp2d < csp3s), "");
+ static_assert(!(csp2s < csp3d), "");
+
+ static_assert( (csp2d < csp4d), "");
+ static_assert( (csp2s < csp4s), "");
+ static_assert( (csp2d < csp4s), "");
+ static_assert( (csp2s < csp4d), "");
+
+ static_assert(!(csp4d < csp2d), "");
+ static_assert(!(csp4s < csp2s), "");
+ static_assert(!(csp4d < csp2s), "");
+ static_assert(!(csp4s < csp2d), "");
+
+ std::span<int> sp0d{};
+ std::span<int> sp1d{iArr2, 10};
+ std::span<int> sp2d{iArr2 + 3, 2};
+ std::span<int> sp3d{iArr2 + 1, 2};
+ std::span<int> sp4d{iArr2 + 6, 2};
+
+ std::span<int, 0> sp0s{};
+ std::span<int, 10> sp1s{iArr2, 10};
+ std::span<int, 2> sp2s{iArr2 + 3, 2};
+ std::span<int, 2> sp3s{iArr2 + 1, 2};
+ std::span<int, 2> sp4s{iArr2 + 6, 2};
+
+ assert(!(sp0d < sp0d));
+ assert(!(sp0s < sp0s));
+ assert(!(sp0s < sp0d));
+ assert(!(sp0d < sp0s));
+
+ assert( (sp0d < sp1d));
+ assert( (sp0s < sp1s));
+ assert( (sp0s < sp1d));
+ assert( (sp0d < sp1s));
+
+ assert(!(sp1d < sp1s));
+ assert(!(sp1s < sp1d));
+
+ assert(!(sp2d < sp3d));
+ assert(!(sp2s < sp3s));
+ assert(!(sp2d < sp3s));
+ assert(!(sp2s < sp3d));
+
+ assert( (sp2d < sp4d));
+ assert( (sp2s < sp4s));
+ assert( (sp2d < sp4s));
+ assert( (sp2s < sp4d));
+
+ assert(!(sp4d < sp2d));
+ assert(!(sp4s < sp2s));
+ assert(!(sp4d < sp2s));
+ assert(!(sp4s < sp2d));
+
+// cross type comparisons
+ assert(!(csp0d < sp0d));
+ assert(!(csp0s < sp0s));
+ assert(!(csp0s < sp0d));
+ assert(!(csp0d < sp0s));
+
+ assert( (csp0d < sp1d));
+ assert( (csp0s < sp1s));
+ assert( (csp0s < sp1d));
+ assert( (csp0d < sp1s));
+
+ assert(!(csp1d < sp1s));
+ assert(!(csp1s < sp1d));
+
+ assert(!(csp2d < sp3d));
+ assert(!(csp2s < sp3s));
+ assert(!(csp2d < sp3s));
+ assert(!(csp2s < sp3d));
+
+ assert( (csp2d < sp4d));
+ assert( (csp2s < sp4s));
+ assert( (csp2d < sp4s));
+ assert( (csp2s < sp4d));
+
+ assert(!(csp4d < sp2d));
+ assert(!(csp4s < sp2s));
+ assert(!(csp4d < sp2s));
+ assert(!(csp4s < sp2d));
+
+// More cross-type comparisons (int vs float)
+ static_assert(std::span<const float>{fArr1, 8} < std::span<const int>{iArr1, 9}, "");
+ static_assert(std::span<const int>{iArr1, 8} < std::span<const float>{fArr1, 9}, "");
+ assert(!(std::span<float>{fArr2} < std::span<int>{iArr2}));
+ assert(!(std::span<int>{iArr2} < std::span<float>{fArr2}));
+
+ static_assert(!(std::span<const int>{iArr1, 9} < std::span<const float>{fArr1, 8}), "");
+} \ No newline at end of file
diff --git a/test/std/containers/views/span.comparison/op.ne.pass.cpp b/test/std/containers/views/span.comparison/op.ne.pass.cpp
new file mode 100644
index 000000000000..ecf05b317491
--- /dev/null
+++ b/test/std/containers/views/span.comparison/op.ne.pass.cpp
@@ -0,0 +1,168 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
+// constexpr bool operator!=(span<T, X> l, span<U, Y> r);
+//
+//
+// Effects: Equivalent to: return !(l == r);
+//
+
+#include <span>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+ int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
+constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+ float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
+
+
+int main () {
+
+ constexpr std::span<const int> csp0d{};
+ constexpr std::span<const int> csp1d{iArr1, 10};
+ constexpr std::span<const int> csp2d{iArr1 + 3, 2};
+ constexpr std::span<const int> csp3d{iArr1 + 1, 2};
+ constexpr std::span<const int> csp4d{iArr1 + 6, 2};
+
+ constexpr std::span<const int, 0> csp0s{};
+ constexpr std::span<const int, 10> csp1s{iArr1, 10};
+ constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2};
+ constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2};
+ constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2};
+
+ static_assert(!(csp0d != csp0d), "");
+ static_assert(!(csp0s != csp0s), "");
+ static_assert(!(csp0s != csp0d), "");
+ static_assert(!(csp0d != csp0s), "");
+
+ static_assert( (csp0d != csp1d), "");
+ static_assert( (csp0s != csp1s), "");
+ static_assert( (csp0s != csp1d), "");
+ static_assert( (csp0d != csp1s), "");
+
+ static_assert(!(csp1d != csp1s), "");
+ static_assert(!(csp1s != csp1d), "");
+
+ static_assert(!(csp2d != csp3d), "");
+ static_assert(!(csp2s != csp3s), "");
+ static_assert(!(csp2d != csp3s), "");
+ static_assert(!(csp2s != csp3d), "");
+
+ static_assert(!(csp2d != csp3d), "");
+ static_assert(!(csp2s != csp3s), "");
+ static_assert(!(csp2d != csp3s), "");
+ static_assert(!(csp2s != csp3d), "");
+
+ static_assert( (csp2d != csp4d), "");
+ static_assert( (csp2s != csp4s), "");
+ static_assert( (csp2d != csp4s), "");
+ static_assert( (csp2s != csp4d), "");
+
+ static_assert( (csp4d != csp2d), "");
+ static_assert( (csp4s != csp2s), "");
+ static_assert( (csp4d != csp2s), "");
+ static_assert( (csp4s != csp2d), "");
+
+ std::span<int> sp0d{};
+ std::span<int> sp1d{iArr2, 10};
+ std::span<int> sp2d{iArr2 + 3, 2};
+ std::span<int> sp3d{iArr2 + 1, 2};
+ std::span<int> sp4d{iArr2 + 6, 2};
+
+ std::span<int, 0> sp0s{};
+ std::span<int, 10> sp1s{iArr2, 10};
+ std::span<int, 2> sp2s{iArr2 + 3, 2};
+ std::span<int, 2> sp3s{iArr2 + 1, 2};
+ std::span<int, 2> sp4s{iArr2 + 6, 2};
+
+ assert(!(sp0d != sp0d));
+ assert(!(sp0s != sp0s));
+ assert(!(sp0s != sp0d));
+ assert(!(sp0d != sp0s));
+
+ assert( (sp0d != sp1d));
+ assert( (sp0s != sp1s));
+ assert( (sp0s != sp1d));
+ assert( (sp0d != sp1s));
+
+ assert(!(sp1d != sp1s));
+ assert(!(sp1s != sp1d));
+
+ assert(!(sp2d != sp3d));
+ assert(!(sp2s != sp3s));
+ assert(!(sp2d != sp3s));
+ assert(!(sp2s != sp3d));
+
+ assert(!(sp2d != sp3d));
+ assert(!(sp2s != sp3s));
+ assert(!(sp2d != sp3s));
+ assert(!(sp2s != sp3d));
+
+ assert( (sp2d != sp4d));
+ assert( (sp2s != sp4s));
+ assert( (sp2d != sp4s));
+ assert( (sp2s != sp4d));
+
+ assert( (sp4d != sp2d));
+ assert( (sp4s != sp2s));
+ assert( (sp4d != sp2s));
+ assert( (sp4s != sp2d));
+
+// cross type comparisons
+ assert(!(csp0d != sp0d));
+ assert(!(csp0s != sp0s));
+ assert(!(csp0s != sp0d));
+ assert(!(csp0d != sp0s));
+
+ assert( (csp0d != sp1d));
+ assert( (csp0s != sp1s));
+ assert( (csp0s != sp1d));
+ assert( (csp0d != sp1s));
+
+ assert(!(csp1d != sp1s));
+ assert(!(csp1s != sp1d));
+
+ assert(!(csp2d != sp3d));
+ assert(!(csp2s != sp3s));
+ assert(!(csp2d != sp3s));
+ assert(!(csp2s != sp3d));
+
+ assert(!(csp2d != sp3d));
+ assert(!(csp2s != sp3s));
+ assert(!(csp2d != sp3s));
+ assert(!(csp2s != sp3d));
+
+ assert( (csp2d != sp4d));
+ assert( (csp2s != sp4s));
+ assert( (csp2d != sp4s));
+ assert( (csp2s != sp4d));
+
+ assert( (csp4d != sp2d));
+ assert( (csp4s != sp2s));
+ assert( (csp4d != sp2s));
+ assert( (csp4s != sp2d));
+
+// More cross-type comparisons (int vs float)
+ static_assert(!(std::span<const float>{fArr1} != std::span<const int>{iArr1}), "");
+ static_assert(!(std::span<const int>{iArr1} != std::span<const float>{fArr1}), "");
+ assert(!(std::span<float>{fArr2} != std::span<int>{iArr2}));
+ assert(!(std::span<int>{iArr2} != std::span<float>{fArr2}));
+
+ static_assert( (std::span<const int>{iArr1, 9} != std::span<const float>{fArr1, 8}), "");
+} \ No newline at end of file
diff --git a/test/std/containers/views/span.cons/array.fail.cpp b/test/std/containers/views/span.cons/array.fail.cpp
new file mode 100644
index 000000000000..7ef49fc47089
--- /dev/null
+++ b/test/std/containers/views/span.cons/array.fail.cpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<size_t N>
+// constexpr span(element_type (&arr)[N]) noexcept;
+// template<size_t N>
+// constexpr span(array<value_type, N>& arr) noexcept;
+// template<size_t N>
+// constexpr span(const array<value_type, N>& arr) noexcept;
+//
+// Remarks: These constructors shall not participate in overload resolution unless:
+// — extent == dynamic_extent || N == extent is true, and
+// — remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[].
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+ int arr[] = {1,2,3};
+const int carr[] = {4,5,6};
+ volatile int varr[] = {7,8,9};
+const volatile int cvarr[] = {1,3,5};
+
+int main ()
+{
+// Size wrong
+ {
+ std::span<int, 2> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
+ }
+
+// Type wrong
+ {
+ std::span<float> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
+ std::span<float, 3> s2(arr); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
+ }
+
+// CV wrong (dynamically sized)
+ {
+ std::span< int> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<const int> s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span<const int> s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span< volatile int> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ std::span< volatile int> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ }
+
+// CV wrong (statically sized)
+ {
+ std::span< int,3> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span< int,3> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span< int,3> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span<const int,3> s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
+ std::span<const int,3> s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
+ std::span< volatile int,3> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
+ std::span< volatile int,3> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
+ }
+}
diff --git a/test/std/containers/views/span.cons/array.pass.cpp b/test/std/containers/views/span.cons/array.pass.cpp
new file mode 100644
index 000000000000..80a0f07f6252
--- /dev/null
+++ b/test/std/containers/views/span.cons/array.pass.cpp
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<size_t N>
+// constexpr span(element_type (&arr)[N]) noexcept;
+//
+// Remarks: These constructors shall not participate in overload resolution unless:
+// — extent == dynamic_extent || N == extent is true, and
+// — remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[].
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+void checkCV()
+{
+ int arr[] = {1,2,3};
+ const int carr[] = {4,5,6};
+ volatile int varr[] = {7,8,9};
+ const volatile int cvarr[] = {1,3,5};
+
+// Types the same (dynamic sized)
+ {
+ std::span< int> s1{ arr}; // a span< int> pointing at int.
+ std::span<const int> s2{ carr}; // a span<const int> pointing at const int.
+ std::span< volatile int> s3{ varr}; // a span< volatile int> pointing at volatile int.
+ std::span<const volatile int> s4{cvarr}; // a span<const volatile int> pointing at const volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 12);
+ }
+
+// Types the same (static sized)
+ {
+ std::span< int,3> s1{ arr}; // a span< int> pointing at int.
+ std::span<const int,3> s2{ carr}; // a span<const int> pointing at const int.
+ std::span< volatile int,3> s3{ varr}; // a span< volatile int> pointing at volatile int.
+ std::span<const volatile int,3> s4{cvarr}; // a span<const volatile int> pointing at const volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 12);
+ }
+
+
+// types different (dynamic sized)
+ {
+ std::span<const int> s1{ arr}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{ arr}; // a span< volatile int> pointing at int.
+ std::span< volatile int> s3{ arr}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int> s4{ arr}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int> s5{carr}; // a span<const volatile int> pointing at const int.
+ std::span<const volatile int> s6{varr}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18);
+ }
+
+// types different (static sized)
+ {
+ std::span<const int,3> s1{ arr}; // a span<const int> pointing at int.
+ std::span< volatile int,3> s2{ arr}; // a span< volatile int> pointing at int.
+ std::span< volatile int,3> s3{ arr}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int,3> s4{ arr}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int,3> s5{carr}; // a span<const volatile int> pointing at const int.
+ std::span<const volatile int,3> s6{varr}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18);
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ constexpr T val[2] = {};
+
+ ASSERT_NOEXCEPT(std::span<const T> {val});
+ ASSERT_NOEXCEPT(std::span<const T, 2>{val});
+ std::span<const T> s1{val};
+ std::span<const T, 2> s2{val};
+ return
+ s1.data() == &val[0] && s1.size() == 2
+ && s2.data() == &val[0] && s2.size() == 2;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ T val[2] = {};
+ ASSERT_NOEXCEPT(std::span<T> {val});
+ ASSERT_NOEXCEPT(std::span<T, 2>{val});
+ std::span<T> s1{val};
+ std::span<T, 2> s2{val};
+ assert(s1.data() == &val[0] && s1.size() == 2);
+ assert(s2.data() == &val[0] && s2.size() == 2);
+}
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/assign.pass.cpp b/test/std/containers/views/span.cons/assign.pass.cpp
new file mode 100644
index 000000000000..b5bd7ae00dfc
--- /dev/null
+++ b/test/std/containers/views/span.cons/assign.pass.cpp
@@ -0,0 +1,293 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span& operator=(const span& other) noexcept = default;
+
+#include <span>
+#include <cassert>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+
+template <typename T>
+constexpr bool doAssign(T lhs, T rhs)
+{
+ ASSERT_NOEXCEPT(std::declval<T&>() = rhs);
+ lhs = rhs;
+ return lhs.data() == rhs.data()
+ && lhs.size() == rhs.size();
+}
+
+struct A{};
+
+constexpr int carr1[] = {1,2,3,4};
+constexpr int carr2[] = {3,4,5};
+constexpr int carr3[] = {7,8};
+ int arr[] = {5,6,7,9};
+std::string strs[] = {"ABC", "DEF", "GHI"};
+
+
+int main ()
+{
+
+// constexpr dynamically sized assignment
+ {
+// On systems where 'ptrdiff_t' is a synonym for 'int',
+// the call span(ptr, 0) selects the (pointer, index_type) constructor.
+// On systems where 'ptrdiff_t' is NOT a synonym for 'int',
+// it is ambiguous, because of 0 also being convertible to a null pointer
+// and so the compiler can't choose between:
+// span(pointer, index_type)
+// and span(pointer, pointer)
+// We cast zero to std::ptrdiff_t to remove that ambiguity.
+// Example:
+// On darwin x86_64, ptrdiff_t is the same as long int.
+// On darwin i386, ptrdiff_t is the same as int.
+ constexpr std::span<const int> spans[] = {
+ {},
+ {carr1, static_cast<std::ptrdiff_t>(0)},
+ {carr1, 1},
+ {carr1, 2},
+ {carr1, 3},
+ {carr1, 4},
+ {carr2, static_cast<std::ptrdiff_t>(0)},
+ {carr2, 1},
+ {carr2, 2},
+ {carr2, 3},
+ {carr3, static_cast<std::ptrdiff_t>(0)},
+ {carr3, 1},
+ {carr3, 2}
+ };
+
+ static_assert(std::size(spans) == 13, "" );
+
+// No for loops in constexpr land :-(
+ static_assert(doAssign(spans[0], spans[0]), "");
+ static_assert(doAssign(spans[0], spans[1]), "");
+ static_assert(doAssign(spans[0], spans[2]), "");
+ static_assert(doAssign(spans[0], spans[3]), "");
+ static_assert(doAssign(spans[0], spans[4]), "");
+ static_assert(doAssign(spans[0], spans[5]), "");
+ static_assert(doAssign(spans[0], spans[6]), "");
+ static_assert(doAssign(spans[0], spans[7]), "");
+ static_assert(doAssign(spans[0], spans[8]), "");
+ static_assert(doAssign(spans[0], spans[9]), "");
+ static_assert(doAssign(spans[0], spans[10]), "");
+ static_assert(doAssign(spans[0], spans[11]), "");
+ static_assert(doAssign(spans[0], spans[12]), "");
+
+ static_assert(doAssign(spans[1], spans[1]), "");
+ static_assert(doAssign(spans[1], spans[2]), "");
+ static_assert(doAssign(spans[1], spans[3]), "");
+ static_assert(doAssign(spans[1], spans[4]), "");
+ static_assert(doAssign(spans[1], spans[5]), "");
+ static_assert(doAssign(spans[1], spans[6]), "");
+ static_assert(doAssign(spans[1], spans[7]), "");
+ static_assert(doAssign(spans[1], spans[8]), "");
+ static_assert(doAssign(spans[1], spans[9]), "");
+ static_assert(doAssign(spans[1], spans[10]), "");
+ static_assert(doAssign(spans[1], spans[11]), "");
+ static_assert(doAssign(spans[1], spans[12]), "");
+
+ static_assert(doAssign(spans[2], spans[2]), "");
+ static_assert(doAssign(spans[2], spans[3]), "");
+ static_assert(doAssign(spans[2], spans[4]), "");
+ static_assert(doAssign(spans[2], spans[5]), "");
+ static_assert(doAssign(spans[2], spans[6]), "");
+ static_assert(doAssign(spans[2], spans[7]), "");
+ static_assert(doAssign(spans[2], spans[8]), "");
+ static_assert(doAssign(spans[2], spans[9]), "");
+ static_assert(doAssign(spans[2], spans[10]), "");
+ static_assert(doAssign(spans[2], spans[11]), "");
+ static_assert(doAssign(spans[2], spans[12]), "");
+
+ static_assert(doAssign(spans[3], spans[3]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[10]), "");
+ static_assert(doAssign(spans[3], spans[11]), "");
+ static_assert(doAssign(spans[3], spans[12]), "");
+
+ static_assert(doAssign(spans[4], spans[4]), "");
+ static_assert(doAssign(spans[4], spans[5]), "");
+ static_assert(doAssign(spans[4], spans[6]), "");
+ static_assert(doAssign(spans[4], spans[7]), "");
+ static_assert(doAssign(spans[4], spans[8]), "");
+ static_assert(doAssign(spans[4], spans[9]), "");
+ static_assert(doAssign(spans[4], spans[10]), "");
+ static_assert(doAssign(spans[4], spans[11]), "");
+ static_assert(doAssign(spans[4], spans[12]), "");
+
+ static_assert(doAssign(spans[5], spans[5]), "");
+ static_assert(doAssign(spans[5], spans[6]), "");
+ static_assert(doAssign(spans[5], spans[7]), "");
+ static_assert(doAssign(spans[5], spans[8]), "");
+ static_assert(doAssign(spans[5], spans[9]), "");
+ static_assert(doAssign(spans[5], spans[10]), "");
+ static_assert(doAssign(spans[5], spans[11]), "");
+ static_assert(doAssign(spans[5], spans[12]), "");
+
+ static_assert(doAssign(spans[6], spans[6]), "");
+ static_assert(doAssign(spans[6], spans[7]), "");
+ static_assert(doAssign(spans[6], spans[8]), "");
+ static_assert(doAssign(spans[6], spans[9]), "");
+ static_assert(doAssign(spans[6], spans[10]), "");
+ static_assert(doAssign(spans[6], spans[11]), "");
+ static_assert(doAssign(spans[6], spans[12]), "");
+
+ static_assert(doAssign(spans[7], spans[7]), "");
+ static_assert(doAssign(spans[7], spans[8]), "");
+ static_assert(doAssign(spans[7], spans[9]), "");
+ static_assert(doAssign(spans[7], spans[10]), "");
+ static_assert(doAssign(spans[7], spans[11]), "");
+ static_assert(doAssign(spans[7], spans[12]), "");
+
+ static_assert(doAssign(spans[8], spans[8]), "");
+ static_assert(doAssign(spans[8], spans[9]), "");
+ static_assert(doAssign(spans[8], spans[10]), "");
+ static_assert(doAssign(spans[8], spans[11]), "");
+ static_assert(doAssign(spans[8], spans[12]), "");
+
+ static_assert(doAssign(spans[9], spans[9]), "");
+ static_assert(doAssign(spans[9], spans[10]), "");
+ static_assert(doAssign(spans[9], spans[11]), "");
+ static_assert(doAssign(spans[9], spans[12]), "");
+
+ static_assert(doAssign(spans[10], spans[10]), "");
+ static_assert(doAssign(spans[10], spans[11]), "");
+ static_assert(doAssign(spans[10], spans[12]), "");
+
+ static_assert(doAssign(spans[11], spans[11]), "");
+ static_assert(doAssign(spans[11], spans[12]), "");
+
+ static_assert(doAssign(spans[12], spans[12]), "");
+
+// for (size_t i = 0; i < std::size(spans); ++i)
+// for (size_t j = i; j < std::size(spans); ++j)
+// static_assert(doAssign(spans[i], spans[j]), "");
+ }
+
+// constexpr statically sized assignment
+ {
+ constexpr std::span<const int,2> spans[] = {
+ {carr1, 2},
+ {carr1 + 1, 2},
+ {carr1 + 2, 2},
+ {carr2, 2},
+ {carr2 + 1, 2},
+ {carr3, 2}
+ };
+
+ static_assert(std::size(spans) == 6, "" );
+
+// No for loops in constexpr land :-(
+ static_assert(doAssign(spans[0], spans[0]), "");
+ static_assert(doAssign(spans[0], spans[1]), "");
+ static_assert(doAssign(spans[0], spans[2]), "");
+ static_assert(doAssign(spans[0], spans[3]), "");
+ static_assert(doAssign(spans[0], spans[4]), "");
+ static_assert(doAssign(spans[0], spans[5]), "");
+
+ static_assert(doAssign(spans[1], spans[1]), "");
+ static_assert(doAssign(spans[1], spans[2]), "");
+ static_assert(doAssign(spans[1], spans[3]), "");
+ static_assert(doAssign(spans[1], spans[4]), "");
+ static_assert(doAssign(spans[1], spans[5]), "");
+
+ static_assert(doAssign(spans[2], spans[2]), "");
+ static_assert(doAssign(spans[2], spans[3]), "");
+ static_assert(doAssign(spans[2], spans[4]), "");
+ static_assert(doAssign(spans[2], spans[5]), "");
+
+ static_assert(doAssign(spans[3], spans[3]), "");
+ static_assert(doAssign(spans[3], spans[4]), "");
+ static_assert(doAssign(spans[3], spans[5]), "");
+
+ static_assert(doAssign(spans[4], spans[4]), "");
+ static_assert(doAssign(spans[4], spans[5]), "");
+
+ static_assert(doAssign(spans[5], spans[5]), "");
+
+// for (size_t i = 0; i < std::size(spans); ++i)
+// for (size_t j = i; j < std::size(spans); ++j)
+// static_assert(doAssign(spans[i], spans[j]), "");
+ }
+
+
+// dynamically sized assignment
+ {
+ std::span<int> spans[] = {
+ {},
+ {arr, arr + 1},
+ {arr, arr + 2},
+ {arr, arr + 3},
+ {arr + 1, arr + 3} // same size as s2
+ };
+
+ for (size_t i = 0; i < std::size(spans); ++i)
+ for (size_t j = i; j < std::size(spans); ++j)
+ assert((doAssign(spans[i], spans[j])));
+ }
+
+// statically sized assignment
+ {
+ std::span<int,2> spans[] = {
+ {arr, arr + 2},
+ {arr + 1, arr + 3},
+ {arr + 2, arr + 4}
+ };
+
+ for (size_t i = 0; i < std::size(spans); ++i)
+ for (size_t j = i; j < std::size(spans); ++j)
+ assert((doAssign(spans[i], spans[j])));
+ }
+
+// dynamically sized assignment
+ {
+ std::span<std::string> spans[] = {
+ {strs, strs},
+ {strs, strs + 1},
+ {strs, strs + 2},
+ {strs, strs + 3},
+ {strs + 1, strs + 1},
+ {strs + 1, strs + 2},
+ {strs + 1, strs + 3},
+ {strs + 2, strs + 2},
+ {strs + 2, strs + 3},
+ {strs + 3, strs + 3}
+ };
+
+ for (size_t i = 0; i < std::size(spans); ++i)
+ for (size_t j = i; j < std::size(spans); ++j)
+ assert((doAssign(spans[i], spans[j])));
+ }
+
+ {
+ std::span<std::string, 1> spans[] = {
+ {strs, strs + 1},
+ {strs + 1, strs + 2},
+ {strs + 2, strs + 3}
+ };
+
+ for (size_t i = 0; i < std::size(spans); ++i)
+ for (size_t j = i; j < std::size(spans); ++j)
+ assert((doAssign(spans[i], spans[j])));
+ }
+}
diff --git a/test/std/containers/views/span.cons/container.fail.cpp b/test/std/containers/views/span.cons/container.fail.cpp
new file mode 100644
index 000000000000..ecd7fcb91b83
--- /dev/null
+++ b/test/std/containers/views/span.cons/container.fail.cpp
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class Container>
+// constexpr span(Container& cont);
+// template<class Container>
+// constexpr span(const Container& cont);
+//
+// Remarks: These constructors shall not participate in overload resolution unless:
+// — Container is not a specialization of span,
+// — Container is not a specialization of array,
+// — is_array_v<Container> is false,
+// — data(cont) and size(cont) are both well-formed, and
+// — remove_pointer_t<decltype(data(cont))>(*)[] is convertible to ElementType(*)[].
+//
+
+
+#include <span>
+#include <cassert>
+#include <list>
+#include <forward_list>
+#include <deque>
+
+#include "test_macros.h"
+
+// Look ma - I'm a container!
+template <typename T>
+struct IsAContainer {
+ constexpr IsAContainer() : v_{} {}
+ constexpr size_t size() const {return 1;}
+ constexpr T *data() {return &v_;}
+ constexpr const T *data() const {return &v_;}
+
+ constexpr const T *getV() const {return &v_;} // for checking
+ T v_;
+};
+
+template <typename T>
+struct NotAContainerNoData {
+ size_t size() const {return 0;}
+};
+
+template <typename T>
+struct NotAContainerNoSize {
+ const T *data() const {return nullptr;}
+};
+
+template <typename T>
+struct NotAContainerPrivate {
+private:
+ size_t size() const {return 0;}
+ const T *data() const {return nullptr;}
+};
+
+
+int main ()
+{
+
+// Missing size and/or data
+ {
+ std::span<int> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s2{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span<int> s3{NotAContainerNoData<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s4{NotAContainerNoData<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span<int> s5{NotAContainerNoSize<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s6{NotAContainerNoSize<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span<int> s7{NotAContainerPrivate<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s8{NotAContainerPrivate<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+
+// Again with the standard containers
+ std::span<int> s11{std::deque<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s12{std::deque<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span<int> s13{std::list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s14{std::list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span<int> s15{std::forward_list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<int, 0> s16{std::forward_list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ }
+
+// Not the same type
+ {
+ std::span<float> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
+ std::span<float, 0> s2{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
+ }
+
+// CV wrong (dynamically sized)
+ {
+ std::span< int> s1{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s2{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s3{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<const int> s4{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span<const int> s5{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span< volatile int> s6{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ std::span< volatile int> s7{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ }
+
+// CV wrong (statically sized)
+ {
+ std::span< int,1> s1{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 1>'}}
+ std::span< int,1> s2{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 1>'}}
+ std::span< int,1> s3{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 1>'}}
+ std::span<const int,1> s4{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 1>'}}
+ std::span<const int,1> s5{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 1>'}}
+ std::span< volatile int,1> s6{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 1>'}}
+ std::span< volatile int,1> s7{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 1>'}}
+ }
+
+}
diff --git a/test/std/containers/views/span.cons/container.pass.cpp b/test/std/containers/views/span.cons/container.pass.cpp
new file mode 100644
index 000000000000..478a3dac5db7
--- /dev/null
+++ b/test/std/containers/views/span.cons/container.pass.cpp
@@ -0,0 +1,118 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class Container>
+// constexpr span(Container& cont);
+// template<class Container>
+// constexpr span(const Container& cont);
+//
+// Remarks: These constructors shall not participate in overload resolution unless:
+// — Container is not a specialization of span,
+// — Container is not a specialization of array,
+// — is_array_v<Container> is false,
+// — data(cont) and size(cont) are both well-formed, and
+// — remove_pointer_t<decltype(data(cont))>(*)[] is convertible to ElementType(*)[].
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+#include <vector>
+
+#include "test_macros.h"
+
+// Look ma - I'm a container!
+template <typename T>
+struct IsAContainer {
+ constexpr IsAContainer() : v_{} {}
+ constexpr size_t size() const {return 1;}
+ constexpr T *data() {return &v_;}
+ constexpr const T *data() const {return &v_;}
+
+ constexpr T const *getV() const {return &v_;} // for checking
+ T v_;
+};
+
+
+void checkCV()
+{
+ std::vector<int> v = {1,2,3};
+
+// Types the same (dynamic sized)
+ {
+ std::span< int> s1{v}; // a span< int> pointing at int.
+ }
+
+// Types the same (static sized)
+ {
+ std::span< int,3> s1{v}; // a span< int> pointing at int.
+ }
+
+// types different (dynamic sized)
+ {
+ std::span<const int> s1{v}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{v}; // a span< volatile int> pointing at int.
+ std::span< volatile int> s3{v}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int> s4{v}; // a span<const volatile int> pointing at int.
+ }
+
+// types different (static sized)
+ {
+ std::span<const int,3> s1{v}; // a span<const int> pointing at int.
+ std::span< volatile int,3> s2{v}; // a span< volatile int> pointing at int.
+ std::span< volatile int,3> s3{v}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int,3> s4{v}; // a span<const volatile int> pointing at int.
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ constexpr IsAContainer<const T> val{};
+ std::span<const T> s1{val};
+ std::span<const T, 1> s2{val};
+ return
+ s1.data() == val.getV() && s1.size() == 1
+ && s2.data() == val.getV() && s2.size() == 1;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ IsAContainer<T> val{};
+ std::span<const T> s1{val};
+ std::span<const T, 1> s2{val};
+ assert(s1.data() == val.getV() && s1.size() == 1);
+ assert(s2.data() == val.getV() && s2.size() == 1);
+}
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/copy.pass.cpp b/test/std/containers/views/span.cons/copy.pass.cpp
new file mode 100644
index 000000000000..2cfffbbd4496
--- /dev/null
+++ b/test/std/containers/views/span.cons/copy.pass.cpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span(const span& other) noexcept = default;
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template <typename T>
+constexpr bool doCopy(const T &rhs)
+{
+ ASSERT_NOEXCEPT(T{rhs});
+ T lhs{rhs};
+ return lhs.data() == rhs.data()
+ && lhs.size() == rhs.size();
+}
+
+struct A{};
+
+template <typename T>
+void testCV ()
+{
+ int arr[] = {1,2,3};
+ assert((doCopy(std::span<T> () )));
+ assert((doCopy(std::span<T,0>() )));
+ assert((doCopy(std::span<T> (&arr[0], 1))));
+ assert((doCopy(std::span<T,1>(&arr[0], 1))));
+ assert((doCopy(std::span<T> (&arr[0], 2))));
+ assert((doCopy(std::span<T,2>(&arr[0], 2))));
+}
+
+
+int main ()
+{
+ constexpr int carr[] = {1,2,3};
+
+ static_assert(doCopy(std::span< int> ()), "");
+ static_assert(doCopy(std::span< int,0>()), "");
+ static_assert(doCopy(std::span<const int> (&carr[0], 1)), "");
+ static_assert(doCopy(std::span<const int,1>(&carr[0], 1)), "");
+ static_assert(doCopy(std::span<const int> (&carr[0], 2)), "");
+ static_assert(doCopy(std::span<const int,2>(&carr[0], 2)), "");
+
+ static_assert(doCopy(std::span<long>()), "");
+ static_assert(doCopy(std::span<double>()), "");
+ static_assert(doCopy(std::span<A>()), "");
+
+ std::string s;
+ assert(doCopy(std::span<std::string> () ));
+ assert(doCopy(std::span<std::string, 0>() ));
+ assert(doCopy(std::span<std::string> (&s, 1)));
+ assert(doCopy(std::span<std::string, 1>(&s, 1)));
+
+ testCV< int>();
+ testCV<const int>();
+ testCV< volatile int>();
+ testCV<const volatile int>();
+}
diff --git a/test/std/containers/views/span.cons/deduct.pass.cpp b/test/std/containers/views/span.cons/deduct.pass.cpp
new file mode 100644
index 000000000000..e72c09149f03
--- /dev/null
+++ b/test/std/containers/views/span.cons/deduct.pass.cpp
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class T, size_t N>
+// span(T (&)[N]) -> span<T, N>;
+//
+// template<class T, size_t N>
+// span(array<T, N>&) -> span<T, N>;
+//
+// template<class T, size_t N>
+// span(const array<T, N>&) -> span<const T, N>;
+//
+// template<class Container>
+// span(Container&) -> span<typename Container::value_type>;
+//
+// template<class Container>
+// span(const Container&) -> span<const typename Container::value_type>;
+
+
+
+#include <span>
+#include <algorithm>
+#include <array>
+#include <cassert>
+#include <string>
+#include <type_traits>
+
+#include "test_macros.h"
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+int main ()
+{
+ {
+ int arr[] = {1,2,3};
+ std::span s{arr};
+ using S = decltype(s);
+ ASSERT_SAME_TYPE(S, std::span<int, 3>);
+ assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end())));
+ }
+
+ {
+ std::array<double, 4> arr = {1.0, 2.0, 3.0, 4.0};
+ std::span s{arr};
+ using S = decltype(s);
+ ASSERT_SAME_TYPE(S, std::span<double, 4>);
+ assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end())));
+ }
+
+ {
+ const std::array<long, 5> arr = {4, 5, 6, 7, 8};
+ std::span s{arr};
+ using S = decltype(s);
+ ASSERT_SAME_TYPE(S, std::span<const long, 5>);
+ assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end())));
+ }
+
+ {
+ std::string str{"ABCDE"};
+ std::span s{str};
+ using S = decltype(s);
+ ASSERT_SAME_TYPE(S, std::span<char>);
+ assert((size_t)s.size() == str.size());
+ assert((std::equal(s.begin(), s.end(), std::begin(s), std::end(s))));
+ }
+
+ {
+ const std::string str{"QWERTYUIOP"};
+ std::span s{str};
+ using S = decltype(s);
+ ASSERT_SAME_TYPE(S, std::span<const char>);
+ assert((size_t)s.size() == str.size());
+ assert((std::equal(s.begin(), s.end(), std::begin(s), std::end(s))));
+ }
+}
diff --git a/test/std/containers/views/span.cons/default.fail.cpp b/test/std/containers/views/span.cons/default.fail.cpp
new file mode 100644
index 000000000000..d1fefe5b38ca
--- /dev/null
+++ b/test/std/containers/views/span.cons/default.fail.cpp
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span() noexcept;
+//
+// Remarks: This constructor shall not participate in overload resolution
+// unless Extent <= 0 is true.
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+int main ()
+{
+ std::span<int, 2> s; // expected-error@span:* {{static_assert failed "Can't default construct a statically sized span with size > 0"}}
+
+// TODO: This is what I want:
+// eXpected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
+}
diff --git a/test/std/containers/views/span.cons/default.pass.cpp b/test/std/containers/views/span.cons/default.pass.cpp
new file mode 100644
index 000000000000..f7e496696e99
--- /dev/null
+++ b/test/std/containers/views/span.cons/default.pass.cpp
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span() noexcept;
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+void checkCV()
+{
+// Types the same (dynamic sized)
+ {
+ std::span< int> s1;
+ std::span<const int> s2;
+ std::span< volatile int> s3;
+ std::span<const volatile int> s4;
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 0);
+ }
+
+// Types the same (static sized)
+ {
+ std::span< int,0> s1;
+ std::span<const int,0> s2;
+ std::span< volatile int,0> s3;
+ std::span<const volatile int,0> s4;
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 0);
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ std::span<const T> s1;
+ std::span<const T, 0> s2;
+ return
+ s1.data() == nullptr && s1.size() == 0
+ && s2.data() == nullptr && s2.size() == 0;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ ASSERT_NOEXCEPT(T{});
+ std::span<const T> s1;
+ std::span<const T, 0> s2;
+ assert(s1.data() == nullptr && s1.size() == 0);
+ assert(s2.data() == nullptr && s2.size() == 0);
+}
+
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/ptr_len.fail.cpp b/test/std/containers/views/span.cons/ptr_len.fail.cpp
new file mode 100644
index 000000000000..db24e3d26884
--- /dev/null
+++ b/test/std/containers/views/span.cons/ptr_len.fail.cpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span(pointer ptr, index_type count);
+// Requires: [ptr, ptr + count) shall be a valid range.
+// If extent is not equal to dynamic_extent, then count shall be equal to extent.
+//
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+ int arr[] = {1,2,3};
+const int carr[] = {4,5,6};
+ volatile int varr[] = {7,8,9};
+const volatile int cvarr[] = {1,3,5};
+
+int main ()
+{
+// We can't check that the size doesn't match - because that's a runtime property
+// std::span<int, 2> s1(arr, 3);
+
+// Type wrong
+ {
+ std::span<float> s1(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
+ std::span<float, 3> s2(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
+ }
+
+// CV wrong (dynamically sized)
+ {
+ std::span< int> s1{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s2{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s3{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<const int> s4{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span<const int> s5{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span< volatile int> s6{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ std::span< volatile int> s7{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ }
+
+// CV wrong (statically sized)
+ {
+ std::span< int,3> s1{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span< int,3> s2{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span< int,3> s3{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span<const int,3> s4{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
+ std::span<const int,3> s5{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
+ std::span< volatile int,3> s6{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
+ std::span< volatile int,3> s7{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
+ }
+}
diff --git a/test/std/containers/views/span.cons/ptr_len.pass.cpp b/test/std/containers/views/span.cons/ptr_len.pass.cpp
new file mode 100644
index 000000000000..7302759bcc64
--- /dev/null
+++ b/test/std/containers/views/span.cons/ptr_len.pass.cpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span(pointer ptr, index_type count);
+// Requires: [ptr, ptr + count) shall be a valid range.
+// If extent is not equal to dynamic_extent, then count shall be equal to extent.
+//
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+void checkCV()
+{
+ int arr[] = {1,2,3};
+ const int carr[] = {4,5,6};
+ volatile int varr[] = {7,8,9};
+ const volatile int cvarr[] = {1,3,5};
+
+// Types the same (dynamic sized)
+ {
+ std::span< int> s1{ arr, 3}; // a span< int> pointing at int.
+ std::span<const int> s2{ carr, 3}; // a span<const int> pointing at const int.
+ std::span< volatile int> s3{ varr, 3}; // a span< volatile int> pointing at volatile int.
+ std::span<const volatile int> s4{cvarr, 3}; // a span<const volatile int> pointing at const volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 12);
+ }
+
+// Types the same (static sized)
+ {
+ std::span< int,3> s1{ arr, 3}; // a span< int> pointing at int.
+ std::span<const int,3> s2{ carr, 3}; // a span<const int> pointing at const int.
+ std::span< volatile int,3> s3{ varr, 3}; // a span< volatile int> pointing at volatile int.
+ std::span<const volatile int,3> s4{cvarr, 3}; // a span<const volatile int> pointing at const volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 12);
+ }
+
+
+// types different (dynamic sized)
+ {
+ std::span<const int> s1{ arr, 3}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{ arr, 3}; // a span< volatile int> pointing at int.
+ std::span< volatile int> s3{ arr, 3}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int> s4{ arr, 3}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int> s5{carr, 3}; // a span<const volatile int> pointing at const int.
+ std::span<const volatile int> s6{varr, 3}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18);
+ }
+
+// types different (static sized)
+ {
+ std::span<const int,3> s1{ arr, 3}; // a span<const int> pointing at int.
+ std::span< volatile int,3> s2{ arr, 3}; // a span< volatile int> pointing at int.
+ std::span< volatile int,3> s3{ arr, 3}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int,3> s4{ arr, 3}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int,3> s5{carr, 3}; // a span<const volatile int> pointing at const int.
+ std::span<const volatile int,3> s6{varr, 3}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18);
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ constexpr T val[2] = {};
+ std::span<const T> s1{val, 2};
+ std::span<const T,2> s2{val, 2};
+ return
+ s1.data() == &val[0] && s1.size() == 2
+ && s2.data() == &val[0] && s2.size() == 2;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ T val[2] = {};
+ std::span<T> s1{val, 2};
+ std::span<T,2> s2{val, 2};
+ assert(s1.data() == &val[0] && s1.size() == 2);
+ assert(s2.data() == &val[0] && s2.size() == 2);
+}
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/ptr_ptr.fail.cpp b/test/std/containers/views/span.cons/ptr_ptr.fail.cpp
new file mode 100644
index 000000000000..a55f0592a082
--- /dev/null
+++ b/test/std/containers/views/span.cons/ptr_ptr.fail.cpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span(pointer first, pointer last);
+// Requires: [first, last) shall be a valid range.
+// If extent is not equal to dynamic_extent, then last - first shall be equal to extent.
+//
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+ int arr[] = {1,2,3};
+const int carr[] = {4,5,6};
+ volatile int varr[] = {7,8,9};
+const volatile int cvarr[] = {1,3,5};
+
+int main ()
+{
+// We can't check that the size doesn't match - because that's a runtime property
+// std::span<int, 2> s1(arr, arr + 3);
+
+// Type wrong
+ {
+ std::span<float> s1(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
+ std::span<float, 3> s2(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
+ }
+
+// CV wrong (dynamically sized)
+ {
+ std::span< int> s1{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s2{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s3{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span<const int> s4{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span<const int> s5{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span< volatile int> s6{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ std::span< volatile int> s7{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ }
+
+// CV wrong (statically sized)
+ {
+ std::span< int,3> s1{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span< int,3> s2{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span< int,3> s3{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
+ std::span<const int,3> s4{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
+ std::span<const int,3> s5{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
+ std::span< volatile int,3> s6{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
+ std::span< volatile int,3> s7{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
+ }
+}
diff --git a/test/std/containers/views/span.cons/ptr_ptr.pass.cpp b/test/std/containers/views/span.cons/ptr_ptr.pass.cpp
new file mode 100644
index 000000000000..afb525e73687
--- /dev/null
+++ b/test/std/containers/views/span.cons/ptr_ptr.pass.cpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr span(pointer first, pointer last);
+// Requires: [first, last) shall be a valid range.
+// If extent is not equal to dynamic_extent, then last - first shall be equal to extent.
+//
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+void checkCV()
+{
+ int arr[] = {1,2,3};
+ const int carr[] = {4,5,6};
+ volatile int varr[] = {7,8,9};
+ const volatile int cvarr[] = {1,3,5};
+
+// Types the same (dynamic sized)
+ {
+ std::span< int> s1{ arr, arr + 3}; // a span< int> pointing at int.
+ std::span<const int> s2{ carr, carr + 3}; // a span<const int> pointing at const int.
+ std::span< volatile int> s3{ varr, varr + 3}; // a span< volatile int> pointing at volatile int.
+ std::span<const volatile int> s4{cvarr, cvarr + 3}; // a span<const volatile int> pointing at const volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 12);
+ }
+
+// Types the same (static sized)
+ {
+ std::span< int,3> s1{ arr, arr + 3}; // a span< int> pointing at int.
+ std::span<const int,3> s2{ carr, carr + 3}; // a span<const int> pointing at const int.
+ std::span< volatile int,3> s3{ varr, varr + 3}; // a span< volatile int> pointing at volatile int.
+ std::span<const volatile int,3> s4{cvarr, cvarr + 3}; // a span<const volatile int> pointing at const volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 12);
+ }
+
+
+// types different (dynamic sized)
+ {
+ std::span<const int> s1{ arr, arr + 3}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{ arr, arr + 3}; // a span< volatile int> pointing at int.
+ std::span< volatile int> s3{ arr, arr + 3}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int> s4{ arr, arr + 3}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int> s5{carr, carr + 3}; // a span<const volatile int> pointing at const int.
+ std::span<const volatile int> s6{varr, varr + 3}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18);
+ }
+
+// types different (static sized)
+ {
+ std::span<const int,3> s1{ arr, arr + 3}; // a span<const int> pointing at int.
+ std::span< volatile int,3> s2{ arr, arr + 3}; // a span< volatile int> pointing at int.
+ std::span< volatile int,3> s3{ arr, arr + 3}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int,3> s4{ arr, arr + 3}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int,3> s5{carr, carr + 3}; // a span<const volatile int> pointing at const int.
+ std::span<const volatile int,3> s6{varr, varr + 3}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18);
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ constexpr T val[2] = {};
+ std::span<const T> s1{val, val+2};
+ std::span<const T,2> s2{val, val+2};
+ return
+ s1.data() == &val[0] && s1.size() == 2
+ && s2.data() == &val[0] && s2.size() == 2;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ T val[2] = {};
+ std::span<T> s1{val, val+2};
+ std::span<T,2> s2{val, val+2};
+ assert(s1.data() == &val[0] && s1.size() == 2);
+ assert(s2.data() == &val[0] && s2.size() == 2);
+}
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/span.fail.cpp b/test/std/containers/views/span.cons/span.fail.cpp
new file mode 100644
index 000000000000..1fa71551b493
--- /dev/null
+++ b/test/std/containers/views/span.cons/span.fail.cpp
@@ -0,0 +1,104 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class OtherElementType, ptrdiff_t OtherExtent>
+// constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept;
+//
+// Remarks: This constructor shall not participate in overload resolution unless:
+// Extent == dynamic_extent || Extent == OtherExtent is true, and
+// OtherElementType(*)[] is convertible to ElementType(*)[].
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+void checkCV ()
+{
+// std::span< int> sp;
+ std::span<const int> csp;
+ std::span< volatile int> vsp;
+ std::span<const volatile int> cvsp;
+
+// std::span< int, 0> sp0;
+ std::span<const int, 0> csp0;
+ std::span< volatile int, 0> vsp0;
+ std::span<const volatile int, 0> cvsp0;
+
+// Try to remove const and/or volatile (dynamic -> dynamic)
+ {
+ std::span< int> s1{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s2{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s3{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+
+ std::span<const int> s4{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span<const int> s5{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+
+ std::span< volatile int> s6{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ std::span< volatile int> s7{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ }
+
+// Try to remove const and/or volatile (static -> static)
+ {
+ std::span< int, 0> s1{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span< int, 0> s2{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span< int, 0> s3{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+
+ std::span<const int, 0> s4{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}}
+ std::span<const int, 0> s5{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}}
+
+ std::span< volatile int, 0> s6{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}}
+ std::span< volatile int, 0> s7{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}}
+ }
+
+// Try to remove const and/or volatile (static -> dynamic)
+ {
+ std::span< int> s1{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s2{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+ std::span< int> s3{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
+
+ std::span<const int> s4{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+ std::span<const int> s5{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
+
+ std::span< volatile int> s6{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ std::span< volatile int> s7{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
+ }
+
+// Try to remove const and/or volatile (static -> static)
+ {
+ std::span< int, 0> s1{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span< int, 0> s2{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+ std::span< int, 0> s3{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}}
+
+ std::span<const int, 0> s4{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}}
+ std::span<const int, 0> s5{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}}
+
+ std::span< volatile int, 0> s6{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}}
+ std::span< volatile int, 0> s7{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}}
+ }
+}
+
+int main ()
+{
+ std::span<int> sp;
+ std::span<int, 0> sp0;
+
+ std::span<float> s1{sp}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
+ std::span<float> s2{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
+ std::span<float, 0> s3{sp}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
+ std::span<float, 0> s4{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/span.pass.cpp b/test/std/containers/views/span.cons/span.pass.cpp
new file mode 100644
index 000000000000..b2024ce123cd
--- /dev/null
+++ b/test/std/containers/views/span.cons/span.pass.cpp
@@ -0,0 +1,142 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class OtherElementType, ptrdiff_t OtherExtent>
+// constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept;
+//
+// Remarks: This constructor shall not participate in overload resolution unless:
+// Extent == dynamic_extent || Extent == OtherExtent is true, and
+// OtherElementType(*)[] is convertible to ElementType(*)[].
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+void checkCV()
+{
+ std::span< int> sp;
+// std::span<const int> csp;
+ std::span< volatile int> vsp;
+// std::span<const volatile int> cvsp;
+
+ std::span< int, 0> sp0;
+// std::span<const int, 0> csp0;
+ std::span< volatile int, 0> vsp0;
+// std::span<const volatile int, 0> cvsp0;
+
+// dynamic -> dynamic
+ {
+ std::span<const int> s1{ sp}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{ sp}; // a span< volatile int> pointing at int.
+ std::span<const volatile int> s3{ sp}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int> s4{ vsp}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 0);
+ }
+
+// static -> static
+ {
+ std::span<const int, 0> s1{ sp0}; // a span<const int> pointing at int.
+ std::span< volatile int, 0> s2{ sp0}; // a span< volatile int> pointing at int.
+ std::span<const volatile int, 0> s3{ sp0}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int, 0> s4{ vsp0}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 0);
+ }
+
+// static -> dynamic
+ {
+ std::span<const int> s1{ sp0}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{ sp0}; // a span< volatile int> pointing at int.
+ std::span<const volatile int> s3{ sp0}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int> s4{ vsp0}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 0);
+ }
+
+// dynamic -> static
+ {
+ std::span<const int, 0> s1{ sp}; // a span<const int> pointing at int.
+ std::span< volatile int, 0> s2{ sp}; // a span< volatile int> pointing at int.
+ std::span<const volatile int, 0> s3{ sp}; // a span<const volatile int> pointing at int.
+ std::span<const volatile int, 0> s4{ vsp}; // a span<const volatile int> pointing at volatile int.
+ assert(s1.size() + s2.size() + s3.size() + s4.size() == 0);
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ std::span<T> s0{};
+ std::span<T, 0> s1(s0); // dynamic -> static
+ std::span<T> s2(s1); // static -> dynamic
+ ASSERT_NOEXCEPT(std::span<T> {s0});
+ ASSERT_NOEXCEPT(std::span<T, 0>{s1});
+ ASSERT_NOEXCEPT(std::span<T> {s1});
+ ASSERT_NOEXCEPT(std::span<T, 0>{s0});
+
+ return
+ s1.data() == nullptr && s1.size() == 0
+ && s2.data() == nullptr && s2.size() == 0;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ std::span<T> s0{};
+ std::span<T, 0> s1(s0); // dynamic -> static
+ std::span<T> s2(s1); // static -> dynamic
+ ASSERT_NOEXCEPT(std::span<T> {s0});
+ ASSERT_NOEXCEPT(std::span<T, 0>{s1});
+ ASSERT_NOEXCEPT(std::span<T> {s1});
+ ASSERT_NOEXCEPT(std::span<T, 0>{s0});
+
+ assert(s1.data() == nullptr && s1.size() == 0);
+ assert(s2.data() == nullptr && s2.size() == 0);
+}
+
+
+template <typename Dest, typename Src>
+bool testConversionSpan()
+{
+ static_assert(std::is_convertible_v<Src(*)[], Dest(*)[]>, "Bad input types to 'testConversionSpan");
+ std::span<Src> s0d{};
+ std::span<Src> s0s{};
+ std::span<Dest, 0> s1(s0d); // dynamic -> static
+ std::span<Dest> s2(s0s); // static -> dynamic
+ s1.data() == nullptr && s1.size() == 0
+ && s2.data() == nullptr && s2.size() == 0;
+}
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+// TODO: Add some conversion tests here that aren't "X --> const X"
+// assert((testConversionSpan<unsigned char, char>()));
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.cons/stdarray.pass.cpp b/test/std/containers/views/span.cons/stdarray.pass.cpp
new file mode 100644
index 000000000000..1832ac2ba497
--- /dev/null
+++ b/test/std/containers/views/span.cons/stdarray.pass.cpp
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<size_t N>
+// constexpr span(array<value_type, N>& arr) noexcept;
+// template<size_t N>
+// constexpr span(const array<value_type, N>& arr) noexcept;
+//
+// Remarks: These constructors shall not participate in overload resolution unless:
+// — extent == dynamic_extent || N == extent is true, and
+// — remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[].
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+
+void checkCV()
+{
+ std::array<int, 3> arr = {1,2,3};
+// STL says these are not cromulent
+// std::array<const int,3> carr = {4,5,6};
+// std::array<volatile int, 3> varr = {7,8,9};
+// std::array<const volatile int, 3> cvarr = {1,3,5};
+
+// Types the same (dynamic sized)
+ {
+ std::span< int> s1{ arr}; // a span< int> pointing at int.
+ }
+
+// Types the same (static sized)
+ {
+ std::span< int,3> s1{ arr}; // a span< int> pointing at int.
+ }
+
+
+// types different (dynamic sized)
+ {
+ std::span<const int> s1{ arr}; // a span<const int> pointing at int.
+ std::span< volatile int> s2{ arr}; // a span< volatile int> pointing at int.
+ std::span< volatile int> s3{ arr}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int> s4{ arr}; // a span<const volatile int> pointing at int.
+ }
+
+// types different (static sized)
+ {
+ std::span<const int,3> s1{ arr}; // a span<const int> pointing at int.
+ std::span< volatile int,3> s2{ arr}; // a span< volatile int> pointing at int.
+ std::span< volatile int,3> s3{ arr}; // a span< volatile int> pointing at const int.
+ std::span<const volatile int,3> s4{ arr}; // a span<const volatile int> pointing at int.
+ }
+}
+
+
+template <typename T>
+constexpr bool testConstexprSpan()
+{
+ constexpr std::array<T,2> val = { T(), T() };
+ ASSERT_NOEXCEPT(std::span<const T> {val});
+ ASSERT_NOEXCEPT(std::span<const T, 2>{val});
+ std::span<const T> s1{val};
+ std::span<const T, 2> s2{val};
+ return
+ s1.data() == &val[0] && s1.size() == 2
+ && s2.data() == &val[0] && s2.size() == 2;
+}
+
+
+template <typename T>
+void testRuntimeSpan()
+{
+ std::array<T,2> val;
+ ASSERT_NOEXCEPT(std::span<T> {val});
+ ASSERT_NOEXCEPT(std::span<T, 2>{val});
+ std::span<T> s1{val};
+ std::span<T, 2> s2{val};
+ assert(s1.data() == &val[0] && s1.size() == 2);
+ assert(s2.data() == &val[0] && s2.size() == 2);
+}
+
+struct A{};
+
+int main ()
+{
+ static_assert(testConstexprSpan<int>(), "");
+ static_assert(testConstexprSpan<long>(), "");
+ static_assert(testConstexprSpan<double>(), "");
+ static_assert(testConstexprSpan<A>(), "");
+
+ testRuntimeSpan<int>();
+ testRuntimeSpan<long>();
+ testRuntimeSpan<double>();
+ testRuntimeSpan<std::string>();
+ testRuntimeSpan<A>();
+
+ checkCV();
+}
diff --git a/test/std/containers/views/span.elem/data.pass.cpp b/test/std/containers/views/span.elem/data.pass.cpp
new file mode 100644
index 000000000000..3bc6fbbe5768
--- /dev/null
+++ b/test/std/containers/views/span.elem/data.pass.cpp
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr pointer data() const noexcept;
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+template <typename Span>
+constexpr bool testConstexprSpan(Span sp, typename Span::pointer ptr)
+{
+ ASSERT_NOEXCEPT(sp.data());
+ return sp.data() == ptr;
+}
+
+
+template <typename Span>
+void testRuntimeSpan(Span sp, typename Span::pointer ptr)
+{
+ ASSERT_NOEXCEPT(sp.data());
+ assert(sp.data() == ptr);
+}
+
+struct A{};
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+int main ()
+{
+
+// dynamic size
+ static_assert(testConstexprSpan(std::span<int>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<long>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<double>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<A>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<std::string>(), nullptr), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), iArr1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), iArr1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), iArr1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), iArr1), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1 + 1, 1), iArr1 + 1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1 + 2, 2), iArr1 + 2), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1 + 3, 3), iArr1 + 3), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1 + 4, 4), iArr1 + 4), "");
+
+// static size
+ static_assert(testConstexprSpan(std::span<int, 0>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<long, 0>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<double, 0>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<A, 0>(), nullptr), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>(), nullptr), "");
+
+ static_assert(testConstexprSpan(std::span<const int, 1>(iArr1, 1), iArr1), "");
+ static_assert(testConstexprSpan(std::span<const int, 2>(iArr1, 2), iArr1), "");
+ static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), iArr1), "");
+ static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), iArr1), "");
+
+ static_assert(testConstexprSpan(std::span<const int, 1>(iArr1 + 1, 1), iArr1 + 1), "");
+ static_assert(testConstexprSpan(std::span<const int, 2>(iArr1 + 2, 2), iArr1 + 2), "");
+ static_assert(testConstexprSpan(std::span<const int, 3>(iArr1 + 3, 3), iArr1 + 3), "");
+ static_assert(testConstexprSpan(std::span<const int, 4>(iArr1 + 4, 4), iArr1 + 4), "");
+
+
+// dynamic size
+ testRuntimeSpan(std::span<int>(), nullptr);
+ testRuntimeSpan(std::span<long>(), nullptr);
+ testRuntimeSpan(std::span<double>(), nullptr);
+ testRuntimeSpan(std::span<A>(), nullptr);
+ testRuntimeSpan(std::span<std::string>(), nullptr);
+
+ testRuntimeSpan(std::span<int>(iArr2, 1), iArr2);
+ testRuntimeSpan(std::span<int>(iArr2, 2), iArr2);
+ testRuntimeSpan(std::span<int>(iArr2, 3), iArr2);
+ testRuntimeSpan(std::span<int>(iArr2, 4), iArr2);
+
+ testRuntimeSpan(std::span<int>(iArr2 + 1, 1), iArr2 + 1);
+ testRuntimeSpan(std::span<int>(iArr2 + 2, 2), iArr2 + 2);
+ testRuntimeSpan(std::span<int>(iArr2 + 3, 3), iArr2 + 3);
+ testRuntimeSpan(std::span<int>(iArr2 + 4, 4), iArr2 + 4);
+
+// static size
+ testRuntimeSpan(std::span<int, 0>(), nullptr);
+ testRuntimeSpan(std::span<long, 0>(), nullptr);
+ testRuntimeSpan(std::span<double, 0>(), nullptr);
+ testRuntimeSpan(std::span<A, 0>(), nullptr);
+ testRuntimeSpan(std::span<std::string, 0>(), nullptr);
+
+ testRuntimeSpan(std::span<int, 1>(iArr2, 1), iArr2);
+ testRuntimeSpan(std::span<int, 2>(iArr2, 2), iArr2);
+ testRuntimeSpan(std::span<int, 3>(iArr2, 3), iArr2);
+ testRuntimeSpan(std::span<int, 4>(iArr2, 4), iArr2);
+
+ testRuntimeSpan(std::span<int, 1>(iArr2 + 1, 1), iArr2 + 1);
+ testRuntimeSpan(std::span<int, 2>(iArr2 + 2, 2), iArr2 + 2);
+ testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3), iArr2 + 3);
+ testRuntimeSpan(std::span<int, 4>(iArr2 + 4, 4), iArr2 + 4);
+
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, 1), &s);
+ testRuntimeSpan(std::span<std::string, 1>(&s, 1), &s);
+
+}
diff --git a/test/std/containers/views/span.elem/op_idx.pass.cpp b/test/std/containers/views/span.elem/op_idx.pass.cpp
new file mode 100644
index 000000000000..a88f4410427a
--- /dev/null
+++ b/test/std/containers/views/span.elem/op_idx.pass.cpp
@@ -0,0 +1,119 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr reference operator[](index_type idx) const;
+// constexpr reference operator()(index_type idx) const;
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+template <typename Span>
+constexpr bool testConstexprSpan(Span sp, ptrdiff_t idx)
+{
+ _LIBCPP_ASSERT(noexcept(sp[idx]), "");
+ _LIBCPP_ASSERT(noexcept(sp(idx)), "");
+
+ typename Span::reference r1 = sp[idx];
+ typename Span::reference r2 = sp(idx);
+ typename Span::reference r3 = *(sp.data() + idx);
+ return r1 == r2 && r2 == r3;
+}
+
+
+template <typename Span>
+void testRuntimeSpan(Span sp, ptrdiff_t idx)
+{
+ _LIBCPP_ASSERT(noexcept(sp[idx]), "");
+ _LIBCPP_ASSERT(noexcept(sp(idx)), "");
+
+ typename Span::reference r1 = sp[idx];
+ typename Span::reference r2 = sp(idx);
+ typename Span::reference r3 = *(sp.data() + idx);
+ assert(r1 == r2 && r2 == r3);
+}
+
+struct A{};
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+int main ()
+{
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), 0), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 0), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 1), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 0), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 2), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 0), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 2), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 3), "");
+
+
+ static_assert(testConstexprSpan(std::span<const int, 1>(iArr1, 1), 0), "");
+
+ static_assert(testConstexprSpan(std::span<const int, 2>(iArr1, 2), 0), "");
+ static_assert(testConstexprSpan(std::span<const int, 2>(iArr1, 2), 1), "");
+
+ static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), 0), "");
+ static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), 1), "");
+ static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), 2), "");
+
+ static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 0), "");
+ static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 1), "");
+ static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 2), "");
+ static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 3), "");
+
+
+ testRuntimeSpan(std::span<int>(iArr2, 1), 0);
+
+ testRuntimeSpan(std::span<int>(iArr2, 2), 0);
+ testRuntimeSpan(std::span<int>(iArr2, 2), 1);
+
+ testRuntimeSpan(std::span<int>(iArr2, 3), 0);
+ testRuntimeSpan(std::span<int>(iArr2, 3), 1);
+ testRuntimeSpan(std::span<int>(iArr2, 3), 2);
+
+ testRuntimeSpan(std::span<int>(iArr2, 4), 0);
+ testRuntimeSpan(std::span<int>(iArr2, 4), 1);
+ testRuntimeSpan(std::span<int>(iArr2, 4), 2);
+ testRuntimeSpan(std::span<int>(iArr2, 4), 3);
+
+
+ testRuntimeSpan(std::span<int, 1>(iArr2, 1), 0);
+
+ testRuntimeSpan(std::span<int, 2>(iArr2, 2), 0);
+ testRuntimeSpan(std::span<int, 2>(iArr2, 2), 1);
+
+ testRuntimeSpan(std::span<int, 3>(iArr2, 3), 0);
+ testRuntimeSpan(std::span<int, 3>(iArr2, 3), 1);
+ testRuntimeSpan(std::span<int, 3>(iArr2, 3), 2);
+
+ testRuntimeSpan(std::span<int, 4>(iArr2, 4), 0);
+ testRuntimeSpan(std::span<int, 4>(iArr2, 4), 1);
+ testRuntimeSpan(std::span<int, 4>(iArr2, 4), 2);
+ testRuntimeSpan(std::span<int, 4>(iArr2, 4), 3);
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string> (&s, 1), 0);
+ testRuntimeSpan(std::span<std::string, 1>(&s, 1), 0);
+}
diff --git a/test/std/containers/views/span.iterators/begin.pass.cpp b/test/std/containers/views/span.iterators/begin.pass.cpp
new file mode 100644
index 000000000000..c8b9900bc151
--- /dev/null
+++ b/test/std/containers/views/span.iterators/begin.pass.cpp
@@ -0,0 +1,116 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr iterator begin() const noexcept;
+// constexpr const_iterator cbegin() const noexcept;
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template <class Span>
+constexpr bool testConstexprSpan(Span s)
+{
+ bool ret = true;
+ typename Span::iterator b = s. begin();
+ typename Span::const_iterator cb = s.cbegin();
+
+ if (s.empty())
+ {
+ ret = ret && ( b == s.end());
+ ret = ret && (cb == s.cend());
+ }
+ else
+ {
+ ret = ret && ( *b == s[0]);
+ ret = ret && ( &*b == &s[0]);
+ ret = ret && ( *cb == s[0]);
+ ret = ret && (&*cb == &s[0]);
+ }
+ ret = ret && (b == cb);
+ return ret;
+}
+
+
+template <class Span>
+void testRuntimeSpan(Span s)
+{
+ typename Span::iterator b = s. begin();
+ typename Span::const_iterator cb = s.cbegin();
+
+ if (s.empty())
+ {
+ assert( b == s.end());
+ assert(cb == s.cend());
+ }
+ else
+ {
+ assert( *b == s[0]);
+ assert( &*b == &s[0]);
+ assert( *cb == s[0]);
+ assert(&*cb == &s[0]);
+ }
+ assert(b == cb);
+}
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+
+int main()
+{
+ static_assert(testConstexprSpan(std::span<int>()), "");
+ static_assert(testConstexprSpan(std::span<long>()), "");
+ static_assert(testConstexprSpan(std::span<double>()), "");
+ static_assert(testConstexprSpan(std::span<A>()), "");
+ static_assert(testConstexprSpan(std::span<std::string>()), "");
+
+ static_assert(testConstexprSpan(std::span<int, 0>()), "");
+ static_assert(testConstexprSpan(std::span<long, 0>()), "");
+ static_assert(testConstexprSpan(std::span<double, 0>()), "");
+ static_assert(testConstexprSpan(std::span<A, 0>()), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>()), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), "");
+
+
+ testRuntimeSpan(std::span<int> ());
+ testRuntimeSpan(std::span<long> ());
+ testRuntimeSpan(std::span<double> ());
+ testRuntimeSpan(std::span<A> ());
+ testRuntimeSpan(std::span<std::string>());
+
+ testRuntimeSpan(std::span<int, 0> ());
+ testRuntimeSpan(std::span<long, 0> ());
+ testRuntimeSpan(std::span<double, 0> ());
+ testRuntimeSpan(std::span<A, 0> ());
+ testRuntimeSpan(std::span<std::string, 0>());
+
+ testRuntimeSpan(std::span<int>(iArr2, 1));
+ testRuntimeSpan(std::span<int>(iArr2, 2));
+ testRuntimeSpan(std::span<int>(iArr2, 3));
+ testRuntimeSpan(std::span<int>(iArr2, 4));
+ testRuntimeSpan(std::span<int>(iArr2, 5));
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0));
+ testRuntimeSpan(std::span<std::string>(&s, 1));
+}
diff --git a/test/std/containers/views/span.iterators/end.pass.cpp b/test/std/containers/views/span.iterators/end.pass.cpp
new file mode 100644
index 000000000000..2b64b0f4b541
--- /dev/null
+++ b/test/std/containers/views/span.iterators/end.pass.cpp
@@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr iterator end() const noexcept;
+// constexpr const_iterator cend() const noexcept;
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template <class Span>
+constexpr bool testConstexprSpan(Span s)
+{
+ bool ret = true;
+ typename Span::iterator e = s. end();
+ typename Span::const_iterator ce = s.cend();
+ if (s.empty())
+ {
+ ret = ret && ( e == s.begin());
+ ret = ret && (ce == s.cbegin());
+ }
+ else
+ {
+ ret = ret && ( e != s.begin());
+ ret = ret && (ce != s.cbegin());
+ }
+
+ ret = ret && (( e - s.begin()) == s.size());
+ ret = ret && ((ce - s.cbegin()) == s.size());
+
+ ret = ret && (e == ce);
+ return ret;
+}
+
+template <class Span>
+void testRuntimeSpan(Span s)
+{
+ typename Span::iterator e = s. end();
+ typename Span::const_iterator ce = s.cend();
+ if (s.empty())
+ {
+ assert( e == s.begin());
+ assert(ce == s.cbegin());
+ }
+ else
+ {
+ assert( e != s.begin());
+ assert(ce != s.cbegin());
+ }
+
+ assert(( e - s.begin()) == s.size());
+ assert((ce - s.cbegin()) == s.size());
+
+ assert(e == ce);
+}
+
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+
+int main()
+{
+ static_assert(testConstexprSpan(std::span<int>()), "");
+ static_assert(testConstexprSpan(std::span<long>()), "");
+ static_assert(testConstexprSpan(std::span<double>()), "");
+ static_assert(testConstexprSpan(std::span<A>()), "");
+ static_assert(testConstexprSpan(std::span<std::string>()), "");
+
+ static_assert(testConstexprSpan(std::span<int, 0>()), "");
+ static_assert(testConstexprSpan(std::span<long, 0>()), "");
+ static_assert(testConstexprSpan(std::span<double, 0>()), "");
+ static_assert(testConstexprSpan(std::span<A, 0>()), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>()), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), "");
+
+
+ testRuntimeSpan(std::span<int> ());
+ testRuntimeSpan(std::span<long> ());
+ testRuntimeSpan(std::span<double> ());
+ testRuntimeSpan(std::span<A> ());
+ testRuntimeSpan(std::span<std::string>());
+
+ testRuntimeSpan(std::span<int, 0> ());
+ testRuntimeSpan(std::span<long, 0> ());
+ testRuntimeSpan(std::span<double, 0> ());
+ testRuntimeSpan(std::span<A, 0> ());
+ testRuntimeSpan(std::span<std::string, 0>());
+
+ testRuntimeSpan(std::span<int>(iArr2, 1));
+ testRuntimeSpan(std::span<int>(iArr2, 2));
+ testRuntimeSpan(std::span<int>(iArr2, 3));
+ testRuntimeSpan(std::span<int>(iArr2, 4));
+ testRuntimeSpan(std::span<int>(iArr2, 5));
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0));
+ testRuntimeSpan(std::span<std::string>(&s, 1));
+}
diff --git a/test/std/containers/views/span.iterators/rbegin.pass.cpp b/test/std/containers/views/span.iterators/rbegin.pass.cpp
new file mode 100644
index 000000000000..c0776c00a81b
--- /dev/null
+++ b/test/std/containers/views/span.iterators/rbegin.pass.cpp
@@ -0,0 +1,117 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr reverse_iterator rbegin() const noexcept;
+// constexpr const_reverse_iterator crbegin() const noexcept;
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template <class Span>
+constexpr bool testConstexprSpan(Span s)
+{
+ bool ret = true;
+ typename Span::reverse_iterator b = s. rbegin();
+ typename Span::const_reverse_iterator cb = s.crbegin();
+ if (s.empty())
+ {
+ ret = ret && ( b == s.rend());
+ ret = ret && (cb == s.crend());
+ }
+ else
+ {
+ const typename Span::index_type last = s.size() - 1;
+ ret = ret && ( *b == s[last]);
+ ret = ret && ( &*b == &s[last]);
+ ret = ret && ( *cb == s[last]);
+ ret = ret && (&*cb == &s[last]);
+ }
+ ret = ret && (b == cb);
+ return ret;
+}
+
+
+template <class Span>
+void testRuntimeSpan(Span s)
+{
+ typename Span::reverse_iterator b = s. rbegin();
+ typename Span::const_reverse_iterator cb = s.crbegin();
+ if (s.empty())
+ {
+ assert( b == s.rend());
+ assert(cb == s.crend());
+ }
+ else
+ {
+ const typename Span::index_type last = s.size() - 1;
+ assert( *b == s[last]);
+ assert( &*b == &s[last]);
+ assert( *cb == s[last]);
+ assert(&*cb == &s[last]);
+ }
+ assert(b == cb);
+}
+
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+
+int main()
+{
+ static_assert(testConstexprSpan(std::span<int>()), "");
+ static_assert(testConstexprSpan(std::span<long>()), "");
+ static_assert(testConstexprSpan(std::span<double>()), "");
+ static_assert(testConstexprSpan(std::span<A>()), "");
+ static_assert(testConstexprSpan(std::span<std::string>()), "");
+
+ static_assert(testConstexprSpan(std::span<int, 0>()), "");
+ static_assert(testConstexprSpan(std::span<long, 0>()), "");
+ static_assert(testConstexprSpan(std::span<double, 0>()), "");
+ static_assert(testConstexprSpan(std::span<A, 0>()), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>()), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), "");
+
+
+ testRuntimeSpan(std::span<int> ());
+ testRuntimeSpan(std::span<long> ());
+ testRuntimeSpan(std::span<double> ());
+ testRuntimeSpan(std::span<A> ());
+ testRuntimeSpan(std::span<std::string>());
+
+ testRuntimeSpan(std::span<int, 0> ());
+ testRuntimeSpan(std::span<long, 0> ());
+ testRuntimeSpan(std::span<double, 0> ());
+ testRuntimeSpan(std::span<A, 0> ());
+ testRuntimeSpan(std::span<std::string, 0>());
+
+ testRuntimeSpan(std::span<int>(iArr2, 1));
+ testRuntimeSpan(std::span<int>(iArr2, 2));
+ testRuntimeSpan(std::span<int>(iArr2, 3));
+ testRuntimeSpan(std::span<int>(iArr2, 4));
+ testRuntimeSpan(std::span<int>(iArr2, 5));
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, static_cast<std::ptrdiff_t>(0)));
+ testRuntimeSpan(std::span<std::string>(&s, 1));
+}
diff --git a/test/std/containers/views/span.iterators/rend.pass.cpp b/test/std/containers/views/span.iterators/rend.pass.cpp
new file mode 100644
index 000000000000..abcead445e1d
--- /dev/null
+++ b/test/std/containers/views/span.iterators/rend.pass.cpp
@@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr reverse_iterator rend() const noexcept;
+// constexpr const_reverse_iterator crend() const noexcept;
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template <class Span>
+constexpr bool testConstexprSpan(Span s)
+{
+ bool ret = true;
+ typename Span::reverse_iterator e = s. rend();
+ typename Span::const_reverse_iterator ce = s.crend();
+ if (s.empty())
+ {
+ ret = ret && ( e == s.rbegin());
+ ret = ret && (ce == s.crbegin());
+ }
+ else
+ {
+ ret = ret && ( e != s.rbegin());
+ ret = ret && (ce != s.crbegin());
+ }
+
+ ret = ret && (( e - s.rbegin()) == s.size());
+ ret = ret && ((ce - s.crbegin()) == s.size());
+
+ ret = ret && (e == ce);
+ return ret;
+}
+
+template <class Span>
+void testRuntimeSpan(Span s)
+{
+ typename Span::reverse_iterator e = s. rend();
+ typename Span::const_reverse_iterator ce = s.crend();
+ if (s.empty())
+ {
+ assert( e == s.rbegin());
+ assert(ce == s.crbegin());
+ }
+ else
+ {
+ assert( e != s.rbegin());
+ assert(ce != s.crbegin());
+ }
+
+ assert(( e - s.rbegin()) == s.size());
+ assert((ce - s.crbegin()) == s.size());
+
+ assert(e == ce);
+}
+
+
+struct A{};
+bool operator==(A, A) {return true;}
+
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+
+int main()
+{
+ static_assert(testConstexprSpan(std::span<int>()), "");
+ static_assert(testConstexprSpan(std::span<long>()), "");
+ static_assert(testConstexprSpan(std::span<double>()), "");
+ static_assert(testConstexprSpan(std::span<A>()), "");
+ static_assert(testConstexprSpan(std::span<std::string>()), "");
+
+ static_assert(testConstexprSpan(std::span<int, 0>()), "");
+ static_assert(testConstexprSpan(std::span<long, 0>()), "");
+ static_assert(testConstexprSpan(std::span<double, 0>()), "");
+ static_assert(testConstexprSpan(std::span<A, 0>()), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>()), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), "");
+
+
+ testRuntimeSpan(std::span<int> ());
+ testRuntimeSpan(std::span<long> ());
+ testRuntimeSpan(std::span<double> ());
+ testRuntimeSpan(std::span<A> ());
+ testRuntimeSpan(std::span<std::string>());
+
+ testRuntimeSpan(std::span<int, 0> ());
+ testRuntimeSpan(std::span<long, 0> ());
+ testRuntimeSpan(std::span<double, 0> ());
+ testRuntimeSpan(std::span<A, 0> ());
+ testRuntimeSpan(std::span<std::string, 0>());
+
+ testRuntimeSpan(std::span<int>(iArr2, 1));
+ testRuntimeSpan(std::span<int>(iArr2, 2));
+ testRuntimeSpan(std::span<int>(iArr2, 3));
+ testRuntimeSpan(std::span<int>(iArr2, 4));
+ testRuntimeSpan(std::span<int>(iArr2, 5));
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0));
+ testRuntimeSpan(std::span<std::string>(&s, 1));
+}
diff --git a/test/std/containers/views/span.objectrep/as_bytes.pass.cpp b/test/std/containers/views/span.objectrep/as_bytes.pass.cpp
new file mode 100644
index 000000000000..b081b95c373e
--- /dev/null
+++ b/test/std/containers/views/span.objectrep/as_bytes.pass.cpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template <class ElementType, ptrdiff_t Extent>
+// span<const byte,
+// Extent == dynamic_extent
+// ? dynamic_extent
+// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent>
+// as_bytes(span<ElementType, Extent> s) noexcept;
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template<typename Span>
+void testRuntimeSpan(Span sp)
+{
+ ASSERT_NOEXCEPT(std::as_bytes(sp));
+
+ auto spBytes = std::as_bytes(sp);
+ using SB = decltype(spBytes);
+ ASSERT_SAME_TYPE(const std::byte, typename SB::element_type);
+
+ if (sp.extent == std::dynamic_extent)
+ assert(spBytes.extent == std::dynamic_extent);
+ else
+ assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
+
+ assert((void *) spBytes.data() == (void *) sp.data());
+ assert(spBytes.size() == sp.size_bytes());
+}
+
+struct A{};
+int iArr2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+int main ()
+{
+ testRuntimeSpan(std::span<int> ());
+ testRuntimeSpan(std::span<long> ());
+ testRuntimeSpan(std::span<double> ());
+ testRuntimeSpan(std::span<A> ());
+ testRuntimeSpan(std::span<std::string>());
+
+ testRuntimeSpan(std::span<int, 0> ());
+ testRuntimeSpan(std::span<long, 0> ());
+ testRuntimeSpan(std::span<double, 0> ());
+ testRuntimeSpan(std::span<A, 0> ());
+ testRuntimeSpan(std::span<std::string, 0>());
+
+ testRuntimeSpan(std::span<int>(iArr2, 1));
+ testRuntimeSpan(std::span<int>(iArr2, 2));
+ testRuntimeSpan(std::span<int>(iArr2, 3));
+ testRuntimeSpan(std::span<int>(iArr2, 4));
+ testRuntimeSpan(std::span<int>(iArr2, 5));
+
+ testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1));
+ testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2));
+ testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3));
+ testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4));
+ testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5));
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0));
+ testRuntimeSpan(std::span<std::string>(&s, 1));
+}
diff --git a/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp b/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp
new file mode 100644
index 000000000000..28a4c45d2477
--- /dev/null
+++ b/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template <class ElementType, ptrdiff_t Extent>
+// span<byte,
+// Extent == dynamic_extent
+// ? dynamic_extent
+// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent>
+// as_writeable_bytes(span<ElementType, Extent> s) noexcept;
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+const int iArr2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+struct A {};
+
+int main ()
+{
+ std::as_writeable_bytes(std::span<const int>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const long>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const double>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const A>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const std::string>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+
+ std::as_writeable_bytes(std::span<const int, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const long, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const double, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const A, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const std::string, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+
+ std::as_writeable_bytes(std::span<const int> (iArr2, 1)); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+ std::as_writeable_bytes(std::span<const int, 1>(iArr2 + 5, 1)); // expected-error {{no matching function for call to 'as_writeable_bytes'}}
+}
diff --git a/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp b/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp
new file mode 100644
index 000000000000..24e3fb273499
--- /dev/null
+++ b/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template <class ElementType, ptrdiff_t Extent>
+// span<byte,
+// Extent == dynamic_extent
+// ? dynamic_extent
+// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent>
+// as_writeable_bytes(span<ElementType, Extent> s) noexcept;
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+template<typename Span>
+void testRuntimeSpan(Span sp)
+{
+ ASSERT_NOEXCEPT(std::as_writeable_bytes(sp));
+
+ auto spBytes = std::as_writeable_bytes(sp);
+ using SB = decltype(spBytes);
+ ASSERT_SAME_TYPE(std::byte, typename SB::element_type);
+
+ if (sp.extent == std::dynamic_extent)
+ assert(spBytes.extent == std::dynamic_extent);
+ else
+ assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
+
+ assert(static_cast<void*>(spBytes.data()) == static_cast<void*>(sp.data()));
+ assert(spBytes.size() == sp.size_bytes());
+}
+
+struct A{};
+int iArr2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+int main ()
+{
+ testRuntimeSpan(std::span<int> ());
+ testRuntimeSpan(std::span<long> ());
+ testRuntimeSpan(std::span<double> ());
+ testRuntimeSpan(std::span<A> ());
+ testRuntimeSpan(std::span<std::string>());
+
+ testRuntimeSpan(std::span<int, 0> ());
+ testRuntimeSpan(std::span<long, 0> ());
+ testRuntimeSpan(std::span<double, 0> ());
+ testRuntimeSpan(std::span<A, 0> ());
+ testRuntimeSpan(std::span<std::string, 0>());
+
+ testRuntimeSpan(std::span<int>(iArr2, 1));
+ testRuntimeSpan(std::span<int>(iArr2, 2));
+ testRuntimeSpan(std::span<int>(iArr2, 3));
+ testRuntimeSpan(std::span<int>(iArr2, 4));
+ testRuntimeSpan(std::span<int>(iArr2, 5));
+
+ testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1));
+ testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2));
+ testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3));
+ testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4));
+ testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5));
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0));
+ testRuntimeSpan(std::span<std::string>(&s, 1));
+}
diff --git a/test/std/containers/views/span.obs/empty.pass.cpp b/test/std/containers/views/span.obs/empty.pass.cpp
new file mode 100644
index 000000000000..a48c0d02494b
--- /dev/null
+++ b/test/std/containers/views/span.obs/empty.pass.cpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr bool empty() const noexcept;
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+struct A{};
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+int main ()
+{
+ static_assert( noexcept(std::span<int> ().empty()), "");
+ static_assert( noexcept(std::span<int, 0>().empty()), "");
+
+
+ static_assert( std::span<int>().empty(), "");
+ static_assert( std::span<long>().empty(), "");
+ static_assert( std::span<double>().empty(), "");
+ static_assert( std::span<A>().empty(), "");
+ static_assert( std::span<std::string>().empty(), "");
+
+ static_assert( std::span<int, 0>().empty(), "");
+ static_assert( std::span<long, 0>().empty(), "");
+ static_assert( std::span<double, 0>().empty(), "");
+ static_assert( std::span<A, 0>().empty(), "");
+ static_assert( std::span<std::string, 0>().empty(), "");
+
+ static_assert(!std::span<const int>(iArr1, 1).empty(), "");
+ static_assert(!std::span<const int>(iArr1, 2).empty(), "");
+ static_assert(!std::span<const int>(iArr1, 3).empty(), "");
+ static_assert(!std::span<const int>(iArr1, 4).empty(), "");
+ static_assert(!std::span<const int>(iArr1, 5).empty(), "");
+
+ assert( (std::span<int>().empty() ));
+ assert( (std::span<long>().empty() ));
+ assert( (std::span<double>().empty() ));
+ assert( (std::span<A>().empty() ));
+ assert( (std::span<std::string>().empty() ));
+
+ assert( (std::span<int, 0>().empty() ));
+ assert( (std::span<long, 0>().empty() ));
+ assert( (std::span<double, 0>().empty() ));
+ assert( (std::span<A, 0>().empty() ));
+ assert( (std::span<std::string, 0>().empty()));
+
+ assert(!(std::span<int, 1>(iArr2, 1).empty()));
+ assert(!(std::span<int, 2>(iArr2, 2).empty()));
+ assert(!(std::span<int, 3>(iArr2, 3).empty()));
+ assert(!(std::span<int, 4>(iArr2, 4).empty()));
+ assert(!(std::span<int, 5>(iArr2, 5).empty()));
+
+ std::string s;
+ assert( ((std::span<std::string>(&s, (std::ptrdiff_t) 0)).empty()));
+ assert(!((std::span<std::string>(&s, 1).empty())));
+}
diff --git a/test/std/containers/views/span.obs/size.pass.cpp b/test/std/containers/views/span.obs/size.pass.cpp
new file mode 100644
index 000000000000..c33fd3f6c61b
--- /dev/null
+++ b/test/std/containers/views/span.obs/size.pass.cpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr index_type size() const noexcept;
+//
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+template <typename Span>
+constexpr bool testConstexprSpan(Span sp, ptrdiff_t sz)
+{
+ ASSERT_NOEXCEPT(sp.size());
+ return sp.size() == sz;
+}
+
+
+template <typename Span>
+void testRuntimeSpan(Span sp, ptrdiff_t sz)
+{
+ ASSERT_NOEXCEPT(sp.size());
+ assert(sp.size() == sz);
+}
+
+struct A{};
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+int main ()
+{
+ static_assert(testConstexprSpan(std::span<int>(), 0), "");
+ static_assert(testConstexprSpan(std::span<long>(), 0), "");
+ static_assert(testConstexprSpan(std::span<double>(), 0), "");
+ static_assert(testConstexprSpan(std::span<A>(), 0), "");
+ static_assert(testConstexprSpan(std::span<std::string>(), 0), "");
+
+ static_assert(testConstexprSpan(std::span<int, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<long, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<double, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<A, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>(), 0), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), 1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 2), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 3), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 4), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 5), 5), "");
+
+ testRuntimeSpan(std::span<int> (), 0);
+ testRuntimeSpan(std::span<long> (), 0);
+ testRuntimeSpan(std::span<double> (), 0);
+ testRuntimeSpan(std::span<A> (), 0);
+ testRuntimeSpan(std::span<std::string>(), 0);
+
+ testRuntimeSpan(std::span<int, 0> (), 0);
+ testRuntimeSpan(std::span<long, 0> (), 0);
+ testRuntimeSpan(std::span<double, 0> (), 0);
+ testRuntimeSpan(std::span<A, 0> (), 0);
+ testRuntimeSpan(std::span<std::string, 0>(), 0);
+
+ testRuntimeSpan(std::span<int>(iArr2, 1), 1);
+ testRuntimeSpan(std::span<int>(iArr2, 2), 2);
+ testRuntimeSpan(std::span<int>(iArr2, 3), 3);
+ testRuntimeSpan(std::span<int>(iArr2, 4), 4);
+ testRuntimeSpan(std::span<int>(iArr2, 5), 5);
+
+ testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1), 1);
+ testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2), 2);
+ testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3), 3);
+ testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4), 4);
+ testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5), 5);
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0), 0);
+ testRuntimeSpan(std::span<std::string>(&s, 1), 1);
+}
diff --git a/test/std/containers/views/span.obs/size_bytes.pass.cpp b/test/std/containers/views/span.obs/size_bytes.pass.cpp
new file mode 100644
index 000000000000..1ee75d9fcb79
--- /dev/null
+++ b/test/std/containers/views/span.obs/size_bytes.pass.cpp
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// constexpr index_type size_bytes() const noexcept;
+//
+// Effects: Equivalent to: return size() * sizeof(element_type);
+
+
+#include <span>
+#include <cassert>
+#include <string>
+
+#include "test_macros.h"
+
+
+template <typename Span>
+constexpr bool testConstexprSpan(Span sp, ptrdiff_t sz)
+{
+ ASSERT_NOEXCEPT(sp.size_bytes());
+ return (size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
+}
+
+
+template <typename Span>
+void testRuntimeSpan(Span sp, ptrdiff_t sz)
+{
+ ASSERT_NOEXCEPT(sp.size_bytes());
+ assert((size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
+}
+
+struct A{};
+constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+int main ()
+{
+ static_assert(testConstexprSpan(std::span<int>(), 0), "");
+ static_assert(testConstexprSpan(std::span<long>(), 0), "");
+ static_assert(testConstexprSpan(std::span<double>(), 0), "");
+ static_assert(testConstexprSpan(std::span<A>(), 0), "");
+ static_assert(testConstexprSpan(std::span<std::string>(), 0), "");
+
+ static_assert(testConstexprSpan(std::span<int, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<long, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<double, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<A, 0>(), 0), "");
+ static_assert(testConstexprSpan(std::span<std::string, 0>(), 0), "");
+
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), 1), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 2), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 3), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 4), "");
+ static_assert(testConstexprSpan(std::span<const int>(iArr1, 5), 5), "");
+
+ testRuntimeSpan(std::span<int> (), 0);
+ testRuntimeSpan(std::span<long> (), 0);
+ testRuntimeSpan(std::span<double> (), 0);
+ testRuntimeSpan(std::span<A> (), 0);
+ testRuntimeSpan(std::span<std::string>(), 0);
+
+ testRuntimeSpan(std::span<int, 0> (), 0);
+ testRuntimeSpan(std::span<long, 0> (), 0);
+ testRuntimeSpan(std::span<double, 0> (), 0);
+ testRuntimeSpan(std::span<A, 0> (), 0);
+ testRuntimeSpan(std::span<std::string, 0>(), 0);
+
+ testRuntimeSpan(std::span<int>(iArr2, 1), 1);
+ testRuntimeSpan(std::span<int>(iArr2, 2), 2);
+ testRuntimeSpan(std::span<int>(iArr2, 3), 3);
+ testRuntimeSpan(std::span<int>(iArr2, 4), 4);
+ testRuntimeSpan(std::span<int>(iArr2, 5), 5);
+
+ testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1), 1);
+ testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2), 2);
+ testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3), 3);
+ testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4), 4);
+ testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5), 5);
+
+ std::string s;
+ testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0), 0);
+ testRuntimeSpan(std::span<std::string>(&s, 1), 1);
+}
diff --git a/test/std/containers/views/span.sub/first.pass.cpp b/test/std/containers/views/span.sub/first.pass.cpp
new file mode 100644
index 000000000000..3bfdab9f8a55
--- /dev/null
+++ b/test/std/containers/views/span.sub/first.pass.cpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<ptrdiff_t Count>
+// constexpr span<element_type, Count> first() const;
+//
+// constexpr span<element_type, dynamic_extent> first(index_type count) const;
+//
+// Requires: 0 <= Count && Count <= size().
+
+
+#include <span>
+#include <cassert>
+#include <algorithm>
+#include <string>
+
+#include "test_macros.h"
+
+template <typename Span, ptrdiff_t Count>
+constexpr bool testConstexprSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
+ LIBCPP_ASSERT((noexcept(sp.first(Count))));
+ auto s1 = sp.template first<Count>();
+ auto s2 = sp.first(Count);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == Count, "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ return
+ s1.data() == s2.data()
+ && s1.size() == s2.size()
+ && std::equal(s1.begin(), s1.end(), sp.begin());
+}
+
+
+template <typename Span, ptrdiff_t Count>
+void testRuntimeSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
+ LIBCPP_ASSERT((noexcept(sp.first(Count))));
+ auto s1 = sp.template first<Count>();
+ auto s2 = sp.first(Count);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == Count, "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ assert(s1.data() == s2.data());
+ assert(s1.size() == s2.size());
+ assert(std::equal(s1.begin(), s1.end(), sp.begin()));
+}
+
+
+constexpr int carr1[] = {1,2,3,4};
+ int arr[] = {5,6,7};
+std::string sarr [] = { "ABC", "DEF", "GHI", "JKL", "MNO"};
+
+int main ()
+{
+ {
+ using Sp = std::span<const int>;
+ static_assert(testConstexprSpan<Sp, 0>(Sp{}), "");
+
+ static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<const int, 4>;
+
+ static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<int>;
+ testRuntimeSpan<Sp, 0>(Sp{});
+
+ testRuntimeSpan<Sp, 0>(Sp{arr});
+ testRuntimeSpan<Sp, 1>(Sp{arr});
+ testRuntimeSpan<Sp, 2>(Sp{arr});
+ testRuntimeSpan<Sp, 3>(Sp{arr});
+ }
+
+ {
+ using Sp = std::span<int, 3>;
+
+ testRuntimeSpan<Sp, 0>(Sp{arr});
+ testRuntimeSpan<Sp, 1>(Sp{arr});
+ testRuntimeSpan<Sp, 2>(Sp{arr});
+ testRuntimeSpan<Sp, 3>(Sp{arr});
+ }
+
+ {
+ using Sp = std::span<std::string>;
+ testConstexprSpan<Sp, 0>(Sp{});
+
+ testRuntimeSpan<Sp, 0>(Sp{sarr});
+ testRuntimeSpan<Sp, 1>(Sp{sarr});
+ testRuntimeSpan<Sp, 2>(Sp{sarr});
+ testRuntimeSpan<Sp, 3>(Sp{sarr});
+ testRuntimeSpan<Sp, 4>(Sp{sarr});
+ testRuntimeSpan<Sp, 5>(Sp{sarr});
+ }
+
+ {
+ using Sp = std::span<std::string, 5>;
+
+ testRuntimeSpan<Sp, 0>(Sp{sarr});
+ testRuntimeSpan<Sp, 1>(Sp{sarr});
+ testRuntimeSpan<Sp, 2>(Sp{sarr});
+ testRuntimeSpan<Sp, 3>(Sp{sarr});
+ testRuntimeSpan<Sp, 4>(Sp{sarr});
+ testRuntimeSpan<Sp, 5>(Sp{sarr});
+ }
+}
diff --git a/test/std/containers/views/span.sub/last.pass.cpp b/test/std/containers/views/span.sub/last.pass.cpp
new file mode 100644
index 000000000000..4e378fe549ed
--- /dev/null
+++ b/test/std/containers/views/span.sub/last.pass.cpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<ptrdiff_t Count>
+// constexpr span<element_type, Count> last() const;
+//
+// constexpr span<element_type, dynamic_extent> last(index_type count) const;
+//
+// Requires: 0 <= Count && Count <= size().
+
+
+#include <span>
+#include <cassert>
+#include <algorithm>
+#include <string>
+
+#include "test_macros.h"
+
+template <typename Span, ptrdiff_t Count>
+constexpr bool testConstexprSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
+ LIBCPP_ASSERT((noexcept(sp.last(Count))));
+ auto s1 = sp.template last<Count>();
+ auto s2 = sp.last(Count);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == Count, "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ return
+ s1.data() == s2.data()
+ && s1.size() == s2.size()
+ && std::equal(s1.begin(), s1.end(), sp.end() - Count);
+}
+
+
+template <typename Span, ptrdiff_t Count>
+void testRuntimeSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
+ LIBCPP_ASSERT((noexcept(sp.last(Count))));
+ auto s1 = sp.template last<Count>();
+ auto s2 = sp.last(Count);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == Count, "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ assert(s1.data() == s2.data());
+ assert(s1.size() == s2.size());
+ assert(std::equal(s1.begin(), s1.end(), sp.end() - Count));
+}
+
+
+constexpr int carr1[] = {1,2,3,4};
+ int arr[] = {5,6,7};
+std::string sarr [] = { "ABC", "DEF", "GHI", "JKL", "MNO"};
+
+int main ()
+{
+ {
+ using Sp = std::span<const int>;
+ static_assert(testConstexprSpan<Sp, 0>(Sp{}), "");
+
+ static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<const int, 4>;
+
+ static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<int>;
+ testRuntimeSpan<Sp, 0>(Sp{});
+
+ testRuntimeSpan<Sp, 0>(Sp{arr});
+ testRuntimeSpan<Sp, 1>(Sp{arr});
+ testRuntimeSpan<Sp, 2>(Sp{arr});
+ testRuntimeSpan<Sp, 3>(Sp{arr});
+ }
+
+ {
+ using Sp = std::span<int, 3>;
+
+ testRuntimeSpan<Sp, 0>(Sp{arr});
+ testRuntimeSpan<Sp, 1>(Sp{arr});
+ testRuntimeSpan<Sp, 2>(Sp{arr});
+ testRuntimeSpan<Sp, 3>(Sp{arr});
+ }
+
+ {
+ using Sp = std::span<std::string>;
+ testConstexprSpan<Sp, 0>(Sp{});
+
+ testRuntimeSpan<Sp, 0>(Sp{sarr});
+ testRuntimeSpan<Sp, 1>(Sp{sarr});
+ testRuntimeSpan<Sp, 2>(Sp{sarr});
+ testRuntimeSpan<Sp, 3>(Sp{sarr});
+ testRuntimeSpan<Sp, 4>(Sp{sarr});
+ testRuntimeSpan<Sp, 5>(Sp{sarr});
+ }
+
+ {
+ using Sp = std::span<std::string, 5>;
+
+ testRuntimeSpan<Sp, 0>(Sp{sarr});
+ testRuntimeSpan<Sp, 1>(Sp{sarr});
+ testRuntimeSpan<Sp, 2>(Sp{sarr});
+ testRuntimeSpan<Sp, 3>(Sp{sarr});
+ testRuntimeSpan<Sp, 4>(Sp{sarr});
+ testRuntimeSpan<Sp, 5>(Sp{sarr});
+ }
+}
diff --git a/test/std/containers/views/span.sub/subspan.pass.cpp b/test/std/containers/views/span.sub/subspan.pass.cpp
new file mode 100644
index 000000000000..79cdc7bcaf1a
--- /dev/null
+++ b/test/std/containers/views/span.sub/subspan.pass.cpp
@@ -0,0 +1,210 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<ptrdiff_t Offset, ptrdiff_t Count = dynamic_extent>
+// constexpr span<element_type, see below> subspan() const;
+//
+// constexpr span<element_type, dynamic_extent> subspan(
+// index_type offset, index_type count = dynamic_extent) const;
+//
+// Requires: (0 <= Offset && Offset <= size())
+// && (Count == dynamic_extent || Count >= 0 && Offset + Count <= size())
+
+#include <span>
+#include <cassert>
+#include <algorithm>
+#include <string>
+
+#include "test_macros.h"
+
+template <typename Span, ptrdiff_t Offset, ptrdiff_t Count>
+constexpr bool testConstexprSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
+ LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count))));
+ auto s1 = sp.template subspan<Offset, Count>();
+ auto s2 = sp.subspan(Offset, Count);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Count), "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ return
+ s1.data() == s2.data()
+ && s1.size() == s2.size()
+ && std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
+}
+
+template <typename Span, ptrdiff_t Offset>
+constexpr bool testConstexprSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
+ LIBCPP_ASSERT((noexcept(sp.subspan(Offset))));
+ auto s1 = sp.template subspan<Offset>();
+ auto s2 = sp.subspan(Offset);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ return
+ s1.data() == s2.data()
+ && s1.size() == s2.size()
+ && std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end());
+}
+
+
+template <typename Span, ptrdiff_t Offset, ptrdiff_t Count>
+void testRuntimeSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
+ LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count))));
+ auto s1 = sp.template subspan<Offset, Count>();
+ auto s2 = sp.subspan(Offset, Count);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Count), "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ assert(s1.data() == s2.data());
+ assert(s1.size() == s2.size());
+ assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset));
+}
+
+
+template <typename Span, ptrdiff_t Offset>
+void testRuntimeSpan(Span sp)
+{
+ LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
+ LIBCPP_ASSERT((noexcept(sp.subspan(Offset))));
+ auto s1 = sp.template subspan<Offset>();
+ auto s2 = sp.subspan(Offset);
+ using S1 = decltype(s1);
+ using S2 = decltype(s2);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
+ ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
+ static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), "");
+ static_assert(S2::extent == std::dynamic_extent, "");
+ assert(s1.data() == s2.data());
+ assert(s1.size() == s2.size());
+ assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end()));
+}
+
+
+constexpr int carr1[] = {1,2,3,4};
+ int arr1[] = {5,6,7};
+
+int main ()
+{
+ {
+ using Sp = std::span<const int>;
+ static_assert(testConstexprSpan<Sp, 0>(Sp{}), "");
+
+ static_assert(testConstexprSpan<Sp, 0, 4>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 0>(Sp{carr1}), "");
+
+ static_assert(testConstexprSpan<Sp, 1, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4, 0>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<const int, 4>;
+
+ static_assert(testConstexprSpan<Sp, 0, 4>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 0, 0>(Sp{carr1}), "");
+
+ static_assert(testConstexprSpan<Sp, 1, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4, 0>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<const int>;
+ static_assert(testConstexprSpan<Sp, 0>(Sp{}), "");
+
+ static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<const int, 4>;
+
+ static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
+
+ static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
+ static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
+ }
+
+ {
+ using Sp = std::span<int>;
+ testRuntimeSpan<Sp, 0>(Sp{});
+
+ testRuntimeSpan<Sp, 0, 3>(Sp{arr1});
+ testRuntimeSpan<Sp, 0, 2>(Sp{arr1});
+ testRuntimeSpan<Sp, 0, 1>(Sp{arr1});
+ testRuntimeSpan<Sp, 0, 0>(Sp{arr1});
+
+ testRuntimeSpan<Sp, 1, 2>(Sp{arr1});
+ testRuntimeSpan<Sp, 2, 1>(Sp{arr1});
+ testRuntimeSpan<Sp, 3, 0>(Sp{arr1});
+ }
+
+ {
+ using Sp = std::span<int, 3>;
+
+ testRuntimeSpan<Sp, 0, 3>(Sp{arr1});
+ testRuntimeSpan<Sp, 0, 2>(Sp{arr1});
+ testRuntimeSpan<Sp, 0, 1>(Sp{arr1});
+ testRuntimeSpan<Sp, 0, 0>(Sp{arr1});
+
+ testRuntimeSpan<Sp, 1, 2>(Sp{arr1});
+ testRuntimeSpan<Sp, 2, 1>(Sp{arr1});
+ testRuntimeSpan<Sp, 3, 0>(Sp{arr1});
+ }
+
+ {
+ using Sp = std::span<int>;
+ testRuntimeSpan<Sp, 0>(Sp{});
+
+ testRuntimeSpan<Sp, 0>(Sp{arr1});
+ testRuntimeSpan<Sp, 1>(Sp{arr1});
+ testRuntimeSpan<Sp, 2>(Sp{arr1});
+ testRuntimeSpan<Sp, 3>(Sp{arr1});
+ }
+
+ {
+ using Sp = std::span<int, 3>;
+
+ testRuntimeSpan<Sp, 0>(Sp{arr1});
+ testRuntimeSpan<Sp, 1>(Sp{arr1});
+ testRuntimeSpan<Sp, 2>(Sp{arr1});
+ testRuntimeSpan<Sp, 3>(Sp{arr1});
+ }
+}
diff --git a/test/std/containers/views/types.pass.cpp b/test/std/containers/views/types.pass.cpp
new file mode 100644
index 000000000000..082abeb774ea
--- /dev/null
+++ b/test/std/containers/views/types.pass.cpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+//===------------------------------ span ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// template<class ElementType, ptrdiff_t Extent = dynamic_extent>
+// class span {
+// public:
+// // constants and types
+// using element_type = ElementType;
+// using value_type = remove_cv_t<ElementType>;
+// using index_type = ptrdiff_t;
+// using difference_type = ptrdiff_t;
+// using pointer = element_type *;
+// using reference = element_type &;
+// using iterator = implementation-defined;
+// using const_iterator = implementation-defined;
+// using reverse_iterator = std::reverse_iterator<iterator>;
+// using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+//
+// static constexpr index_type extent = Extent;
+//
+
+#include <span>
+#include <cassert>
+#include <iterator>
+#include <string>
+
+#include "test_macros.h"
+
+template <typename S, typename Iter>
+void testIterator()
+{
+ typedef std::iterator_traits<Iter> ItT;
+
+ ASSERT_SAME_TYPE(typename ItT::iterator_category, std::random_access_iterator_tag);
+ ASSERT_SAME_TYPE(typename ItT::value_type, typename S::value_type);
+ ASSERT_SAME_TYPE(typename ItT::reference, typename S::reference);
+ ASSERT_SAME_TYPE(typename ItT::pointer, typename S::pointer);
+ ASSERT_SAME_TYPE(typename ItT::difference_type, typename S::difference_type);
+}
+
+template <typename S, typename Iter>
+void testConstIterator()
+{
+ typedef std::iterator_traits<Iter> ItT;
+
+ ASSERT_SAME_TYPE(typename ItT::iterator_category, std::random_access_iterator_tag);
+ ASSERT_SAME_TYPE(typename ItT::value_type, typename S::value_type);
+// I'd like to say 'const typename S::pointer' here, but that gives me
+// a const pointer to a non-const value, which is not what I want.
+ ASSERT_SAME_TYPE(typename ItT::reference, typename S::element_type const &);
+ ASSERT_SAME_TYPE(typename ItT::pointer, typename S::element_type const *);
+ ASSERT_SAME_TYPE(typename ItT::difference_type, typename S::difference_type);
+}
+
+template <typename S, typename ElementType, std::ptrdiff_t Size>
+void testSpan()
+{
+ ASSERT_SAME_TYPE(typename S::element_type, ElementType);
+ ASSERT_SAME_TYPE(typename S::value_type, std::remove_cv_t<ElementType>);
+ ASSERT_SAME_TYPE(typename S::index_type, std::ptrdiff_t);
+ ASSERT_SAME_TYPE(typename S::difference_type, std::ptrdiff_t);
+ ASSERT_SAME_TYPE(typename S::pointer, ElementType *);
+ ASSERT_SAME_TYPE(typename S::reference, ElementType &);
+
+ static_assert(S::extent == Size); // check that it exists
+
+ testIterator<S, typename S::iterator>();
+ testIterator<S, typename S::reverse_iterator>();
+ testConstIterator<S, typename S::const_iterator>();
+ testConstIterator<S, typename S::const_reverse_iterator>();
+}
+
+
+template <typename T>
+void test()
+{
+ testSpan<std::span< T>, T, -1>();
+ testSpan<std::span<const T>, const T, -1>();
+ testSpan<std::span< volatile T>, volatile T, -1>();
+ testSpan<std::span<const volatile T>, const volatile T, -1>();
+
+ testSpan<std::span< T, 5>, T, 5>();
+ testSpan<std::span<const T, 5>, const T, 5>();
+ testSpan<std::span< volatile T, 5>, volatile T, 5>();
+ testSpan<std::span<const volatile T, 5>, const volatile T, 5>();
+}
+
+struct A{};
+
+int main ()
+{
+ test<int>();
+ test<long>();
+ test<double>();
+ test<std::string>();
+ test<A>();
+}
diff --git a/test/std/depr/depr.c.headers/stddef_h.pass.cpp b/test/std/depr/depr.c.headers/stddef_h.pass.cpp
index 0c08c782a3e4..68f70b80e92e 100644
--- a/test/std/depr/depr.c.headers/stddef_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stddef_h.pass.cpp
@@ -13,6 +13,8 @@
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
#ifndef NULL
#error NULL not defined
#endif
@@ -42,8 +44,16 @@ int main()
"decltype(nullptr) == nullptr_t");
static_assert(sizeof(nullptr_t) == sizeof(void*),
"sizeof(nullptr_t) == sizeof(void*)");
+#if TEST_STD_VER > 17
+// P0767
+ static_assert(std::is_trivial<max_align_t>::value,
+ "std::is_trivial<max_align_t>::value");
+ static_assert(std::is_standard_layout<max_align_t>::value,
+ "std::is_standard_layout<max_align_t>::value");
+#else
static_assert(std::is_pod<max_align_t>::value,
"std::is_pod<max_align_t>::value");
+#endif
static_assert((std::alignment_of<max_align_t>::value >=
std::alignment_of<long long>::value),
"std::alignment_of<max_align_t>::value >= "
diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp
index 5d345f13dd41..1bac82d303cf 100644
--- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp
+++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp
@@ -15,6 +15,7 @@
#include <strstream>
#include <cassert>
+#include <cstring>
int main()
{
@@ -71,8 +72,8 @@ int main()
}
{
char buf[10] = "abcd";
- int s = std::strlen(buf);
- std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+ std::size_t s = std::strlen(buf);
+ std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
assert(sb.sgetc() == 'a');
assert(sb.snextc() == 'b');
assert(sb.snextc() == 'c');
diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp
index c827850abf3a..289b61f43996 100644
--- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp
+++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp
@@ -15,6 +15,7 @@
#include <strstream>
#include <cassert>
+#include <cstring>
int main()
{
@@ -71,8 +72,8 @@ int main()
}
{
signed char buf[10] = "abcd";
- int s = std::strlen((char*)buf);
- std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+ std::size_t s = std::strlen((char*)buf);
+ std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
assert(sb.sgetc() == 'a');
assert(sb.snextc() == 'b');
assert(sb.snextc() == 'c');
diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp
index 46c11e4afaf0..b0920f7a76f0 100644
--- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp
+++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp
@@ -15,6 +15,7 @@
#include <strstream>
#include <cassert>
+#include <cstring>
int main()
{
@@ -71,8 +72,8 @@ int main()
}
{
unsigned char buf[10] = "abcd";
- int s = std::strlen((char*)buf);
- std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+ std::size_t s = std::strlen((char*)buf);
+ std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
assert(sb.sgetc() == 'a');
assert(sb.snextc() == 'b');
assert(sb.snextc() == 'c');
diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
deleted file mode 100644
index 85ff8e15d162..000000000000
--- a/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <algorithm>
-
-// template <class PopulationIterator, class SampleIterator, class Distance,
-// class UniformRandomNumberGenerator>
-// SampleIterator sample(PopulationIterator first, PopulationIterator last,
-// SampleIterator out, Distance n,
-// UniformRandomNumberGenerator &&g);
-
-#include <experimental/algorithm>
-#include <random>
-#include <cassert>
-
-#include "test_iterators.h"
-
-template <class PopulationIterator, class SampleIterator> void test() {
- int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- const unsigned is = sizeof(ia) / sizeof(ia[0]);
- const unsigned os = 4;
- int oa[os];
- std::minstd_rand g;
- std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia + is),
- SampleIterator(oa), os, g);
-}
-
-int main() {
- // expected-error@algorithm:* {{static_assert failed "SampleIterator must meet the requirements of RandomAccessIterator"}}
- // expected-error@algorithm:* 2 {{does not provide a subscript operator}}
- // expected-error@algorithm:* {{invalid operands}}
- test<input_iterator<int *>, output_iterator<int *> >();
-}
diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp
deleted file mode 100644
index 23098d83e4ea..000000000000
--- a/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <algorithm>
-
-// template <class PopulationIterator, class SampleIterator, class Distance,
-// class UniformRandomNumberGenerator>
-// SampleIterator sample(PopulationIterator first, PopulationIterator last,
-// SampleIterator out, Distance n,
-// UniformRandomNumberGenerator &&g);
-
-#include <experimental/algorithm>
-#include <random>
-#include <cassert>
-
-#include "test_iterators.h"
-
-struct ReservoirSampleExpectations {
- enum { os = 4 };
- static int oa1[os];
- static int oa2[os];
-};
-
-int ReservoirSampleExpectations::oa1[] = {10, 5, 9, 4};
-int ReservoirSampleExpectations::oa2[] = {5, 2, 10, 4};
-
-struct SelectionSampleExpectations {
- enum { os = 4 };
- static int oa1[os];
- static int oa2[os];
-};
-
-int SelectionSampleExpectations::oa1[] = {1, 4, 6, 7};
-int SelectionSampleExpectations::oa2[] = {1, 2, 6, 8};
-
-template <class IteratorCategory> struct TestExpectations
- : public SelectionSampleExpectations {};
-
-template <>
-struct TestExpectations<std::input_iterator_tag>
- : public ReservoirSampleExpectations {};
-
-template <template<class...> class PopulationIteratorType, class PopulationItem,
- template<class...> class SampleIteratorType, class SampleItem>
-void test() {
- typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
- typedef SampleIteratorType<SampleItem *> SampleIterator;
- PopulationItem ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- const unsigned is = sizeof(ia) / sizeof(ia[0]);
- typedef TestExpectations<typename std::iterator_traits<
- PopulationIterator>::iterator_category> Expectations;
- const unsigned os = Expectations::os;
- SampleItem oa[os];
- const int *oa1 = Expectations::oa1;
- ((void)oa1); // Prevent unused warning
- const int *oa2 = Expectations::oa2;
- ((void)oa2); // Prevent unused warning
- std::minstd_rand g;
- SampleIterator end;
- end = std::experimental::sample(PopulationIterator(ia),
- PopulationIterator(ia + is),
- SampleIterator(oa), os, g);
- assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is));
- // sample() is deterministic but non-reproducible;
- // its results can vary between implementations.
- LIBCPP_ASSERT(std::equal(oa, oa + os, oa1));
- end = std::experimental::sample(PopulationIterator(ia),
- PopulationIterator(ia + is),
- SampleIterator(oa), os, std::move(g));
- assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is));
- LIBCPP_ASSERT(std::equal(oa, oa + os, oa2));
-}
-
-template <template<class...> class PopulationIteratorType, class PopulationItem,
- template<class...> class SampleIteratorType, class SampleItem>
-void test_empty_population() {
- typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
- typedef SampleIteratorType<SampleItem *> SampleIterator;
- PopulationItem ia[] = {42};
- const unsigned os = 4;
- SampleItem oa[os];
- std::minstd_rand g;
- SampleIterator end =
- std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia),
- SampleIterator(oa), os, g);
- assert(end.base() == oa);
-}
-
-template <template<class...> class PopulationIteratorType, class PopulationItem,
- template<class...> class SampleIteratorType, class SampleItem>
-void test_empty_sample() {
- typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
- typedef SampleIteratorType<SampleItem *> SampleIterator;
- PopulationItem ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- const unsigned is = sizeof(ia) / sizeof(ia[0]);
- SampleItem oa[1];
- std::minstd_rand g;
- SampleIterator end =
- std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia + is),
- SampleIterator(oa), 0, g);
- assert(end.base() == oa);
-}
-
-template <template<class...> class PopulationIteratorType, class PopulationItem,
- template<class...> class SampleIteratorType, class SampleItem>
-void test_small_population() {
- // The population size is less than the sample size.
- typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
- typedef SampleIteratorType<SampleItem *> SampleIterator;
- PopulationItem ia[] = {1, 2, 3, 4, 5};
- const unsigned is = sizeof(ia) / sizeof(ia[0]);
- const unsigned os = 8;
- SampleItem oa[os];
- const SampleItem oa1[] = {1, 2, 3, 4, 5};
- std::minstd_rand g;
- SampleIterator end;
- end = std::experimental::sample(PopulationIterator(ia),
- PopulationIterator(ia + is),
- SampleIterator(oa), os, g);
- assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is));
- assert(std::equal(oa, end.base(), oa1));
-}
-
-int main() {
- test<input_iterator, int, random_access_iterator, int>();
- test<forward_iterator, int, output_iterator, int>();
- test<forward_iterator, int, random_access_iterator, int>();
-
- test<input_iterator, int, random_access_iterator, double>();
- test<forward_iterator, int, output_iterator, double>();
- test<forward_iterator, int, random_access_iterator, double>();
-
- test_empty_population<input_iterator, int, random_access_iterator, int>();
- test_empty_population<forward_iterator, int, output_iterator, int>();
- test_empty_population<forward_iterator, int, random_access_iterator, int>();
-
- test_empty_sample<input_iterator, int, random_access_iterator, int>();
- test_empty_sample<forward_iterator, int, output_iterator, int>();
- test_empty_sample<forward_iterator, int, random_access_iterator, int>();
-
- test_small_population<input_iterator, int, random_access_iterator, int>();
- test_small_population<forward_iterator, int, output_iterator, int>();
- test_small_population<forward_iterator, int, random_access_iterator, int>();
-}
diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp
deleted file mode 100644
index c805c66fa5e7..000000000000
--- a/test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <algorithm>
-
-// template <class PopulationIterator, class SampleIterator, class Distance,
-// class UniformRandomNumberGenerator>
-// SampleIterator sample(PopulationIterator first, PopulationIterator last,
-// SampleIterator out, Distance n,
-// UniformRandomNumberGenerator &&g);
-
-#include <experimental/algorithm>
-#include <random>
-#include <cassert>
-
-#include "test_iterators.h"
-
-// Stable if and only if PopulationIterator meets the requirements of a
-// ForwardIterator type.
-template <class PopulationIterator, class SampleIterator>
-void test_stability(bool expect_stable) {
- const unsigned kPopulationSize = 100;
- int ia[kPopulationSize];
- for (unsigned i = 0; i < kPopulationSize; ++i)
- ia[i] = i;
- PopulationIterator first(ia);
- PopulationIterator last(ia + kPopulationSize);
-
- const unsigned kSampleSize = 20;
- int oa[kPopulationSize];
- SampleIterator out(oa);
-
- std::minstd_rand g;
-
- const int kIterations = 1000;
- bool unstable = false;
- for (int i = 0; i < kIterations; ++i) {
- std::experimental::sample(first, last, out, kSampleSize, g);
- unstable |= !std::is_sorted(oa, oa + kSampleSize);
- }
- assert(expect_stable == !unstable);
-}
-
-int main() {
- test_stability<forward_iterator<int *>, output_iterator<int *> >(true);
- test_stability<input_iterator<int *>, random_access_iterator<int *> >(false);
-}
diff --git a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
deleted file mode 100644
index 0b9d71e5f705..000000000000
--- a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any& operator=(any const &);
-
-// Test copy assignment
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-template <class LHS, class RHS>
-void test_copy_assign() {
- assert(LHS::count == 0);
- assert(RHS::count == 0);
- LHS::reset();
- RHS::reset();
- {
- any lhs(LHS(1));
- any const rhs(RHS(2));
-
- assert(LHS::count == 1);
- assert(RHS::count == 1);
- assert(RHS::copied == 0);
-
- lhs = rhs;
-
- assert(RHS::copied == 1);
- assert(LHS::count == 0);
- assert(RHS::count == 2);
-
- assertContains<RHS>(lhs, 2);
- assertContains<RHS>(rhs, 2);
- }
- assert(LHS::count == 0);
- assert(RHS::count == 0);
-}
-
-template <class LHS>
-void test_copy_assign_empty() {
- assert(LHS::count == 0);
- LHS::reset();
- {
- any lhs;
- any const rhs(LHS(42));
-
- assert(LHS::count == 1);
- assert(LHS::copied == 0);
-
- lhs = rhs;
-
- assert(LHS::copied == 1);
- assert(LHS::count == 2);
-
- assertContains<LHS>(lhs, 42);
- assertContains<LHS>(rhs, 42);
- }
- assert(LHS::count == 0);
- LHS::reset();
- {
- any lhs(LHS(1));
- any const rhs;
-
- assert(LHS::count == 1);
- assert(LHS::copied == 0);
-
- lhs = rhs;
-
- assert(LHS::copied == 0);
- assert(LHS::count == 0);
-
- assertEmpty<LHS>(lhs);
- assertEmpty(rhs);
- }
- assert(LHS::count == 0);
-}
-
-void test_copy_assign_self() {
- // empty
- {
- any a;
- a = a;
- assertEmpty(a);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- }
- assert(globalMemCounter.checkOutstandingNewEq(0));
- // small
- {
- any a((small(1)));
- assert(small::count == 1);
-
- a = a;
-
- assert(small::count == 1);
- assertContains<small>(a, 1);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- }
- assert(small::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- // large
- {
- any a(large(1));
- assert(large::count == 1);
-
- a = a;
-
- assert(large::count == 1);
- assertContains<large>(a, 1);
- assert(globalMemCounter.checkOutstandingNewEq(1));
- }
- assert(large::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
-}
-
-template <class Tp>
-void test_copy_assign_throws()
-{
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- auto try_throw =
- [](any& lhs, any const& rhs) {
- try {
- lhs = rhs;
- assert(false);
- } catch (my_any_exception const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
- };
- // const lvalue to empty
- {
- any lhs;
- any const rhs((Tp(1)));
- assert(Tp::count == 1);
-
- try_throw(lhs, rhs);
-
- assert(Tp::count == 1);
- assertEmpty<Tp>(lhs);
- assertContains<Tp>(rhs);
- }
- {
- any lhs((small(2)));
- any const rhs((Tp(1)));
- assert(small::count == 1);
- assert(Tp::count == 1);
-
- try_throw(lhs, rhs);
-
- assert(small::count == 1);
- assert(Tp::count == 1);
- assertContains<small>(lhs, 2);
- assertContains<Tp>(rhs);
- }
- {
- any lhs((large(2)));
- any const rhs((Tp(1)));
- assert(large::count == 1);
- assert(Tp::count == 1);
-
- try_throw(lhs, rhs);
-
- assert(large::count == 1);
- assert(Tp::count == 1);
- assertContains<large>(lhs, 2);
- assertContains<Tp>(rhs);
- }
-#endif
-}
-
-int main() {
- test_copy_assign<small1, small2>();
- test_copy_assign<large1, large2>();
- test_copy_assign<small, large>();
- test_copy_assign<large, small>();
- test_copy_assign_empty<small>();
- test_copy_assign_empty<large>();
- test_copy_assign_self();
- test_copy_assign_throws<small_throws_on_copy>();
- test_copy_assign_throws<large_throws_on_copy>();
-}
diff --git a/test/std/experimental/any/any.class/any.assign/move.pass.cpp b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
deleted file mode 100644
index 72351aeae68f..000000000000
--- a/test/std/experimental/any/any.class/any.assign/move.pass.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any& operator=(any &&);
-
-// Test move assignment.
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-template <class LHS, class RHS>
-void test_move_assign() {
- assert(LHS::count == 0);
- assert(RHS::count == 0);
- {
- LHS const s1(1);
- any a(s1);
- RHS const s2(2);
- any a2(s2);
-
- assert(LHS::count == 2);
- assert(RHS::count == 2);
-
- a = std::move(a2);
-
- assert(LHS::count == 1);
- assert(RHS::count == 2);
-
- assertContains<RHS>(a, 2);
- assertEmpty<RHS>(a2);
- }
- assert(LHS::count == 0);
- assert(RHS::count == 0);
-}
-
-template <class LHS>
-void test_move_assign_empty() {
- assert(LHS::count == 0);
- {
- any a;
- any a2((LHS(1)));
-
- assert(LHS::count == 1);
-
- a = std::move(a2);
-
- assert(LHS::count == 1);
-
- assertContains<LHS>(a, 1);
- assertEmpty<LHS>(a2);
- }
- assert(LHS::count == 0);
- {
- any a((LHS(1)));
- any a2;
-
- assert(LHS::count == 1);
-
- a = std::move(a2);
-
- assert(LHS::count == 0);
-
- assertEmpty<LHS>(a);
- assertEmpty(a2);
- }
- assert(LHS::count == 0);
-}
-
-void test_move_assign_noexcept() {
- any a1;
- any a2;
- static_assert(
- noexcept(a1 = std::move(a2))
- , "any & operator=(any &&) must be noexcept"
- );
-}
-
-int main() {
- test_move_assign_noexcept();
- test_move_assign<small1, small2>();
- test_move_assign<large1, large2>();
- test_move_assign<small, large>();
- test_move_assign<large, small>();
- test_move_assign_empty<small>();
- test_move_assign_empty<large>();
-}
diff --git a/test/std/experimental/any/any.class/any.assign/value.pass.cpp b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
deleted file mode 100644
index cd4646fb5fd5..000000000000
--- a/test/std/experimental/any/any.class/any.assign/value.pass.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any& operator=(any const &);
-
-// Test value copy and move assignment.
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-template <class LHS, class RHS>
-void test_assign_value() {
- assert(LHS::count == 0);
- assert(RHS::count == 0);
- LHS::reset();
- RHS::reset();
- {
- any lhs(LHS(1));
- any const rhs(RHS(2));
-
- assert(LHS::count == 1);
- assert(RHS::count == 1);
- assert(RHS::copied == 0);
-
- lhs = rhs;
-
- assert(RHS::copied == 1);
- assert(LHS::count == 0);
- assert(RHS::count == 2);
-
- assertContains<RHS>(lhs, 2);
- assertContains<RHS>(rhs, 2);
- }
- assert(LHS::count == 0);
- assert(RHS::count == 0);
- LHS::reset();
- RHS::reset();
- {
- any lhs(LHS(1));
- any rhs(RHS(2));
-
- assert(LHS::count == 1);
- assert(RHS::count == 1);
- assert(RHS::moved == 1);
-
- lhs = std::move(rhs);
-
- assert(RHS::moved >= 1);
- assert(RHS::copied == 0);
- assert(LHS::count == 0);
- assert(RHS::count == 1);
-
- assertContains<RHS>(lhs, 2);
- assertEmpty<RHS>(rhs);
- }
- assert(LHS::count == 0);
- assert(RHS::count == 0);
-}
-
-template <class RHS>
-void test_assign_value_empty() {
- assert(RHS::count == 0);
- RHS::reset();
- {
- any lhs;
- RHS rhs(42);
- assert(RHS::count == 1);
- assert(RHS::copied == 0);
-
- lhs = rhs;
-
- assert(RHS::count == 2);
- assert(RHS::copied == 1);
- assert(RHS::moved >= 0);
- assertContains<RHS>(lhs, 42);
- }
- assert(RHS::count == 0);
- RHS::reset();
- {
- any lhs;
- RHS rhs(42);
- assert(RHS::count == 1);
- assert(RHS::moved == 0);
-
- lhs = std::move(rhs);
-
- assert(RHS::count == 2);
- assert(RHS::copied == 0);
- assert(RHS::moved >= 1);
- assertContains<RHS>(lhs, 42);
- }
- assert(RHS::count == 0);
- RHS::reset();
-}
-
-
-template <class Tp, bool Move = false>
-void test_assign_throws() {
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- auto try_throw=
- [](any& lhs, auto&& rhs) {
- try {
- Move ? lhs = std::move(rhs)
- : lhs = rhs;
- assert(false);
- } catch (my_any_exception const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
- };
- // const lvalue to empty
- {
- any lhs;
- Tp rhs(1);
- assert(Tp::count == 1);
-
- try_throw(lhs, rhs);
-
- assert(Tp::count == 1);
- assertEmpty<Tp>(lhs);
- }
- {
- any lhs((small(2)));
- Tp rhs(1);
- assert(small::count == 1);
- assert(Tp::count == 1);
-
- try_throw(lhs, rhs);
-
- assert(small::count == 1);
- assert(Tp::count == 1);
- assertContains<small>(lhs, 2);
- }
- {
- any lhs((large(2)));
- Tp rhs(1);
- assert(large::count == 1);
- assert(Tp::count == 1);
-
- try_throw(lhs, rhs);
-
- assert(large::count == 1);
- assert(Tp::count == 1);
- assertContains<large>(lhs, 2);
- }
-#endif
-}
-
-int main() {
- test_assign_value<small1, small2>();
- test_assign_value<large1, large2>();
- test_assign_value<small, large>();
- test_assign_value<large, small>();
- test_assign_value_empty<small>();
- test_assign_value_empty<large>();
- test_assign_throws<small_throws_on_copy>();
- test_assign_throws<large_throws_on_copy>();
- test_assign_throws<throws_on_move, /* Move = */ true>();
-}
diff --git a/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp b/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp
deleted file mode 100644
index 7d2d33d63cfc..000000000000
--- a/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// template <class Value>
-// any& operator=(Value &&);
-
-// Instantiate the value assignment operator with a non-copyable type.
-
-#include <experimental/any>
-
-class non_copyable
-{
- non_copyable(non_copyable const &);
-
-public:
- non_copyable() {}
- non_copyable(non_copyable &&) {}
-};
-
-int main()
-{
- using namespace std::experimental;
- non_copyable nc;
- any a;
- a = static_cast<non_copyable &&>(nc); // expected-error-re@experimental/any:* 2 {{static_assert failed{{.*}} "_ValueType must be CopyConstructible."}}
- // expected-error@experimental/any:* {{calling a private constructor of class 'non_copyable'}}
-
-}
diff --git a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
deleted file mode 100644
index d477394c0b91..000000000000
--- a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any(any const &);
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-template <class Type>
-void test_copy_throws() {
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- assert(Type::count == 0);
- {
- any const a((Type(42)));
- assert(Type::count == 1);
- try {
- any const a2(a);
- assert(false);
- } catch (my_any_exception const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
- assert(Type::count == 1);
- assertContains<Type>(a, 42);
- }
- assert(Type::count == 0);
-#endif
-}
-
-void test_copy_empty() {
- DisableAllocationGuard g; ((void)g); // No allocations should occur.
- any a1;
- any a2(a1);
-
- assertEmpty(a1);
- assertEmpty(a2);
-}
-
-template <class Type>
-void test_copy()
-{
- // Copying small types should not perform any allocations.
- DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
- assert(Type::count == 0);
- Type::reset();
- {
- any a((Type(42)));
- assert(Type::count == 1);
- assert(Type::copied == 0);
-
- any a2(a);
-
- assert(Type::copied == 1);
- assert(Type::count == 2);
- assertContains<Type>(a, 42);
- assertContains<Type>(a, 42);
-
- // Modify a and check that a2 is unchanged
- modifyValue<Type>(a, -1);
- assertContains<Type>(a, -1);
- assertContains<Type>(a2, 42);
-
- // modify a2 and check that a is unchanged
- modifyValue<Type>(a2, 999);
- assertContains<Type>(a, -1);
- assertContains<Type>(a2, 999);
-
- // clear a and check that a2 is unchanged
- a.clear();
- assertEmpty(a);
- assertContains<Type>(a2, 999);
- }
- assert(Type::count == 0);
-}
-
-int main() {
- test_copy<small>();
- test_copy<large>();
- test_copy_empty();
- test_copy_throws<small_throws_on_copy>();
- test_copy_throws<large_throws_on_copy>();
-}
diff --git a/test/std/experimental/any/any.class/any.cons/default.pass.cpp b/test/std/experimental/any/any.class/any.cons/default.pass.cpp
deleted file mode 100644
index 3839e3afc81d..000000000000
--- a/test/std/experimental/any/any.class/any.cons/default.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// any() noexcept;
-
-#include <experimental/any>
-#include <type_traits>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-
-
-int main()
-{
- using std::experimental::any;
- {
- static_assert(
- std::is_nothrow_default_constructible<any>::value
- , "Must be default constructible"
- );
- }
- {
- DisableAllocationGuard g; ((void)g);
- any const a;
- assertEmpty(a);
- }
-}
diff --git a/test/std/experimental/any/any.class/any.cons/move.pass.cpp b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
deleted file mode 100644
index ef980ca5f222..000000000000
--- a/test/std/experimental/any/any.class/any.cons/move.pass.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any(any &&) noexcept;
-
-#include <experimental/any>
-#include <utility>
-#include <type_traits>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-// Moves are always noexcept. The throws_on_move object
-// must be stored dynamically so the pointer is moved and
-// not the stored object.
-void test_move_does_not_throw()
-{
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- assert(throws_on_move::count == 0);
- {
- throws_on_move v(42);
- any a(v);
- assert(throws_on_move::count == 2);
- // No allocations should be performed after this point.
- DisableAllocationGuard g; ((void)g);
- try {
- any const a2(std::move(a));
- assertEmpty(a);
- assertContains<throws_on_move>(a2, 42);
- } catch (...) {
- assert(false);
- }
- assert(throws_on_move::count == 1);
- assertEmpty(a);
- }
- assert(throws_on_move::count == 0);
-#endif
-}
-
-void test_move_empty() {
- DisableAllocationGuard g; ((void)g); // no allocations should be performed.
-
- any a1;
- any a2(std::move(a1));
-
- assertEmpty(a1);
- assertEmpty(a2);
-}
-
-template <class Type>
-void test_move() {
- assert(Type::count == 0);
- Type::reset();
- {
- any a((Type(42)));
- assert(Type::count == 1);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
-
- // Moving should not perform allocations since it must be noexcept.
- DisableAllocationGuard g; ((void)g);
-
- any a2(std::move(a));
-
- assert(Type::moved >= 1); // zero or more move operations can be performed.
- assert(Type::copied == 0); // no copies can be performed.
- assert(Type::count == 1);
- assertEmpty(a); // Moves are always destructive.
- assertContains<Type>(a2, 42);
- }
- assert(Type::count == 0);
-}
-
-int main()
-{
- // noexcept test
- {
- static_assert(
- std::is_nothrow_move_constructible<any>::value
- , "any must be nothrow move constructible"
- );
- }
- test_move<small>();
- test_move<large>();
- test_move_empty();
- test_move_does_not_throw();
-}
diff --git a/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp b/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp
deleted file mode 100644
index c4f7568ec853..000000000000
--- a/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// any::any<Value>(Value &&)
-
-// Attempt to construct any with a non-copyable type.
-
-#include <experimental/any>
-
-class non_copyable
-{
- non_copyable(non_copyable const &);
-
-public:
- non_copyable() {}
- non_copyable(non_copyable &&) {}
-};
-
-int main()
-{
- using namespace std::experimental;
- non_copyable nc;
- any a(static_cast<non_copyable &&>(nc));
- // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType must be CopyConstructible."}}
- // expected-error@experimental/any:* 1 {{calling a private constructor of class 'non_copyable'}}
-}
diff --git a/test/std/experimental/any/any.class/any.cons/value.pass.cpp b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
deleted file mode 100644
index d37990e6ca37..000000000000
--- a/test/std/experimental/any/any.class/any.cons/value.pass.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// template <class Value> any(Value &&)
-
-// Test construction from a value.
-// Concerns:
-// ---------
-// 1. The value is properly move/copied depending on the value category.
-// 2. Both small and large values are properly handled.
-
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-template <class Type>
-void test_copy_value_throws()
-{
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- assert(Type::count == 0);
- {
- Type const t(42);
- assert(Type::count == 1);
- try {
- any const a2(t);
- assert(false);
- } catch (my_any_exception const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
- assert(Type::count == 1);
- assert(t.value == 42);
- }
- assert(Type::count == 0);
-#endif
-}
-
-void test_move_value_throws()
-{
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- assert(throws_on_move::count == 0);
- {
- throws_on_move v;
- assert(throws_on_move::count == 1);
- try {
- any const a(std::move(v));
- assert(false);
- } catch (my_any_exception const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
- assert(throws_on_move::count == 1);
- }
- assert(throws_on_move::count == 0);
-#endif
-}
-
-template <class Type>
-void test_copy_move_value() {
- // constructing from a small type should perform no allocations.
- DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
- assert(Type::count == 0);
- Type::reset();
- {
- Type t(42);
- assert(Type::count == 1);
-
- any a(t);
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::moved == 0);
- assertContains<Type>(a, 42);
- }
- assert(Type::count == 0);
- Type::reset();
- {
- Type t(42);
- assert(Type::count == 1);
-
- any a(std::move(t));
-
- assert(Type::count == 2);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
- assertContains<Type>(a, 42);
- }
-}
-
-
-int main() {
- test_copy_move_value<small>();
- test_copy_move_value<large>();
- test_copy_value_throws<small_throws_on_copy>();
- test_copy_value_throws<large_throws_on_copy>();
- test_move_value_throws();
-}
diff --git a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
deleted file mode 100644
index a19bd38f129b..000000000000
--- a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any::clear() noexcept
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-
-int main()
-{
- using std::experimental::any;
- using std::experimental::any_cast;
- // empty
- {
- any a;
-
- // noexcept check
- static_assert(
- noexcept(a.clear())
- , "any.clear() must be noexcept"
- );
-
- assertEmpty(a);
-
- a.clear();
-
- assertEmpty(a);
- }
- // small object
- {
- any a((small(1)));
- assert(small::count == 1);
- assertContains<small>(a, 1);
-
- a.clear();
-
- assertEmpty<small>(a);
- assert(small::count == 0);
- }
- // large object
- {
- any a(large(1));
- assert(large::count == 1);
- assertContains<large>(a);
-
- a.clear();
-
- assertEmpty<large>(a);
- assert(large::count == 0);
- }
-}
diff --git a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
deleted file mode 100644
index 8de582a6b76e..000000000000
--- a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// any::swap(any &) noexcept
-
-// Test swap(large, small) and swap(small, large)
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-template <class LHS, class RHS>
-void test_swap() {
- assert(LHS::count == 0);
- assert(RHS::count == 0);
- {
- any a1((LHS(1)));
- any a2(RHS{2});
- assert(LHS::count == 1);
- assert(RHS::count == 1);
-
- a1.swap(a2);
-
- assert(LHS::count == 1);
- assert(RHS::count == 1);
-
- assertContains<RHS>(a1, 2);
- assertContains<LHS>(a2, 1);
- }
- assert(LHS::count == 0);
- assert(RHS::count == 0);
- assert(LHS::copied == 0);
- assert(RHS::copied == 0);
-}
-
-template <class Tp>
-void test_swap_empty() {
- assert(Tp::count == 0);
- {
- any a1((Tp(1)));
- any a2;
- assert(Tp::count == 1);
-
- a1.swap(a2);
-
- assert(Tp::count == 1);
-
- assertContains<Tp>(a2, 1);
- assertEmpty(a1);
- }
- assert(Tp::count == 0);
- {
- any a1((Tp(1)));
- any a2;
- assert(Tp::count == 1);
-
- a2.swap(a1);
-
- assert(Tp::count == 1);
-
- assertContains<Tp>(a2, 1);
- assertEmpty(a1);
- }
- assert(Tp::count == 0);
- assert(Tp::copied == 0);
-}
-
-void test_noexcept()
-{
- any a1;
- any a2;
- static_assert(
- noexcept(a1.swap(a2))
- , "any::swap(any&) must be noexcept"
- );
-}
-
-int main()
-{
- test_noexcept();
- test_swap_empty<small>();
- test_swap_empty<large>();
- test_swap<small1, small2>();
- test_swap<large1, large2>();
- test_swap<small, large>();
- test_swap<large, small>();
-}
diff --git a/test/std/experimental/any/any.class/any.observers/empty.pass.cpp b/test/std/experimental/any/any.class/any.observers/empty.pass.cpp
deleted file mode 100644
index bdf0d511b811..000000000000
--- a/test/std/experimental/any/any.class/any.observers/empty.pass.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// any::empty() noexcept
-
-#include <experimental/any>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-
-int main()
-{
- using std::experimental::any;
- // noexcept test
- {
- any a;
- static_assert(noexcept(a.empty()), "any::empty() must be noexcept");
- }
- // empty
- {
- any a;
- assert(a.empty());
-
- a.clear();
- assert(a.empty());
-
- a = 42;
- assert(!a.empty());
- }
- // small object
- {
- small const s(1);
- any a(s);
- assert(!a.empty());
-
- a.clear();
- assert(a.empty());
-
- a = s;
- assert(!a.empty());
- }
- // large object
- {
- large const l(1);
- any a(l);
- assert(!a.empty());
-
- a.clear();
- assert(a.empty());
-
- a = l;
- assert(!a.empty());
- }
-}
diff --git a/test/std/experimental/any/any.class/any.observers/type.pass.cpp b/test/std/experimental/any/any.class/any.observers/type.pass.cpp
deleted file mode 100644
index 6d0048403677..000000000000
--- a/test/std/experimental/any/any.class/any.observers/type.pass.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: libcpp-no-rtti
-
-// <experimental/any>
-
-// any::type() noexcept
-
-#include <experimental/any>
-#include <cassert>
-#include "experimental_any_helpers.h"
-
-int main()
-{
- using std::experimental::any;
- {
- any const a;
- assert(a.type() == typeid(void));
- static_assert(noexcept(a.type()), "any::type() must be noexcept");
- }
- {
- small const s(1);
- any const a(s);
- assert(a.type() == typeid(small));
-
- }
- {
- large const l(1);
- any const a(l);
- assert(a.type() == typeid(large));
- }
-}
diff --git a/test/std/experimental/any/any.class/nothing_to_do.pass.cpp b/test/std/experimental/any/any.class/nothing_to_do.pass.cpp
deleted file mode 100644
index c21f8a701685..000000000000
--- a/test/std/experimental/any/any.class/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <experimental/string_view>
-
-int main () {}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
deleted file mode 100644
index 46ddbe5b05a1..000000000000
--- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// template <class ValueType>
-// ValueType const* any_cast(any const *) noexcept;
-//
-// template <class ValueType>
-// ValueType * any_cast(any *) noexcept;
-
-#include <experimental/any>
-#include <type_traits>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-// Test that the operators are properly noexcept.
-void test_cast_is_noexcept() {
- any a;
- static_assert(noexcept(any_cast<int>(&a)), "");
-
- any const& ca = a;
- static_assert(noexcept(any_cast<int>(&ca)), "");
-}
-
-// Test that the return type of any_cast is correct.
-void test_cast_return_type() {
- any a;
- static_assert(std::is_same<decltype(any_cast<int>(&a)), int*>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const>(&a)), int const*>::value, "");
-
- any const& ca = a;
- static_assert(std::is_same<decltype(any_cast<int>(&ca)), int const*>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const>(&ca)), int const*>::value, "");
-}
-
-// Test that any_cast handles null pointers.
-void test_cast_nullptr() {
- any* a = nullptr;
- assert(nullptr == any_cast<int>(a));
- assert(nullptr == any_cast<int const>(a));
-
- any const* ca = nullptr;
- assert(nullptr == any_cast<int>(ca));
- assert(nullptr == any_cast<int const>(ca));
-}
-
-// Test casting an empty object.
-void test_cast_empty() {
- {
- any a;
- assert(nullptr == any_cast<int>(&a));
- assert(nullptr == any_cast<int const>(&a));
-
- any const& ca = a;
- assert(nullptr == any_cast<int>(&ca));
- assert(nullptr == any_cast<int const>(&ca));
- }
- // Create as non-empty, then make empty and run test.
- {
- any a(42);
- a.clear();
- assert(nullptr == any_cast<int>(&a));
- assert(nullptr == any_cast<int const>(&a));
-
- any const& ca = a;
- assert(nullptr == any_cast<int>(&ca));
- assert(nullptr == any_cast<int const>(&ca));
- }
-}
-
-template <class Type>
-void test_cast() {
- assert(Type::count == 0);
- Type::reset();
- {
- any a((Type(42)));
- any const& ca = a;
- assert(Type::count == 1);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
-
- // Try a cast to a bad type.
- // NOTE: Type cannot be an int.
- assert(any_cast<int>(&a) == nullptr);
- assert(any_cast<int const>(&a) == nullptr);
- assert(any_cast<int const volatile>(&a) == nullptr);
-
- // Try a cast to the right type, but as a pointer.
- assert(any_cast<Type*>(&a) == nullptr);
- assert(any_cast<Type const*>(&a) == nullptr);
-
- // Check getting a unqualified type from a non-const any.
- Type* v = any_cast<Type>(&a);
- assert(v != nullptr);
- assert(v->value == 42);
-
- // change the stored value and later check for the new value.
- v->value = 999;
-
- // Check getting a const qualified type from a non-const any.
- Type const* cv = any_cast<Type const>(&a);
- assert(cv != nullptr);
- assert(cv == v);
- assert(cv->value == 999);
-
- // Check getting a unqualified type from a const any.
- cv = any_cast<Type>(&ca);
- assert(cv != nullptr);
- assert(cv == v);
- assert(cv->value == 999);
-
- // Check getting a const-qualified type from a const any.
- cv = any_cast<Type const>(&ca);
- assert(cv != nullptr);
- assert(cv == v);
- assert(cv->value == 999);
-
- // Check that no more objects were created, copied or moved.
- assert(Type::count == 1);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
- }
- assert(Type::count == 0);
-}
-
-int main() {
- test_cast_is_noexcept();
- test_cast_return_type();
- test_cast_nullptr();
- test_cast_empty();
- test_cast<small>();
- test_cast<large>();
-}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
deleted file mode 100644
index ca6d1de116ee..000000000000
--- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx
-
-// <experimental/any>
-
-// template <class ValueType>
-// ValueType const any_cast(any const&);
-//
-// template <class ValueType>
-// ValueType any_cast(any &);
-//
-// template <class ValueType>
-// ValueType any_cast(any &&);
-
-#include <experimental/any>
-#include <type_traits>
-#include <cassert>
-
-#include "experimental_any_helpers.h"
-#include "count_new.hpp"
-#include "test_macros.h"
-
-using std::experimental::any;
-using std::experimental::any_cast;
-using std::experimental::bad_any_cast;
-
-
-// Test that the operators are NOT marked noexcept.
-void test_cast_is_not_noexcept() {
- any a;
- static_assert(!noexcept(any_cast<int>(static_cast<any&>(a))), "");
- static_assert(!noexcept(any_cast<int>(static_cast<any const&>(a))), "");
- static_assert(!noexcept(any_cast<int>(static_cast<any &&>(a))), "");
-}
-
-// Test that the return type of any_cast is correct.
-void test_cast_return_type() {
- any a;
- static_assert(std::is_same<decltype(any_cast<int>(a)), int>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const>(a)), int>::value, "");
- static_assert(std::is_same<decltype(any_cast<int&>(a)), int&>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const&>(a)), int const&>::value, "");
-
- //static_assert(std::is_same<decltype(any_cast<int&&>(a)), int&&>::value, "");
- //static_assert(std::is_same<decltype(any_cast<int const&&>(a)), int const&&>::value, "");
-
- static_assert(std::is_same<decltype(any_cast<int>(std::move(a))), int>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const>(std::move(a))), int>::value, "");
- static_assert(std::is_same<decltype(any_cast<int&>(std::move(a))), int&>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const&>(std::move(a))), int const&>::value, "");
-
- //static_assert(std::is_same<decltype(any_cast<int&&>(std::move(a))), int&&>::value, "");
- //static_assert(std::is_same<decltype(any_cast<int const&&>(std::move(a))), int const&&>::value, "");
-
- any const& ca = a;
- static_assert(std::is_same<decltype(any_cast<int>(ca)), int>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const>(ca)), int>::value, "");
- static_assert(std::is_same<decltype(any_cast<int const&>(ca)), int const&>::value, "");
-
- //static_assert(std::is_same<decltype(any_cast<int const&&>(ca)), int const&&>::value, "");
-}
-
-template <class Type, class ConstT = Type>
-void checkThrows(any& a)
-{
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- try {
- any_cast<Type>(a);
- assert(false);
- } catch (bad_any_cast const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
-
- try {
- any_cast<ConstT>(static_cast<any const&>(a));
- assert(false);
- } catch (bad_any_cast const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
-
- try {
- any_cast<Type>(static_cast<any&&>(a));
- assert(false);
- } catch (bad_any_cast const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
-#else
- ((void)a);
-#endif
-}
-
-void test_cast_empty() {
- // None of these operations should allocate.
- DisableAllocationGuard g; ((void)g);
- any a;
- checkThrows<int>(a);
-}
-
-template <class Type>
-void test_cast_to_reference() {
- assert(Type::count == 0);
- Type::reset();
- {
- any a((Type(42)));
- any const& ca = a;
- assert(Type::count == 1);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
-
- // Try a cast to a bad type.
- // NOTE: Type cannot be an int.
- checkThrows<int>(a);
- checkThrows<int&, int const&>(a);
- checkThrows<Type*, Type const*>(a);
- checkThrows<Type const*>(a);
-
- // Check getting a type by reference from a non-const lvalue any.
- {
- Type& v = any_cast<Type&>(a);
- assert(v.value == 42);
-
- Type const &cv = any_cast<Type const&>(a);
- assert(&cv == &v);
- }
- // Check getting a type by reference from a const lvalue any.
- {
- Type const& v = any_cast<Type const&>(ca);
- assert(v.value == 42);
-
- Type const &cv = any_cast<Type const&>(ca);
- assert(&cv == &v);
- }
- // Check getting a type by reference from a non-const rvalue
- {
- Type& v = any_cast<Type&>(std::move(a));
- assert(v.value == 42);
-
- Type const &cv = any_cast<Type const&>(std::move(a));
- assert(&cv == &v);
- }
- // Check getting a type by reference from a const rvalue any.
- {
- Type const& v = any_cast<Type const&>(std::move(ca));
- assert(v.value == 42);
-
- Type const &cv = any_cast<Type const&>(std::move(ca));
- assert(&cv == &v);
- }
-
- // Check that the original object hasn't been changed.
- assertContains<Type>(a, 42);
-
- // Check that no objects have been created/copied/moved.
- assert(Type::count == 1);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
- }
- assert(Type::count == 0);
-}
-
-template <class Type>
-void test_cast_to_value() {
- assert(Type::count == 0);
- Type::reset();
- {
- any a((Type(42)));
- assert(Type::count == 1);
- assert(Type::copied == 0);
- assert(Type::moved == 1);
-
- // Try a cast to a bad type.
- // NOTE: Type cannot be an int.
- checkThrows<int>(a);
- checkThrows<int&, int const&>(a);
- checkThrows<Type*, Type const*>(a);
- checkThrows<Type const*>(a);
-
- Type::reset(); // NOTE: reset does not modify Type::count
- // Check getting Type by value from a non-const lvalue any.
- // This should cause the non-const copy constructor to be called.
- {
- Type t = any_cast<Type>(a);
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::const_copied == 0);
- assert(Type::non_const_copied == 1);
- assert(Type::moved == 0);
- assert(t.value == 42);
- }
- assert(Type::count == 1);
- Type::reset();
- // Check getting const Type by value from a non-const lvalue any.
- // This should cause the const copy constructor to be called.
- {
- Type t = any_cast<Type const>(a);
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::const_copied == 1);
- assert(Type::non_const_copied == 0);
- assert(Type::moved == 0);
- assert(t.value == 42);
- }
- assert(Type::count == 1);
- Type::reset();
- // Check getting Type by value from a non-const lvalue any.
- // This should cause the const copy constructor to be called.
- {
- Type t = any_cast<Type>(static_cast<any const&>(a));
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::const_copied == 1);
- assert(Type::non_const_copied == 0);
- assert(Type::moved == 0);
- assert(t.value == 42);
- }
- assert(Type::count == 1);
- Type::reset();
- // Check getting Type by value from a non-const rvalue any.
- // This should cause the non-const copy constructor to be called.
- {
- Type t = any_cast<Type>(static_cast<any &&>(a));
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::const_copied == 0);
- assert(Type::non_const_copied == 1);
- assert(Type::moved == 0);
- assert(t.value == 42);
- }
- assert(Type::count == 1);
- Type::reset();
- // Check getting const Type by value from a non-const rvalue any.
- // This should cause the const copy constructor to be called.
- {
- Type t = any_cast<Type const>(static_cast<any &&>(a));
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::const_copied == 1);
- assert(Type::non_const_copied == 0);
- assert(Type::moved == 0);
- assert(t.value == 42);
- }
- assert(Type::count == 1);
- Type::reset();
- // Check getting Type by value from a const rvalue any.
- // This should cause the const copy constructor to be called.
- {
- Type t = any_cast<Type>(static_cast<any const&&>(a));
-
- assert(Type::count == 2);
- assert(Type::copied == 1);
- assert(Type::const_copied == 1);
- assert(Type::non_const_copied == 0);
- assert(Type::moved == 0);
- assert(t.value == 42);
- }
- // Ensure we still only have 1 Type object alive.
- assert(Type::count == 1);
-
- // Check that the original object hasn't been changed.
- assertContains<Type>(a, 42);
- }
- assert(Type::count == 0);
-}
-
-// Even though you can't get a non-copyable class into std::any
-// the standard requires that these overloads compile and function.
-void test_non_copyable_ref() {
- struct no_copy
- {
- no_copy() {}
- no_copy(no_copy &&) {}
- private:
- no_copy(no_copy const &);
- };
-
- any a;
- checkThrows<no_copy &, no_copy const&>(a);
- checkThrows<no_copy const&>(a);
- assertEmpty(a);
-}
-
-int main() {
- test_cast_is_not_noexcept();
- test_cast_return_type();
- test_cast_empty();
- test_cast_to_reference<small>();
- test_cast_to_reference<large>();
- test_cast_to_value<small>();
- test_cast_to_value<large>();
- test_non_copyable_ref();
-}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp
deleted file mode 100644
index db5149265ccc..000000000000
--- a/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// template <class ValueType>
-// ValueType any_cast(any const &);
-
-// Try and cast away const.
-
-#include <experimental/any>
-
-struct TestType {};
-struct TestType2 {};
-
-int main()
-{
- using std::experimental::any;
- using std::experimental::any_cast;
-
- any a;
-
- // expected-error@experimental/any:* 2 {{binding value of type '_Tp' (aka 'const TestType') to reference to type 'TestType' drops 'const' qualifier}}
- any_cast<TestType &>(static_cast<any const&>(a)); // expected-note {{requested here}}
- any_cast<TestType &&>(static_cast<any const&>(a)); // expected-note {{requested here}}
-
- // expected-error@experimental/any:* 2 {{binding value of type '_Tp' (aka 'const TestType2') to reference to type 'TestType2' drops 'const' qualifier}}
- any_cast<TestType2 &>(static_cast<any const&&>(a)); // expected-note {{requested here}}
- any_cast<TestType2 &&>(static_cast<any const&&>(a)); // expected-note {{requested here}}
-}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
deleted file mode 100644
index 1c52a64fce62..000000000000
--- a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// template <class ValueType>
-// ValueType const any_cast(any const&);
-//
-// template <class ValueType>
-// ValueType any_cast(any &);
-//
-// template <class ValueType>
-// ValueType any_cast(any &&);
-
-// Test instantiating the any_cast with a non-copyable type.
-
-#include <experimental/any>
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-struct no_copy
-{
- no_copy() {}
- no_copy(no_copy &&) {}
-private:
- no_copy(no_copy const &);
-};
-
-int main() {
- any a;
- any_cast<no_copy>(static_cast<any&>(a));
- any_cast<no_copy>(static_cast<any const&>(a));
- any_cast<no_copy>(static_cast<any &&>(a));
- // expected-error@experimental/any:* 3 {{static_assert failed "_ValueType is required to be a reference or a CopyConstructible type."}}
- // expected-error@experimental/any:* 3 {{calling a private constructor of class 'no_copy'}}
-}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp
deleted file mode 100644
index edef3d0a42be..000000000000
--- a/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// template <class ValueType>
-// ValueType const* any_cast(any const *) noexcept;
-//
-// template <class ValueType>
-// ValueType * any_cast(any *) noexcept;
-
-#include <experimental/any>
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-int main()
-{
- any a(1);
- any_cast<int &>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any_cast<int &&>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any_cast<int const &>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any_cast<int const&&>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any const& a2 = a;
- any_cast<int &>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any_cast<int &&>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any_cast<int const &>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
- any_cast<int const &&>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}}
-}
diff --git a/test/std/experimental/any/any.nonmembers/swap.pass.cpp b/test/std/experimental/any/any.nonmembers/swap.pass.cpp
deleted file mode 100644
index e79bc9ef099c..000000000000
--- a/test/std/experimental/any/any.nonmembers/swap.pass.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/any>
-
-// void swap(any &, any &) noexcept
-
-// swap(...) just wraps any::swap(...). That function is tested elsewhere.
-
-#include <experimental/any>
-#include <cassert>
-
-using std::experimental::any;
-using std::experimental::any_cast;
-
-int main()
-{
-
- { // test noexcept
- any a;
- static_assert(noexcept(swap(a, a)), "swap(any&, any&) must be noexcept");
- }
- {
- any a1(1);
- any a2(2);
-
- swap(a1, a2);
-
- // Support testing against system dylibs that don't have bad_any_cast.
- assert(*any_cast<int>(&a1) == 2);
- assert(*any_cast<int>(&a2) == 1);
- }
-}
diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp b/test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp
deleted file mode 100644
index 9a92f0698ba7..000000000000
--- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// class directory_entry
-
-// directory_entry() noexcept = default;
-// directory_entry(const directory_entry&) = default;
-// directory_entry(directory_entry&&) noexcept = default;
-// explicit directory_entry(const path);
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <cassert>
-
-namespace fs = std::experimental::filesystem;
-
-void test_default_ctor()
-{
- using namespace fs;
- // Default
- {
- static_assert(std::is_nothrow_default_constructible<directory_entry>::value,
- "directory_entry must have a nothrow default constructor");
- directory_entry e;
- assert(e.path() == path());
- }
-}
-
-
-void test_copy_ctor()
-{
- using namespace fs;
- // Copy
- {
- static_assert(std::is_copy_constructible<directory_entry>::value,
- "directory_entry must be copy constructible");
- static_assert(!std::is_nothrow_copy_constructible<directory_entry>::value,
- "directory_entry's copy constructor cannot be noexcept");
- const path p("foo/bar/baz");
- const directory_entry e(p);
- assert(e.path() == p);
- directory_entry e2(e);
- assert(e.path() == p);
- assert(e2.path() == p);
- }
-
-}
-
-void test_move_ctor()
-{
- using namespace fs;
- // Move
- {
- static_assert(std::is_nothrow_move_constructible<directory_entry>::value,
- "directory_entry must be nothrow move constructible");
- const path p("foo/bar/baz");
- directory_entry e(p);
- assert(e.path() == p);
- directory_entry e2(std::move(e));
- assert(e2.path() == p);
- assert(e.path() != p); // Testing moved from state.
- }
-}
-
-void test_path_ctor() {
- using namespace fs;
- {
- static_assert(std::is_constructible<directory_entry, const path&>::value,
- "directory_entry must be constructible from path");
- static_assert(!std::is_nothrow_constructible<directory_entry, const path&>::value,
- "directory_entry constructor should not be noexcept");
- static_assert(!std::is_convertible<path const&, directory_entry>::value,
- "directory_entry constructor should be explicit");
- }
- {
- const path p("foo/bar/baz");
- const directory_entry e(p);
- assert(p == e.path());
- }
-}
-
-int main() {
- test_default_ctor();
- test_copy_ctor();
- test_move_ctor();
- test_path_ctor();
-}
diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp b/test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp
deleted file mode 100644
index 97ecbefac42a..000000000000
--- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// class directory_entry
-
-// directory_entry& operator=(directory_entry const&) = default;
-// directory_entry& operator=(directory_entry&&) noexcept = default;
-// void assign(path const&);
-// void replace_filename(path const&);
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <cassert>
-
-namespace fs = std::experimental::filesystem;
-
-void test_copy_assign_operator()
-{
- using namespace fs;
- // Copy
- {
- static_assert(std::is_copy_assignable<directory_entry>::value,
- "directory_entry must be copy assignable");
- static_assert(!std::is_nothrow_copy_assignable<directory_entry>::value,
- "directory_entry's copy assignment cannot be noexcept");
- const path p("foo/bar/baz");
- const path p2("abc");
- const directory_entry e(p);
- directory_entry e2;
- assert(e.path() == p && e2.path() == path());
- e2 = e;
- assert(e.path() == p && e2.path() == p);
- directory_entry e3(p2);
- e2 = e3;
- assert(e2.path() == p2 && e3.path() == p2);
- }
-}
-
-
-void test_move_assign_operator()
-{
- using namespace fs;
- // Copy
- {
- static_assert(std::is_nothrow_move_assignable<directory_entry>::value,
- "directory_entry is noexcept move assignable");
- const path p("foo/bar/baz");
- const path p2("abc");
- directory_entry e(p);
- directory_entry e2(p2);
- assert(e.path() == p && e2.path() == p2);
- e2 = std::move(e);
- assert(e2.path() == p);
- assert(e.path() != p); // testing moved from state
- }
-}
-
-void test_path_assign_method()
-{
- using namespace fs;
- const path p("foo/bar/baz");
- const path p2("abc");
- directory_entry e(p);
- {
- static_assert(std::is_same<decltype(e.assign(p)), void>::value,
- "return type should be void");
- static_assert(noexcept(e.assign(p)) == false, "operation must not be noexcept");
- }
- {
- assert(e.path() == p);
- e.assign(p2);
- assert(e.path() == p2 && e.path() != p);
- e.assign(p);
- assert(e.path() == p && e.path() != p2);
- }
-}
-
-void test_replace_filename_method()
-{
- using namespace fs;
- const path p("/path/to/foo.exe");
- const path replace("bar.out");
- const path expect("/path/to/bar.out");
- directory_entry e(p);
- {
- static_assert(noexcept(e.replace_filename(replace)) == false,
- "operation cannot be noexcept");
- static_assert(std::is_same<decltype(e.replace_filename(replace)), void>::value,
- "operation must return void");
- }
- {
- assert(e.path() == p);
- e.replace_filename(replace);
- assert(e.path() == expect);
- }
-}
-
-int main() {
- test_copy_assign_operator();
- test_move_assign_operator();
- test_path_assign_method();
- test_replace_filename_method();
-}
diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp b/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp
deleted file mode 100644
index 54c5172ebce4..000000000000
--- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// class directory_entry
-
-// file_status status() const;
-// file_status status(error_code const&) const noexcept;
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <cassert>
-
-#include "filesystem_test_helper.hpp"
-
-int main()
-{
- using namespace fs;
- {
- const directory_entry e("foo");
- std::error_code ec;
- static_assert(std::is_same<decltype(e.status()), file_status>::value, "");
- static_assert(std::is_same<decltype(e.status(ec)), file_status>::value, "");
- static_assert(noexcept(e.status()) == false, "");
- static_assert(noexcept(e.status(ec)) == true, "");
- }
- auto TestFn = [](path const& p) {
- const directory_entry e(p);
- std::error_code pec, eec;
- file_status ps = fs::status(p, pec);
- file_status es = e.status(eec);
- assert(ps.type() == es.type());
- assert(ps.permissions() == es.permissions());
- assert(pec == eec);
- };
- {
- TestFn(StaticEnv::File);
- TestFn(StaticEnv::Dir);
- TestFn(StaticEnv::SymlinkToFile);
- TestFn(StaticEnv::DNE);
- }
-}
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
deleted file mode 100644
index 28e945b68970..000000000000
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// path absolute(const path& p, const path& base=current_path());
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "rapid-cxx-test.hpp"
-#include "filesystem_test_helper.hpp"
-
-using namespace std::experimental::filesystem;
-
-TEST_SUITE(filesystem_absolute_path_test_suite)
-
-TEST_CASE(absolute_signature_test)
-{
- const path p; ((void)p);
- ASSERT_NOT_NOEXCEPT(absolute(p));
- ASSERT_NOT_NOEXCEPT(absolute(p, p));
-}
-
-// There are 4 cases is the proposal for absolute path.
-// Each scope tests one of the cases.
-TEST_CASE(absolute_path_test)
-{
- // has_root_name() && has_root_directory()
- {
- const path p("//net/foo");
- const path base("//net/bar/baz");
- TEST_REQUIRE(p.has_root_name());
- TEST_REQUIRE(p.has_root_directory());
- TEST_CHECK(p.is_absolute());
- path ret = absolute(p, base);
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(ret == p);
- }
- // !has_root_name() && has_root_directory()
- {
- const path p("/foo");
- const path base("//net/bar");
- TEST_REQUIRE(not p.has_root_name());
- TEST_REQUIRE(p.has_root_directory());
- TEST_CHECK(p.is_absolute());
- // ensure absolute(base) is not recursively called
- TEST_REQUIRE(base.has_root_name());
- TEST_REQUIRE(base.has_root_directory());
-
- path ret = absolute(p, base);
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(ret.has_root_name());
- TEST_CHECK(ret.root_name() == path("//net"));
- TEST_CHECK(ret.has_root_directory());
- TEST_CHECK(ret.root_directory() == path("/"));
- TEST_CHECK(ret == path("//net/foo"));
- }
- // has_root_name() && !has_root_directory()
- {
- const path p("//net");
- const path base("//net/foo/bar");
- TEST_REQUIRE(p.has_root_name());
- TEST_REQUIRE(not p.has_root_directory());
- TEST_CHECK(not p.is_absolute());
- // absolute is called recursively on base. The following conditions
- // must be true for it to return base unmodified
- TEST_REQUIRE(base.has_root_name());
- TEST_REQUIRE(base.has_root_directory());
- path ret = absolute(p, base);
- const path expect("//net/foo/bar");
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(ret == path("//net/foo/bar"));
- }
- // !has_root_name() && !has_root_directory()
- {
- const path p("bar/baz");
- const path base("//net/foo");
- TEST_REQUIRE(not p.has_root_name());
- TEST_REQUIRE(not p.has_root_directory());
- TEST_REQUIRE(base.has_root_name());
- TEST_REQUIRE(base.has_root_directory());
-
- path ret = absolute(p, base);
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(ret == path("//net/foo/bar/baz"));
- }
-}
-
-TEST_CASE(absolute_path_with_default_base)
-{
- const path testCases[] = {
- "//net/foo", // has_root_name() && has_root_directory()
- "/foo", // !has_root_name() && has_root_directory()
- "//net", // has_root_name() && !has_root_directory()
- "bar/baz" // !has_root_name() && !has_root_directory()
- };
- const path base = current_path();
- for (auto& p : testCases) {
- const path ret = absolute(p);
- const path expect = absolute(p, base);
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(ret == expect);
- }
-}
-
-TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
deleted file mode 100644
index 8c5241c71af8..000000000000
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// bool copy_file(const path& from, const path& to);
-// bool copy_file(const path& from, const path& to, error_code& ec) noexcept;
-// bool copy_file(const path& from, const path& to, copy_options options);
-// bool copy_file(const path& from, const path& to, copy_options options,
-// error_code& ec) noexcept;
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <chrono>
-#include <cassert>
-
-#include "test_macros.h"
-#include "rapid-cxx-test.hpp"
-#include "filesystem_test_helper.hpp"
-
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
-
-using CO = fs::copy_options;
-
-TEST_SUITE(filesystem_copy_file_test_suite)
-
-TEST_CASE(test_signatures)
-{
- const path p; ((void)p);
- const copy_options opts{}; ((void)opts);
- std::error_code ec; ((void)ec);
- ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p)), bool);
- ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts)), bool);
- ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, ec)), bool);
- ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts, ec)), bool);
- ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p));
- ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts));
- ASSERT_NOEXCEPT(fs::copy_file(p, p, ec));
- ASSERT_NOEXCEPT(fs::copy_file(p, p, opts, ec));
-}
-
-TEST_CASE(test_error_reporting)
-{
- auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
- {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- fs::copy_file(f, t);
- return false;
- } catch (filesystem_error const& err) {
- return err.path1() == f
- && err.path2() == t
- && err.code() == ec;
- }
-#else
- ((void)f); ((void)t); ((void)ec);
- return true;
-#endif
- };
-
- scoped_test_env env;
- const path file = env.create_file("file1", 42);
- const path file2 = env.create_file("file2", 55);
- const path dne = env.make_env_path("dne");
- { // exists(to) && equivalent(to, from)
- std::error_code ec;
- TEST_CHECK(fs::copy_file(file, file, ec) == false);
- TEST_REQUIRE(ec);
- TEST_CHECK(checkThrow(file, file, ec));
- }
- { // exists(to) && !(skip_existing | overwrite_existing | update_existing)
- std::error_code ec;
- TEST_CHECK(fs::copy_file(file, file2, ec) == false);
- TEST_REQUIRE(ec);
- TEST_CHECK(checkThrow(file, file2, ec));
- }
-}
-
-TEST_CASE(copy_file)
-{
- scoped_test_env env;
- const path file = env.create_file("file1", 42);
-
- { // !exists(to)
- const path dest = env.make_env_path("dest1");
- std::error_code ec;
- TEST_REQUIRE(fs::copy_file(file, dest, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(dest) == 42);
- }
- { // exists(to) && overwrite_existing
- const path dest = env.create_file("dest2", 55);
- std::error_code ec;
- TEST_REQUIRE(fs::copy_file(file, dest,
- copy_options::overwrite_existing, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(dest) == 42);
- }
- { // exists(to) && update_existing
- using Sec = std::chrono::seconds;
- const path older = env.create_file("older_file", 1);
-
- SleepFor(Sec(2));
- const path from = env.create_file("update_from", 55);
-
- SleepFor(Sec(2));
- const path newer = env.create_file("newer_file", 2);
-
- std::error_code ec;
- TEST_REQUIRE(fs::copy_file(from, older, copy_options::update_existing, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(older) == 55);
-
- TEST_REQUIRE(fs::copy_file(from, newer, copy_options::update_existing, ec) == false);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(newer) == 2);
- }
- { // skip_existing
- const path file2 = env.create_file("file2", 55);
- std::error_code ec;
- TEST_REQUIRE(fs::copy_file(file, file2, copy_options::skip_existing, ec) == false);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(file2) == 55);
- }
-}
-
-TEST_CASE(test_attributes_get_copied)
-{
- scoped_test_env env;
- const path file = env.create_file("file1", 42);
- const path dest = env.make_env_path("file2");
- auto st = status(file);
- perms new_perms = perms::owner_read;
- permissions(file, new_perms);
- std::error_code ec;
- TEST_REQUIRE(fs::copy_file(file, dest, ec) == true);
- TEST_CHECK(!ec);
- auto new_st = status(dest);
- TEST_CHECK(new_st.permissions() == new_perms);
-}
-
-TEST_CASE(copy_dir_test)
-{
- scoped_test_env env;
- const path file = env.create_file("file1", 42);
- const path dest = env.create_dir("dir1");
- std::error_code ec = GetTestEC();
- TEST_CHECK(fs::copy_file(file, dest, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
- ec = GetTestEC();
- TEST_CHECK(fs::copy_file(dest, file, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
-}
-
-TEST_CASE(non_regular_file_test)
-{
- scoped_test_env env;
- const path fifo = env.create_fifo("fifo");
- const path dest = env.make_env_path("dest");
- const path file = env.create_file("file", 42);
- {
- std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(!exists(dest));
- }
- {
- std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(is_fifo(fifo));
- }
-}
-
-TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
deleted file mode 100644
index cdd177399aa7..000000000000
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// file_time_type last_write_time(const path& p);
-// file_time_type last_write_time(const path& p, std::error_code& ec) noexcept;
-// void last_write_time(const path& p, file_time_type new_time);
-// void last_write_time(const path& p, file_time_type new_type,
-// std::error_code& ec) noexcept;
-
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <chrono>
-#include <fstream>
-#include <cstdlib>
-
-#include "test_macros.h"
-#include "rapid-cxx-test.hpp"
-#include "filesystem_test_helper.hpp"
-
-#include <sys/stat.h>
-#include <iostream>
-
-using namespace std::experimental::filesystem;
-
-
-std::pair<std::time_t, std::time_t> GetTimes(path const& p) {
- using Clock = file_time_type::clock;
- struct ::stat st;
- if (::stat(p.c_str(), &st) == -1) {
- std::error_code ec(errno, std::generic_category());
-#ifndef TEST_HAS_NO_EXCEPTIONS
- throw ec;
-#else
- std::cerr << ec.message() << std::endl;
- std::exit(EXIT_FAILURE);
-#endif
- }
- return {st.st_atime, st.st_mtime};
-}
-
-std::time_t LastAccessTime(path const& p) {
- return GetTimes(p).first;
-}
-
-std::time_t LastWriteTime(path const& p) {
- return GetTimes(p).second;
-}
-
-std::pair<std::time_t, std::time_t> GetSymlinkTimes(path const& p) {
- using Clock = file_time_type::clock;
- struct ::stat st;
- if (::lstat(p.c_str(), &st) == -1) {
- std::error_code ec(errno, std::generic_category());
-#ifndef TEST_HAS_NO_EXCEPTIONS
- throw ec;
-#else
- std::cerr << ec.message() << std::endl;
- std::exit(EXIT_FAILURE);
-#endif
- }
- return {st.st_atime, st.st_mtime};
-}
-
-namespace {
-bool TestSupportsNegativeTimes() {
- using namespace std::chrono;
- std::error_code ec;
- std::time_t old_write_time, new_write_time;
- { // WARNING: Do not assert in this scope.
- scoped_test_env env;
- const path file = env.create_file("file", 42);
- old_write_time = LastWriteTime(file);
- file_time_type tp(seconds(-5));
- fs::last_write_time(file, tp, ec);
- new_write_time = LastWriteTime(file);
- }
- return !ec && new_write_time <= -5;
-}
-
-// In some configurations, the comparison is tautological and the test is valid.
-// We disable the warning so that we can actually test it regardless. Also, that
-// diagnostic is pretty new, so also don't fail if old clang does not support it
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-warning-option"
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wtautological-constant-compare"
-#endif
-
-bool TestSupportsMaxTime() {
- using namespace std::chrono;
- using Lim = std::numeric_limits<std::time_t>;
- auto max_sec = duration_cast<seconds>(file_time_type::max().time_since_epoch()).count();
- if (max_sec > Lim::max()) return false;
- std::error_code ec;
- std::time_t old_write_time, new_write_time;
- { // WARNING: Do not assert in this scope.
- scoped_test_env env;
- const path file = env.create_file("file", 42);
- old_write_time = LastWriteTime(file);
- file_time_type tp = file_time_type::max();
- fs::last_write_time(file, tp, ec);
- new_write_time = LastWriteTime(file);
- }
- return !ec && new_write_time > max_sec - 1;
-}
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
-static const bool SupportsNegativeTimes = TestSupportsNegativeTimes();
-static const bool SupportsMaxTime = TestSupportsMaxTime();
-
-} // end namespace
-
-// In some configurations, the comparison is tautological and the test is valid.
-// We disable the warning so that we can actually test it regardless. Also, that
-// diagnostic is pretty new, so also don't fail if old clang does not support it
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-warning-option"
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wtautological-constant-compare"
-#endif
-
-// Check if a time point is representable on a given filesystem. Check that:
-// (A) 'tp' is representable as a time_t
-// (B) 'tp' is non-negative or the filesystem supports negative times.
-// (C) 'tp' is not 'file_time_type::max()' or the filesystem supports the max
-// value.
-inline bool TimeIsRepresentableByFilesystem(file_time_type tp) {
- using namespace std::chrono;
- using Lim = std::numeric_limits<std::time_t>;
- auto sec = duration_cast<seconds>(tp.time_since_epoch()).count();
- auto microsec = duration_cast<microseconds>(tp.time_since_epoch()).count();
- if (sec < Lim::min() || sec > Lim::max()) return false;
- else if (microsec < 0 && !SupportsNegativeTimes) return false;
- else if (tp == file_time_type::max() && !SupportsMaxTime) return false;
- return true;
-}
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
-TEST_SUITE(exists_test_suite)
-
-TEST_CASE(signature_test)
-{
- const file_time_type t;
- const path p; ((void)p);
- std::error_code ec; ((void)ec);
- ASSERT_SAME_TYPE(decltype(last_write_time(p)), file_time_type);
- ASSERT_SAME_TYPE(decltype(last_write_time(p, ec)), file_time_type);
- ASSERT_SAME_TYPE(decltype(last_write_time(p, t)), void);
- ASSERT_SAME_TYPE(decltype(last_write_time(p, t, ec)), void);
- ASSERT_NOT_NOEXCEPT(last_write_time(p));
- ASSERT_NOT_NOEXCEPT(last_write_time(p, t));
- ASSERT_NOEXCEPT(last_write_time(p, ec));
- ASSERT_NOEXCEPT(last_write_time(p, t, ec));
-}
-
-TEST_CASE(read_last_write_time_static_env_test)
-{
- using C = file_time_type::clock;
- file_time_type min = file_time_type::min();
- {
- file_time_type ret = last_write_time(StaticEnv::File);
- TEST_CHECK(ret != min);
- TEST_CHECK(ret < C::now());
- TEST_CHECK(C::to_time_t(ret) == LastWriteTime(StaticEnv::File));
-
- file_time_type ret2 = last_write_time(StaticEnv::SymlinkToFile);
- TEST_CHECK(ret == ret2);
- TEST_CHECK(C::to_time_t(ret2) == LastWriteTime(StaticEnv::SymlinkToFile));
- }
- {
- file_time_type ret = last_write_time(StaticEnv::Dir);
- TEST_CHECK(ret != min);
- TEST_CHECK(ret < C::now());
- TEST_CHECK(C::to_time_t(ret) == LastWriteTime(StaticEnv::Dir));
-
- file_time_type ret2 = last_write_time(StaticEnv::SymlinkToDir);
- TEST_CHECK(ret == ret2);
- TEST_CHECK(C::to_time_t(ret2) == LastWriteTime(StaticEnv::SymlinkToDir));
- }
-}
-
-TEST_CASE(get_last_write_time_dynamic_env_test)
-{
- using Clock = file_time_type::clock;
- using Sec = std::chrono::seconds;
- scoped_test_env env;
-
- const path file = env.create_file("file", 42);
- const path dir = env.create_dir("dir");
-
- const auto file_times = GetTimes(file);
- const std::time_t file_access_time = file_times.first;
- const std::time_t file_write_time = file_times.second;
- const auto dir_times = GetTimes(dir);
- const std::time_t dir_access_time = dir_times.first;
- const std::time_t dir_write_time = dir_times.second;
-
- file_time_type ftime = last_write_time(file);
- TEST_CHECK(Clock::to_time_t(ftime) == file_write_time);
-
- file_time_type dtime = last_write_time(dir);
- TEST_CHECK(Clock::to_time_t(dtime) == dir_write_time);
-
- SleepFor(Sec(2));
-
- // update file and add a file to the directory. Make sure the times increase.
- std::ofstream of(file, std::ofstream::app);
- of << "hello";
- of.close();
- env.create_file("dir/file1", 1);
-
- file_time_type ftime2 = last_write_time(file);
- file_time_type dtime2 = last_write_time(dir);
-
- TEST_CHECK(ftime2 > ftime);
- TEST_CHECK(dtime2 > dtime);
- TEST_CHECK(LastAccessTime(file) == file_access_time ||
- LastAccessTime(file) == Clock::to_time_t(ftime2));
- TEST_CHECK(LastAccessTime(dir) == dir_access_time);
-}
-
-
-TEST_CASE(set_last_write_time_dynamic_env_test)
-{
- using Clock = file_time_type::clock;
- using Sec = std::chrono::seconds;
- using Hours = std::chrono::hours;
- using Minutes = std::chrono::minutes;
- using MicroSec = std::chrono::microseconds;
- scoped_test_env env;
-
- const path file = env.create_file("file", 42);
- const path dir = env.create_dir("dir");
- const auto now = Clock::now();
- const file_time_type epoch_time = now - now.time_since_epoch();
-
- const file_time_type future_time = now + Hours(3) + Sec(42) + MicroSec(17);
- const file_time_type past_time = now - Minutes(3) - Sec(42) - MicroSec(17);
- const file_time_type before_epoch_time = epoch_time - Minutes(3) - Sec(42) - MicroSec(17);
- // FreeBSD has a bug in their utimes implementation where the time is not update
- // when the number of seconds is '-1'.
-#if defined(__FreeBSD__)
- const file_time_type just_before_epoch_time = epoch_time - Sec(2) - MicroSec(17);
-#else
- const file_time_type just_before_epoch_time = epoch_time - MicroSec(17);
-#endif
-
- struct TestCase {
- path p;
- file_time_type new_time;
- } cases[] = {
- {file, epoch_time},
- {dir, epoch_time},
- {file, future_time},
- {dir, future_time},
- {file, past_time},
- {dir, past_time},
- {file, before_epoch_time},
- {dir, before_epoch_time},
- {file, just_before_epoch_time},
- {dir, just_before_epoch_time}
- };
- for (const auto& TC : cases) {
- const auto old_times = GetTimes(TC.p);
- file_time_type old_time(Sec(old_times.second));
-
- std::error_code ec = GetTestEC();
- last_write_time(TC.p, TC.new_time, ec);
- TEST_CHECK(!ec);
-
- file_time_type got_time = last_write_time(TC.p);
-
- if (TimeIsRepresentableByFilesystem(TC.new_time)) {
- TEST_CHECK(got_time != old_time);
- if (TC.new_time < epoch_time) {
- TEST_CHECK(got_time <= TC.new_time);
- TEST_CHECK(got_time > TC.new_time - Sec(1));
- } else {
- TEST_CHECK(got_time <= TC.new_time + Sec(1));
- TEST_CHECK(got_time >= TC.new_time - Sec(1));
- }
- TEST_CHECK(LastAccessTime(TC.p) == old_times.first);
- }
- }
-}
-
-TEST_CASE(last_write_time_symlink_test)
-{
- using Clock = file_time_type::clock;
- using Sec = std::chrono::seconds;
- using Hours = std::chrono::hours;
- using Minutes = std::chrono::minutes;
-
- scoped_test_env env;
-
- const path file = env.create_file("file", 42);
- const path sym = env.create_symlink("file", "sym");
-
- const file_time_type new_time = Clock::now() + Hours(3);
-
- const auto old_times = GetTimes(sym);
- const auto old_sym_times = GetSymlinkTimes(sym);
-
- std::error_code ec = GetTestEC();
- last_write_time(sym, new_time, ec);
- TEST_CHECK(!ec);
-
- const std::time_t new_time_t = Clock::to_time_t(new_time);
- file_time_type got_time = last_write_time(sym);
- std::time_t got_time_t = Clock::to_time_t(got_time);
-
- TEST_CHECK(got_time_t != old_times.second);
- TEST_CHECK(got_time_t == new_time_t);
- TEST_CHECK(LastWriteTime(file) == new_time_t);
- TEST_CHECK(LastAccessTime(sym) == old_times.first);
- TEST_CHECK(GetSymlinkTimes(sym) == old_sym_times);
-}
-
-
-TEST_CASE(test_write_min_time)
-{
- using Clock = file_time_type::clock;
- using Sec = std::chrono::seconds;
- using MicroSec = std::chrono::microseconds;
- using Lim = std::numeric_limits<std::time_t>;
- scoped_test_env env;
- const path p = env.create_file("file", 42);
-
- std::error_code ec = GetTestEC();
- file_time_type new_time = file_time_type::min();
-
- last_write_time(p, new_time, ec);
- file_time_type tt = last_write_time(p);
-
- if (TimeIsRepresentableByFilesystem(new_time)) {
- TEST_CHECK(!ec);
- TEST_CHECK(tt >= new_time);
- TEST_CHECK(tt < new_time + Sec(1));
- }
-
- ec = GetTestEC();
- last_write_time(p, Clock::now());
-
- new_time = file_time_type::min() + MicroSec(1);
-
- last_write_time(p, new_time, ec);
- tt = last_write_time(p);
-
- if (TimeIsRepresentableByFilesystem(new_time)) {
- TEST_CHECK(!ec);
- TEST_CHECK(tt >= new_time);
- TEST_CHECK(tt < new_time + Sec(1));
- }
-}
-
-
-
-TEST_CASE(test_write_min_max_time)
-{
- using Clock = file_time_type::clock;
- using Sec = std::chrono::seconds;
- using Hours = std::chrono::hours;
- using Lim = std::numeric_limits<std::time_t>;
- scoped_test_env env;
- const path p = env.create_file("file", 42);
-
- std::error_code ec = GetTestEC();
- file_time_type new_time = file_time_type::max();
-
- ec = GetTestEC();
- last_write_time(p, new_time, ec);
- file_time_type tt = last_write_time(p);
-
- if (TimeIsRepresentableByFilesystem(new_time)) {
- TEST_CHECK(!ec);
- TEST_CHECK(tt > new_time - Sec(1));
- TEST_CHECK(tt <= new_time);
- }
-}
-
-TEST_CASE(test_value_on_failure)
-{
- const path p = StaticEnv::DNE;
- std::error_code ec = GetTestEC();
- TEST_CHECK(last_write_time(p, ec) == file_time_type::min());
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
-}
-
-TEST_CASE(test_exists_fails)
-{
- scoped_test_env env;
- const path dir = env.create_dir("dir");
- const path file = env.create_file("dir/file", 42);
- permissions(dir, perms::none);
-
- std::error_code ec = GetTestEC();
- TEST_CHECK(last_write_time(file, ec) == file_time_type::min());
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
-
- TEST_CHECK_THROW(filesystem_error, last_write_time(file));
-}
-
-TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp
deleted file mode 100644
index 634184e24e6d..000000000000
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// path system_complete(const path& p);
-// path system_complete(const path& p, error_code& ec);
-
-// Note: For POSIX based operating systems, 'system_complete(p)' has the
-// same semantics as 'absolute(p, current_path())'.
-
-#include <experimental/filesystem>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "rapid-cxx-test.hpp"
-#include "filesystem_test_helper.hpp"
-
-using namespace std::experimental::filesystem;
-
-TEST_SUITE(filesystem_system_complete_test_suite)
-
-TEST_CASE(signature_test)
-{
- const path p; ((void)p);
- std::error_code ec; ((void)ec);
- ASSERT_NOT_NOEXCEPT(system_complete(p));
- ASSERT_NOT_NOEXCEPT(system_complete(p, ec));
-}
-
-
-TEST_CASE(basic_system_complete_tests)
-{
- const path testCases[] = {
- "//net/foo", // has_root_name() && has_root_directory()
- "/foo", // !has_root_name() && has_root_directory()
- "//net", // has_root_name() && !has_root_directory()
- "bar/baz" // !has_root_name() && !has_root_directory()
- };
- const path base = current_path();
- for (auto& p : testCases) {
- const path ret = system_complete(p);
- const path expect = absolute(p, base);
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(ret == expect);
- }
-}
-
-TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp b/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
index d57dff4a7b78..c82d558c110a 100644
--- a/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
+++ b/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
@@ -7,18 +7,23 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03
-
// <experimental/filesystem>
// #define __cpp_lib_experimental_filesystem 201406L
#include <experimental/filesystem>
+#include "test_macros.h"
+#if TEST_STD_VER >= 11
#ifndef __cpp_lib_experimental_filesystem
#error Filesystem feature test macro is not defined (__cpp_lib_experimental_filesystem)
#elif __cpp_lib_experimental_filesystem != 201406L
#error Filesystem feature test macro has an incorrect value (__cpp_lib_experimental_filesystem)
#endif
+#else // TEST_STD_VER < 11
+#ifdef __cpp_lib_experimental_filesystem
+#error Filesystem feature test macro should not be defined in c++03
+#endif
+#endif
int main() { }
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp
new file mode 100644
index 000000000000..030e7af07919
--- /dev/null
+++ b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// UNSUPPORTED: ubsan
+
+// <experimental/coroutine>
+// struct noop_coroutine_promise;
+// using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
+// noop_coroutine_handle noop_coroutine() noexcept;
+
+#include <experimental/coroutine>
+#include <cassert>
+#include <type_traits>
+
+#if __has_builtin(__builtin_coro_noop)
+
+namespace coro = std::experimental::coroutines_v1;
+
+
+static_assert(std::is_same<coro::coroutine_handle<coro::noop_coroutine_promise>, coro::noop_coroutine_handle>::value, "");
+static_assert(std::is_same<decltype(coro::noop_coroutine()), coro::noop_coroutine_handle>::value, "");
+
+// template <> struct coroutine_handle<noop_coroutine_promise> : coroutine_handle<>
+// {
+// // 18.11.2.7 noop observers
+// constexpr explicit operator bool() const noexcept;
+// constexpr bool done() const noexcept;
+
+// // 18.11.2.8 noop resumption
+// constexpr void operator()() const noexcept;
+// constexpr void resume() const noexcept;
+// constexpr void destroy() const noexcept;
+
+// // 18.11.2.9 noop promise access
+// noop_coroutine_promise& promise() const noexcept;
+
+// // 18.11.2.10 noop address
+// constexpr void* address() const noexcept;
+
+int main()
+{
+ auto h = coro::noop_coroutine();
+ coro::coroutine_handle<> base = h;
+
+ assert(h);
+ assert(base);
+
+ assert(!h.done());
+ assert(!base.done());
+
+ h.resume();
+ h.destroy();
+ h();
+ static_assert(h.done() == false, "");
+ static_assert(h, "");
+
+ h.promise();
+ assert(h.address() == base.address());
+ assert(h.address() != nullptr);
+ assert(coro::coroutine_handle<>::from_address(h.address()) == base);
+}
+
+#else
+
+int main() {}
+
+#endif // __has_builtin(__builtin_coro_noop)
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
index acc42d39f60c..666d8f7807d4 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
@@ -90,6 +90,32 @@ void test_pmr_uses_allocator(std::pair<TT, UU> const& p)
assert((doTest<T, U>(UA_AllocArg, UA_None, p)));
}
}
+
+template <class Alloc, class TT, class UU>
+void test_pmr_not_uses_allocator(std::pair<TT, UU> const& p)
+{
+ {
+ using T = NotUsesAllocator<Alloc, 1>;
+ using U = NotUsesAllocator<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, p)));
+ }
+ {
+ using T = UsesAllocatorV1<Alloc, 1>;
+ using U = UsesAllocatorV2<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, p)));
+ }
+ {
+ using T = UsesAllocatorV2<Alloc, 1>;
+ using U = UsesAllocatorV3<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, p)));
+ }
+ {
+ using T = UsesAllocatorV3<Alloc, 1>;
+ using U = NotUsesAllocator<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, p)));
+ }
+}
+
template <class Tp>
struct Print;
@@ -103,7 +129,7 @@ int main()
int y = 42;
const std::pair<int, int&> p(x, y);
test_pmr_uses_allocator<ERT>(p);
- test_pmr_uses_allocator<PMR>(p);
+ test_pmr_not_uses_allocator<PMR>(p);
test_pmr_uses_allocator<PMA>(p);
}
{
@@ -111,7 +137,7 @@ int main()
int y = 42;
const std::pair<int&, int&&> p(x, std::move(y));
test_pmr_uses_allocator<ERT>(p);
- test_pmr_uses_allocator<PMR>(p);
+ test_pmr_not_uses_allocator<PMR>(p);
test_pmr_uses_allocator<PMA>(p);
}
}
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
index 05cf82cfbd2b..9e316991c022 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
@@ -90,6 +90,31 @@ void test_pmr_uses_allocator(std::pair<TT, UU>&& p)
}
}
+template <class Alloc, class TT, class UU>
+void test_pmr_not_uses_allocator(std::pair<TT, UU>&& p)
+{
+ {
+ using T = NotUsesAllocator<Alloc, 1>;
+ using U = NotUsesAllocator<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
+ }
+ {
+ using T = UsesAllocatorV1<Alloc, 1>;
+ using U = UsesAllocatorV2<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
+ }
+ {
+ using T = UsesAllocatorV2<Alloc, 1>;
+ using U = UsesAllocatorV3<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
+ }
+ {
+ using T = UsesAllocatorV3<Alloc, 1>;
+ using U = NotUsesAllocator<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
+ }
+}
+
int main()
{
using ERT = std::experimental::erased_type;
@@ -100,7 +125,7 @@ int main()
int y = 42;
std::pair<int&, int&&> p(x, std::move(y));
test_pmr_uses_allocator<ERT>(std::move(p));
- test_pmr_uses_allocator<PMR>(std::move(p));
+ test_pmr_not_uses_allocator<PMR>(std::move(p));
test_pmr_uses_allocator<PMA>(std::move(p));
}
{
@@ -108,7 +133,7 @@ int main()
int y = 42;
std::pair<int&&, int&> p(std::move(x), y);
test_pmr_uses_allocator<ERT>(std::move(p));
- test_pmr_uses_allocator<PMR>(std::move(p));
+ test_pmr_not_uses_allocator<PMR>(std::move(p));
test_pmr_uses_allocator<PMA>(std::move(p));
}
}
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
index 1a76072661d6..f2f7712a4467 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
@@ -93,6 +93,35 @@ void test_pmr_uses_allocator(TT&& t, UU&& u)
}
}
+template <class Alloc, class TT, class UU>
+void test_pmr_not_uses_allocator(TT&& t, UU&& u)
+{
+ {
+ using T = NotUsesAllocator<Alloc, 1>;
+ using U = NotUsesAllocator<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::forward<TT>(t), std::forward<UU>(u))));
+ }
+ {
+ using T = UsesAllocatorV1<Alloc, 1>;
+ using U = UsesAllocatorV2<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::forward<TT>(t), std::forward<UU>(u))));
+ }
+ {
+ using T = UsesAllocatorV2<Alloc, 1>;
+ using U = UsesAllocatorV3<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::forward<TT>(t), std::forward<UU>(u))));
+ }
+ {
+ using T = UsesAllocatorV3<Alloc, 1>;
+ using U = NotUsesAllocator<Alloc, 1>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::forward<TT>(t), std::forward<UU>(u))));
+ }
+}
+
int main()
{
using ERT = std::experimental::erased_type;
@@ -102,14 +131,14 @@ int main()
int x = 42;
int y = 42;
test_pmr_uses_allocator<ERT>(x, std::move(y));
- test_pmr_uses_allocator<PMR>(x, std::move(y));
+ test_pmr_not_uses_allocator<PMR>(x, std::move(y));
test_pmr_uses_allocator<PMA>(x, std::move(y));
}
{
int x = 42;
const int y = 42;
test_pmr_uses_allocator<ERT>(std::move(x), y);
- test_pmr_uses_allocator<PMR>(std::move(x), y);
+ test_pmr_not_uses_allocator<PMR>(std::move(x), y);
test_pmr_uses_allocator<PMA>(std::move(x), y);
}
}
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
index 8f78521995d8..27807c1f4ca8 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -83,6 +83,35 @@ void test_pmr_uses_allocator(std::tuple<TTypes...> ttuple, std::tuple<UTypes...>
}
}
+template <class Alloc, class ...TTypes, class ...UTypes>
+void test_pmr_not_uses_allocator(std::tuple<TTypes...> ttuple, std::tuple<UTypes...> utuple)
+{
+ {
+ using T = NotUsesAllocator<Alloc, sizeof...(TTypes)>;
+ using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::move(ttuple), std::move(utuple))));
+ }
+ {
+ using T = UsesAllocatorV1<Alloc, sizeof...(TTypes)>;
+ using U = UsesAllocatorV2<Alloc, sizeof...(UTypes)>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::move(ttuple), std::move(utuple))));
+ }
+ {
+ using T = UsesAllocatorV2<Alloc, sizeof...(TTypes)>;
+ using U = UsesAllocatorV3<Alloc, sizeof...(UTypes)>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::move(ttuple), std::move(utuple))));
+ }
+ {
+ using T = UsesAllocatorV3<Alloc, sizeof...(TTypes)>;
+ using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>;
+ assert((doTest<T, U>(UA_None, UA_None,
+ std::move(ttuple), std::move(utuple))));
+ }
+}
+
int main()
{
using ERT = std::experimental::erased_type;
@@ -91,7 +120,7 @@ int main()
{
std::tuple<> t1;
test_pmr_uses_allocator<ERT>(t1, t1);
- test_pmr_uses_allocator<PMR>(t1, t1);
+ test_pmr_not_uses_allocator<PMR>(t1, t1);
test_pmr_uses_allocator<PMA>(t1, t1);
}
{
@@ -99,8 +128,8 @@ int main()
std::tuple<> t2;
test_pmr_uses_allocator<ERT>(t1, t2);
test_pmr_uses_allocator<ERT>(t2, t1);
- test_pmr_uses_allocator<PMR>(t1, t2);
- test_pmr_uses_allocator<PMR>(t2, t1);
+ test_pmr_not_uses_allocator<PMR>(t1, t2);
+ test_pmr_not_uses_allocator<PMR>(t2, t1);
test_pmr_uses_allocator<PMA>(t1, t2);
test_pmr_uses_allocator<PMA>(t2, t1);
}
@@ -111,8 +140,8 @@ int main()
std::tuple<int&, double&&> t2(x, std::move(dx));
test_pmr_uses_allocator<ERT>( t1, std::move(t2));
test_pmr_uses_allocator<ERT>(std::move(t2), t1);
- test_pmr_uses_allocator<PMR>( t1, std::move(t2));
- test_pmr_uses_allocator<PMR>(std::move(t2), t1);
+ test_pmr_not_uses_allocator<PMR>( t1, std::move(t2));
+ test_pmr_not_uses_allocator<PMR>(std::move(t2), t1);
test_pmr_uses_allocator<PMA>( t1, std::move(t2));
test_pmr_uses_allocator<PMA>(std::move(t2), t1);
}
@@ -126,8 +155,8 @@ int main()
std::tuple<int&, double&&, const char*> t2(x, std::move(dx), s);
test_pmr_uses_allocator<ERT>( t1, std::move(t2));
test_pmr_uses_allocator<ERT>(std::move(t2), t1);
- test_pmr_uses_allocator<PMR>( t1, std::move(t2));
- test_pmr_uses_allocator<PMR>(std::move(t2), t1);
+ test_pmr_not_uses_allocator<PMR>( t1, std::move(t2));
+ test_pmr_not_uses_allocator<PMR>(std::move(t2), t1);
test_pmr_uses_allocator<PMA>( t1, std::move(t2));
test_pmr_uses_allocator<PMA>(std::move(t2), t1);
}
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
new file mode 100644
index 000000000000..7dc8f3aaccaf
--- /dev/null
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
@@ -0,0 +1,142 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: c++experimental
+// UNSUPPORTED: c++98, c++03
+
+// <memory_resource>
+
+// template <class T> class polymorphic_allocator
+
+// template <class U1, class U2, class ...Args1, class ...Args2>
+// void polymorphic_allocator<T>::construct(pair<U1, U2>*, piecewise_construct_t
+// tuple<Args1...>, tuple<Args2...>)
+
+#include <experimental/memory_resource>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <cassert>
+#include <cstdlib>
+
+#include "test_macros.h"
+
+namespace ex = std::experimental::pmr;
+
+template <class T>
+struct EvilAlloc {
+ explicit EvilAlloc() : inner_(ex::null_memory_resource()) {}
+
+ EvilAlloc(ex::polymorphic_allocator<T> & a) : inner_(a) {}
+ EvilAlloc(ex::polymorphic_allocator<T> && a) : inner_(a) {}
+ EvilAlloc(ex::polymorphic_allocator<T> const & a) = delete;
+ EvilAlloc(ex::polymorphic_allocator<T> const && a) = delete;
+
+ using value_type = T;
+ template <class U> EvilAlloc(EvilAlloc<U> const & rhs) : inner_(rhs.inner_) {}
+
+ ex::polymorphic_allocator<T> inner_;
+};
+
+struct WidgetV0 {
+ WidgetV0(int v) : value_(v) {}
+
+ bool holds(int v, const ex::polymorphic_allocator<char>&) const {
+ return value_ == v;
+ }
+private:
+ int value_;
+};
+
+struct WidgetV1 {
+ using allocator_type = EvilAlloc<char>;
+
+ WidgetV1(int v) : value_(v), alloc_() {}
+ WidgetV1(std::allocator_arg_t, EvilAlloc<char> a, int v) : value_(v), alloc_(a) {}
+
+ bool holds(int v, const ex::polymorphic_allocator<char>& a) const {
+ return value_ == v && alloc_.inner_ == a;
+ }
+private:
+ int value_;
+ EvilAlloc<char> alloc_;
+};
+
+struct WidgetV2 {
+ using allocator_type = EvilAlloc<char>;
+
+ WidgetV2(int v) : value_(v), alloc_() {}
+ WidgetV2(int v, EvilAlloc<char> a) : value_(v), alloc_(a) {}
+
+ bool holds(int v, ex::polymorphic_allocator<char> a) const {
+ return value_ == v && alloc_.inner_ == a;
+ }
+private:
+ int value_;
+ EvilAlloc<char> alloc_;
+};
+
+struct WidgetV3 {
+ using allocator_type = EvilAlloc<char>;
+
+ WidgetV3(int v) : value_(v), alloc_() {}
+ WidgetV3(std::allocator_arg_t, EvilAlloc<char> a, int v) : value_(v), alloc_(a) {}
+ WidgetV3(int v, EvilAlloc<char> a) : value_(v), alloc_(a) {}
+
+ bool holds(int v, ex::polymorphic_allocator<char> a) const {
+ return value_ == v && alloc_.inner_ == a;
+ }
+private:
+ int value_;
+ EvilAlloc<char> alloc_;
+};
+
+static_assert(std::uses_allocator<WidgetV1, EvilAlloc<char>>::value, "");
+static_assert(std::uses_allocator<WidgetV2, EvilAlloc<char>>::value, "");
+static_assert(std::uses_allocator<WidgetV3, EvilAlloc<char>>::value, "");
+static_assert(std::uses_allocator<WidgetV1, ex::polymorphic_allocator<char>>::value, "");
+static_assert(std::uses_allocator<WidgetV2, ex::polymorphic_allocator<char>>::value, "");
+static_assert(std::uses_allocator<WidgetV3, ex::polymorphic_allocator<char>>::value, "");
+
+template<class W1, class W2>
+void test_evil()
+{
+ using PMA = ex::polymorphic_allocator<char>;
+ PMA pma(ex::new_delete_resource());
+ {
+ using Pair = std::pair<W1, W2>;
+ void *where = std::malloc(sizeof (Pair));
+ Pair *p = (Pair *)where;
+ pma.construct(p, std::piecewise_construct, std::make_tuple(42), std::make_tuple(42));
+ assert(p->first.holds(42, pma));
+ assert(p->second.holds(42, pma));
+ pma.destroy(p);
+ std::free(where);
+ }
+}
+
+int main()
+{
+ test_evil<WidgetV0, WidgetV0>();
+ test_evil<WidgetV0, WidgetV1>();
+ test_evil<WidgetV0, WidgetV2>();
+ test_evil<WidgetV0, WidgetV3>();
+ test_evil<WidgetV1, WidgetV0>();
+ test_evil<WidgetV1, WidgetV1>();
+ test_evil<WidgetV1, WidgetV2>();
+ test_evil<WidgetV1, WidgetV3>();
+ test_evil<WidgetV2, WidgetV0>();
+ test_evil<WidgetV2, WidgetV1>();
+ test_evil<WidgetV2, WidgetV2>();
+ test_evil<WidgetV2, WidgetV3>();
+ test_evil<WidgetV3, WidgetV0>();
+ test_evil<WidgetV3, WidgetV1>();
+ test_evil<WidgetV3, WidgetV2>();
+ test_evil<WidgetV3, WidgetV3>();
+}
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
index 3e83173555be..a619194fec17 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
@@ -126,6 +126,39 @@ void test_pmr_uses_alloc(Args&&... args)
}
}
+template <class Alloc, class ...Args>
+void test_pmr_not_uses_alloc(Args&&... args)
+{
+ TestResource R(12435);
+ ex::memory_resource* M = &R;
+ {
+ // NotUsesAllocator provides valid signatures for each uses-allocator
+ // construction but does not supply the required allocator_type typedef.
+ // Test that we can call these constructors manually without
+ // polymorphic_allocator interfering.
+ using T = NotUsesAllocator<Alloc, sizeof...(Args)>;
+ assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
+ assert((doTestUsesAllocV1<T>(M, std::forward<Args>(args)...)));
+ assert((doTestUsesAllocV2<T>(M, std::forward<Args>(args)...)));
+ }
+ {
+ // Test T(std::allocator_arg_t, Alloc const&, Args...) construction
+ using T = UsesAllocatorV1<Alloc, sizeof...(Args)>;
+ assert((doTest<T>(UA_None, std::forward<Args>(args)...)));
+ }
+ {
+ // Test T(Args..., Alloc const&) construction
+ using T = UsesAllocatorV2<Alloc, sizeof...(Args)>;
+ assert((doTest<T>(UA_None, std::forward<Args>(args)...)));
+ }
+ {
+ // Test that T(std::allocator_arg_t, Alloc const&, Args...) construction
+ // is preferred when T(Args..., Alloc const&) is also available.
+ using T = UsesAllocatorV3<Alloc, sizeof...(Args)>;
+ assert((doTest<T>(UA_None, std::forward<Args>(args)...)));
+ }
+}
+
// Test that polymorphic_allocator does not prevent us from manually
// doing non-pmr uses-allocator construction.
template <class Alloc, class AllocObj, class ...Args>
@@ -167,16 +200,16 @@ int main()
const int cvalue = 43;
{
test_pmr_uses_alloc<ET>();
- test_pmr_uses_alloc<PMR>();
+ test_pmr_not_uses_alloc<PMR>();
test_pmr_uses_alloc<PMA>();
test_pmr_uses_alloc<ET>(value);
- test_pmr_uses_alloc<PMR>(value);
+ test_pmr_not_uses_alloc<PMR>(value);
test_pmr_uses_alloc<PMA>(value);
test_pmr_uses_alloc<ET>(cvalue);
- test_pmr_uses_alloc<PMR>(cvalue);
+ test_pmr_not_uses_alloc<PMR>(cvalue);
test_pmr_uses_alloc<PMA>(cvalue);
test_pmr_uses_alloc<ET>(cvalue, std::move(value));
- test_pmr_uses_alloc<PMR>(cvalue, std::move(value));
+ test_pmr_not_uses_alloc<PMR>(cvalue, std::move(value));
test_pmr_uses_alloc<PMA>(cvalue, std::move(value));
}
{
diff --git a/test/std/experimental/nothing_to_do.pass.cpp b/test/std/experimental/nothing_to_do.pass.cpp
index c21f8a701685..86bf8cc11bb9 100644
--- a/test/std/experimental/nothing_to_do.pass.cpp
+++ b/test/std/experimental/nothing_to_do.pass.cpp
@@ -7,6 +7,4 @@
//
//===----------------------------------------------------------------------===//
-#include <experimental/string_view>
-
int main () {}
diff --git a/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp b/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
deleted file mode 100644
index 7b2527f22bf4..000000000000
--- a/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-#include <experimental/numeric>
-
-int main () {}
diff --git a/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp b/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp
deleted file mode 100644
index 7b2527f22bf4..000000000000
--- a/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-#include <experimental/numeric>
-
-int main () {}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp
deleted file mode 100644
index c8d6c5367d7e..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::gcd(false, 4);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp
deleted file mode 100644
index a3a2206fba63..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::gcd(2, true);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp
deleted file mode 100644
index 1f0e8a2b3a2f..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::gcd<int, const bool>(2, true);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
deleted file mode 100644
index 8b069832aac8..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::gcd(2.0, 4);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
deleted file mode 100644
index ca9b871ef5e0..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::gcd(4, 6.0);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
deleted file mode 100644
index 3f86cfe4c7f0..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-#include <experimental/numeric>
-#include <cassert>
-#include <cstdlib> // for rand()
-#include <iostream>
-
-constexpr struct {
- int x;
- int y;
- int expect;
-} Cases[] = {
- {0, 0, 0},
- {1, 0, 1},
- {0, 1, 1},
- {1, 1, 1},
- {2, 3, 1},
- {2, 4, 2},
- {36, 17, 1},
- {36, 18, 18}
-};
-
-
-template <typename Input1, typename Input2, typename Output>
-constexpr bool test0(Input1 in1, Input2 in2, Output out)
-{
- static_assert((std::is_same<Output, decltype(std::experimental::gcd(in1, in2))>::value), "" );
- static_assert((std::is_same<Output, decltype(std::experimental::gcd(in2, in1))>::value), "" );
- return out == std::experimental::gcd(in1, in2) ? true : (std::abort(), false);
-}
-
-
-template <typename Input1, typename Input2 = Input1>
-constexpr bool do_test(int = 0)
-{
- using S1 = typename std::make_signed<Input1>::type;
- using S2 = typename std::make_signed<Input2>::type;
- using U1 = typename std::make_unsigned<Input1>::type;
- using U2 = typename std::make_unsigned<Input2>::type;
- bool accumulate = true;
- for (auto TC : Cases) {
- { // Test with two signed types
- using Output = std::common_type_t<S1, S2>;
- accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect);
- accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect);
- }
- { // test with two unsigned types
- using Output = std::common_type_t<U1, U2>;
- accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect);
- }
- { // Test with mixed signs
- using Output = std::common_type_t<S1, U2>;
- accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect);
- }
- { // Test with mixed signs
- using Output = std::common_type_t<S2, U1>;
- accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect);
- }
- }
- return accumulate;
-}
-
-int main()
-{
- auto non_cce = std::rand(); // a value that can't possibly be constexpr
-
- static_assert(do_test<signed char>(), "");
- static_assert(do_test<short>(), "");
- static_assert(do_test<int>(), "");
- static_assert(do_test<long>(), "");
- static_assert(do_test<long long>(), "");
-
- assert(do_test<signed char>(non_cce));
- assert(do_test<short>(non_cce));
- assert(do_test<int>(non_cce));
- assert(do_test<long>(non_cce));
- assert(do_test<long long>(non_cce));
-
- static_assert(do_test< int8_t>(), "");
- static_assert(do_test<int16_t>(), "");
- static_assert(do_test<int32_t>(), "");
- static_assert(do_test<int64_t>(), "");
-
- assert(do_test< int8_t>(non_cce));
- assert(do_test<int16_t>(non_cce));
- assert(do_test<int32_t>(non_cce));
- assert(do_test<int64_t>(non_cce));
-
- static_assert(do_test<signed char, int>(), "");
- static_assert(do_test<int, signed char>(), "");
- static_assert(do_test<short, int>(), "");
- static_assert(do_test<int, short>(), "");
- static_assert(do_test<int, long>(), "");
- static_assert(do_test<long, int>(), "");
- static_assert(do_test<int, long long>(), "");
- static_assert(do_test<long long, int>(), "");
-
- assert((do_test<signed char, int>(non_cce)));
- assert((do_test<int, signed char>(non_cce)));
- assert((do_test<short, int>(non_cce)));
- assert((do_test<int, short>(non_cce)));
- assert((do_test<int, long>(non_cce)));
- assert((do_test<long, int>(non_cce)));
- assert((do_test<int, long long>(non_cce)));
- assert((do_test<long long, int>(non_cce)));
-
-// LWG#2792
- {
- auto res = std::experimental::gcd((int64_t)1234, (int32_t)-2147483648);
- static_assert( std::is_same<decltype(res), std::common_type<int64_t, int32_t>::type>::value, "");
- assert(res == 2);
- }
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp
deleted file mode 100644
index e4c2ed8bf539..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::lcm(false, 4);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp
deleted file mode 100644
index 097b23eae6e4..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::lcm(2, true);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp
deleted file mode 100644
index d5e6300818cc..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::lcm<volatile bool, int>(false, 4);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp
deleted file mode 100644
index d88c490d64bf..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type,
-// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::lcm<int, const bool>(2, true);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
deleted file mode 100644
index d12b35609b1e..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::lcm(2.0, 4);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
deleted file mode 100644
index d5731870eb19..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
-
-// Remarks: If either M or N is not an integer type, the program is ill-formed.
-
-#include <experimental/numeric>
-
-
-int main()
-{
- std::experimental::lcm(4, 6.0);
-}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
deleted file mode 100644
index 211363aeac68..000000000000
--- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-// <numeric>
-
-// template<class _M, class _N>
-// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
-
-#include <experimental/numeric>
-#include <cassert>
-#include <cstdlib>
-#include <iostream>
-
-constexpr struct {
- int x;
- int y;
- int expect;
-} Cases[] = {
- {0, 0, 0},
- {1, 0, 0},
- {0, 1, 0},
- {1, 1, 1},
- {2, 3, 6},
- {2, 4, 4},
- {3, 17, 51},
- {36, 18, 36}
-};
-
-template <typename Input1, typename Input2, typename Output>
-constexpr bool test0(Input1 in1, Input2 in2, Output out)
-{
- static_assert((std::is_same<Output, decltype(std::experimental::lcm(Input1(0), Input2(0)))>::value), "" );
- static_assert((std::is_same<Output, decltype(std::experimental::lcm(Input2(0), Input1(0)))>::value), "" );
- return out == std::experimental::lcm(in1, in2) ? true : (std::abort(), false);
-}
-
-
-template <typename Input1, typename Input2 = Input1>
-constexpr bool do_test(int = 0)
-{
- using S1 = typename std::make_signed<Input1>::type;
- using S2 = typename std::make_signed<Input2>::type;
- using U1 = typename std::make_unsigned<Input1>::type;
- using U2 = typename std::make_unsigned<Input2>::type;
- bool accumulate = true;
- for (auto TC : Cases) {
- { // Test with two signed types
- using Output = std::common_type_t<S1, S2>;
- accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect);
- accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect);
- accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect);
- }
- { // test with two unsigned types
- using Output = std::common_type_t<U1, U2>;
- accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect);
- }
- { // Test with mixed signs
- using Output = std::common_type_t<S1, U2>;
- accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect);
- }
- { // Test with mixed signs
- using Output = std::common_type_t<S2, U1>;
- accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect);
- accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect);
- accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect);
- }
- }
- return accumulate;
-}
-
-int main()
-{
- auto non_cce = std::rand(); // a value that can't possibly be constexpr
-
- static_assert(do_test<signed char>(), "");
- static_assert(do_test<short>(), "");
- static_assert(do_test<int>(), "");
- static_assert(do_test<long>(), "");
- static_assert(do_test<long long>(), "");
-
- assert(do_test<signed char>(non_cce));
- assert(do_test<short>(non_cce));
- assert(do_test<int>(non_cce));
- assert(do_test<long>(non_cce));
- assert(do_test<long long>(non_cce));
-
- static_assert(do_test< int8_t>(), "");
- static_assert(do_test<int16_t>(), "");
- static_assert(do_test<int32_t>(), "");
- static_assert(do_test<int64_t>(), "");
-
- assert(do_test< int8_t>(non_cce));
- assert(do_test<int16_t>(non_cce));
- assert(do_test<int32_t>(non_cce));
- assert(do_test<int64_t>(non_cce));
-
- static_assert(do_test<signed char, int>(), "");
- static_assert(do_test<int, signed char>(), "");
- static_assert(do_test<short, int>(), "");
- static_assert(do_test<int, short>(), "");
- static_assert(do_test<int, long>(), "");
- static_assert(do_test<long, int>(), "");
- static_assert(do_test<int, long long>(), "");
- static_assert(do_test<long long, int>(), "");
-
- assert((do_test<signed char, int>(non_cce)));
- assert((do_test<int, signed char>(non_cce)));
- assert((do_test<short, int>(non_cce)));
- assert((do_test<int, short>(non_cce)));
- assert((do_test<int, long>(non_cce)));
- assert((do_test<long, int>(non_cce)));
- assert((do_test<int, long long>(non_cce)));
- assert((do_test<long long, int>(non_cce)));
-
-// LWG#2792
- {
- auto res1 = std::experimental::lcm((int64_t)1234, (int32_t)-2147483648);
- (void) std::experimental::lcm<int, unsigned long>(INT_MIN, 2); // this used to trigger UBSAN
- static_assert( std::is_same<decltype(res1), std::common_type<int64_t, int32_t>::type>::value, "");
- assert(res1 == 1324997410816LL);
- }
-}
diff --git a/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp b/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
deleted file mode 100644
index f269149829d2..000000000000
--- a/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
-
-// <optional>
-
-// class bad_optional_access is default constructible
-
-#include <experimental/optional>
-#include <type_traits>
-
-int main()
-{
- using std::experimental::bad_optional_access;
- bad_optional_access ex;
-}
diff --git a/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp b/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
deleted file mode 100644
index a4af713a3910..000000000000
--- a/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability_markup=macosx10.12
-// XFAIL: availability_markup=macosx10.11
-// XFAIL: availability_markup=macosx10.10
-// XFAIL: availability_markup=macosx10.9
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
-
-// <optional>
-
-// class bad_optional_access : public logic_error
-
-#include <experimental/optional>
-#include <type_traits>
-
-int main()
-{
- using std::experimental::bad_optional_access;
-
- static_assert(std::is_base_of<std::logic_error, bad_optional_access>::value, "");
- static_assert(std::is_convertible<bad_optional_access*, std::logic_error*>::value, "");
-}
diff --git a/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp
deleted file mode 100644
index 749fa7dcf0a1..000000000000
--- a/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator==(const optional<T>& x, const T& v);
-// template <class T> constexpr bool operator==(const T& v, const optional<T>& x);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator == ( const X &lhs, const X &rhs )
- { return lhs.i_ == rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr T val(2);
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
- constexpr O o3{val}; // engaged
-
- static_assert ( !(o1 == T(1)), "" );
- static_assert ( (o2 == T(1)), "" );
- static_assert ( !(o3 == T(1)), "" );
- static_assert ( (o3 == T(2)), "" );
- static_assert ( (o3 == val), "" );
-
- static_assert ( !(T(1) == o1), "" );
- static_assert ( (T(1) == o2), "" );
- static_assert ( !(T(1) == o3), "" );
- static_assert ( (T(2) == o3), "" );
- static_assert ( (val == o3), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp
deleted file mode 100644
index c4d95a1c878f..000000000000
--- a/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator>(const optional<T>& x, const T& v);
-// template <class T> constexpr bool operator>(const T& v, const optional<T>& x);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr T val(2);
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
- constexpr O o3{val}; // engaged
-
- static_assert ( !(o1 > T(1)), "" );
- static_assert ( !(o2 > T(1)), "" ); // equal
- static_assert ( (o3 > T(1)), "" );
- static_assert ( !(o2 > val), "" );
- static_assert ( !(o3 > val), "" ); // equal
- static_assert ( !(o3 > T(3)), "" );
-
- static_assert ( (T(1) > o1), "" );
- static_assert ( !(T(1) > o2), "" ); // equal
- static_assert ( !(T(1) > o3), "" );
- static_assert ( (val > o2), "" );
- static_assert ( !(val > o3), "" ); // equal
- static_assert ( (T(3) > o3), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp
deleted file mode 100644
index ce1cd9f98481..000000000000
--- a/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator>=(const optional<T>& x, const T& v);
-// template <class T> constexpr bool operator>=(const T& v, const optional<T>& x);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr T val(2);
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
- constexpr O o3{val}; // engaged
-
- static_assert ( !(o1 >= T(1)), "" );
- static_assert ( (o2 >= T(1)), "" ); // equal
- static_assert ( (o3 >= T(1)), "" );
- static_assert ( !(o2 >= val), "" );
- static_assert ( (o3 >= val), "" ); // equal
- static_assert ( !(o3 >= T(3)), "" );
-
- static_assert ( (T(1) >= o1), "" );
- static_assert ( (T(1) >= o2), "" ); // equal
- static_assert ( !(T(1) >= o3), "" );
- static_assert ( (val >= o2), "" );
- static_assert ( (val >= o3), "" ); // equal
- static_assert ( (T(3) >= o3), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp
deleted file mode 100644
index c519bde1e9f2..000000000000
--- a/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator<=(const optional<T>& x, const T& v);
-// template <class T> constexpr bool operator<=(const T& v, const optional<T>& x);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr T val(2);
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
- constexpr O o3{val}; // engaged
-
- static_assert ( (o1 <= T(1)), "" );
- static_assert ( (o2 <= T(1)), "" ); // equal
- static_assert ( !(o3 <= T(1)), "" );
- static_assert ( (o2 <= val), "" );
- static_assert ( (o3 <= val), "" ); // equal
- static_assert ( (o3 <= T(3)), "" );
-
- static_assert ( !(T(1) <= o1), "" );
- static_assert ( (T(1) <= o2), "" ); // equal
- static_assert ( (T(1) <= o3), "" );
- static_assert ( !(val <= o2), "" );
- static_assert ( (val <= o3), "" ); // equal
- static_assert ( !(T(3) <= o3), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp
deleted file mode 100644
index ee1e98f2b8c9..000000000000
--- a/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator<(const optional<T>& x, const T& v);
-// template <class T> constexpr bool operator<(const T& v, const optional<T>& x);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr T val(2);
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
- constexpr O o3{val}; // engaged
-
- static_assert ( (o1 < T(1)), "" );
- static_assert ( !(o2 < T(1)), "" ); // equal
- static_assert ( !(o3 < T(1)), "" );
- static_assert ( (o2 < val), "" );
- static_assert ( !(o3 < val), "" ); // equal
- static_assert ( (o3 < T(3)), "" );
-
- static_assert ( !(T(1) < o1), "" );
- static_assert ( !(T(1) < o2), "" ); // equal
- static_assert ( (T(1) < o3), "" );
- static_assert ( !(val < o2), "" );
- static_assert ( !(val < o3), "" ); // equal
- static_assert ( !(T(3) < o3), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp
deleted file mode 100644
index a3daa02d5dbb..000000000000
--- a/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator!=(const optional<T>& x, const T& v);
-// template <class T> constexpr bool operator!=(const T& v, const optional<T>& x);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator == ( const X &lhs, const X &rhs )
- { return lhs.i_ == rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr T val(2);
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
- constexpr O o3{val}; // engaged
-
- static_assert ( (o1 != T(1)), "" );
- static_assert ( !(o2 != T(1)), "" );
- static_assert ( (o3 != T(1)), "" );
- static_assert ( !(o3 != T(2)), "" );
- static_assert ( !(o3 != val), "" );
-
- static_assert ( (T(1) != o1), "" );
- static_assert ( !(T(1) != o2), "" );
- static_assert ( (T(1) != o3), "" );
- static_assert ( !(T(2) != o3), "" );
- static_assert ( !(val != o3), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp b/test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp
deleted file mode 100644
index b58f5c55b643..000000000000
--- a/test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-int main()
-{
-}
diff --git a/test/std/experimental/optional/optional.hash/hash.pass.cpp b/test/std/experimental/optional/optional.hash/hash.pass.cpp
deleted file mode 100644
index 21126740bf86..000000000000
--- a/test/std/experimental/optional/optional.hash/hash.pass.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> struct hash<optional<T>>;
-
-#include <experimental/optional>
-#include <string>
-#include <memory>
-#include <cassert>
-
-
-int main()
-{
- using std::experimental::optional;
-
- {
- typedef int T;
- optional<T> opt;
- assert(std::hash<optional<T>>{}(opt) == 0);
- opt = 2;
- assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
- }
- {
- typedef std::string T;
- optional<T> opt;
- assert(std::hash<optional<T>>{}(opt) == 0);
- opt = std::string("123");
- assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
- }
- {
- typedef std::unique_ptr<int> T;
- optional<T> opt;
- assert(std::hash<optional<T>>{}(opt) == 0);
- opt = std::unique_ptr<int>(new int(3));
- assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
- }
-}
diff --git a/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp b/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp
deleted file mode 100644
index b63977bb69ff..000000000000
--- a/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// struct in_place_t{};
-// constexpr in_place_t in_place{};
-
-#include <experimental/optional>
-#include <type_traits>
-
-using std::experimental::optional;
-using std::experimental::in_place_t;
-using std::experimental::in_place;
-
-constexpr
-int
-test(const in_place_t&)
-{
- return 3;
-}
-
-int main()
-{
- static_assert((std::is_class<in_place_t>::value), "");
- static_assert((std::is_empty<in_place_t>::value), "");
-
- static_assert(test(in_place) == 3, "");
-}
diff --git a/test/std/experimental/optional/optional.nullops/equal.pass.cpp b/test/std/experimental/optional/optional.nullops/equal.pass.cpp
deleted file mode 100644
index 79a5a7e06fa4..000000000000
--- a/test/std/experimental/optional/optional.nullops/equal.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) noexcept;
-// template <class T> constexpr bool operator==(nullopt_t, const optional<T>& x) noexcept;
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- {
- typedef int T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
-
- static_assert ( (nullopt == o1), "" );
- static_assert ( !(nullopt == o2), "" );
- static_assert ( (o1 == nullopt), "" );
- static_assert ( !(o2 == nullopt), "" );
-
- static_assert (noexcept(nullopt == o1), "");
- static_assert (noexcept(o1 == nullopt), "");
- }
-}
diff --git a/test/std/experimental/optional/optional.nullops/greater.pass.cpp b/test/std/experimental/optional/optional.nullops/greater.pass.cpp
deleted file mode 100644
index 15b22005b830..000000000000
--- a/test/std/experimental/optional/optional.nullops/greater.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) noexcept;
-// template <class T> constexpr bool operator>(nullopt_t, const optional<T>& x) noexcept;
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- {
- typedef int T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
-
- static_assert ( !(nullopt > o1), "" );
- static_assert ( !(nullopt > o2), "" );
- static_assert ( !(o1 > nullopt), "" );
- static_assert ( (o2 > nullopt), "" );
-
- static_assert (noexcept(nullopt > o1), "");
- static_assert (noexcept(o1 > nullopt), "");
- }
-}
diff --git a/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp
deleted file mode 100644
index 313770ff408e..000000000000
--- a/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator>=(const optional<T>& x, nullopt_t) noexcept;
-// template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) noexcept;
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- {
- typedef int T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
-
- static_assert ( (nullopt >= o1), "" );
- static_assert ( !(nullopt >= o2), "" );
- static_assert ( (o1 >= nullopt), "" );
- static_assert ( (o2 >= nullopt), "" );
-
- static_assert (noexcept(nullopt >= o1), "");
- static_assert (noexcept(o1 >= nullopt), "");
- }
-}
diff --git a/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp
deleted file mode 100644
index ac7be156c69c..000000000000
--- a/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <optional>
-
-// template <class T> constexpr bool operator<=(const optional<T>& x, nullopt_t) noexcept;
-// template <class T> constexpr bool operator<=(nullopt_t, const optional<T>& x) noexcept;
-
-#include <experimental/optional>
-
-#include "test_macros.h"
-
-int main()
-{
-#if TEST_STD_VER > 11
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- {
- typedef int T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
-
- static_assert ( (nullopt <= o1), "" );
- static_assert ( (nullopt <= o2), "" );
- static_assert ( (o1 <= nullopt), "" );
- static_assert ( !(o2 <= nullopt), "" );
-
- static_assert (noexcept(nullopt <= o1), "");
- static_assert (noexcept(o1 <= nullopt), "");
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.nullops/less_than.pass.cpp b/test/std/experimental/optional/optional.nullops/less_than.pass.cpp
deleted file mode 100644
index fdb400700d83..000000000000
--- a/test/std/experimental/optional/optional.nullops/less_than.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator<(const optional<T>& x, nullopt_t) noexcept;
-// template <class T> constexpr bool operator<(nullopt_t, const optional<T>& x) noexcept;
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- {
- typedef int T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
-
- static_assert ( !(nullopt < o1), "" );
- static_assert ( (nullopt < o2), "" );
- static_assert ( !(o1 < nullopt), "" );
- static_assert ( !(o2 < nullopt), "" );
-
- static_assert (noexcept(nullopt < o1), "");
- static_assert (noexcept(o1 < nullopt), "");
- }
-}
diff --git a/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp
deleted file mode 100644
index 70ae0f1d885c..000000000000
--- a/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) noexcept;
-// template <class T> constexpr bool operator!=(nullopt_t, const optional<T>& x) noexcept;
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- {
- typedef int T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2{1}; // engaged
-
- static_assert ( !(nullopt != o1), "" );
- static_assert ( (nullopt != o2), "" );
- static_assert ( !(o1 != nullopt), "" );
- static_assert ( (o2 != nullopt), "" );
-
- static_assert (noexcept(nullopt != o1), "");
- static_assert (noexcept(o1 != nullopt), "");
- }
-}
diff --git a/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp b/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp
deleted file mode 100644
index 8ad49c7485d0..000000000000
--- a/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// struct nullopt_t{see below};
-// constexpr nullopt_t nullopt(unspecified);
-
-#include <experimental/optional>
-#include <type_traits>
-
-using std::experimental::optional;
-using std::experimental::nullopt_t;
-using std::experimental::nullopt;
-
-constexpr
-int
-test(const nullopt_t&)
-{
- return 3;
-}
-
-int main()
-{
- static_assert((std::is_class<nullopt_t>::value), "");
- static_assert((std::is_empty<nullopt_t>::value), "");
- static_assert((std::is_literal_type<nullopt_t>::value), "");
- static_assert((!std::is_default_constructible<nullopt_t>::value), "");
-
- static_assert(test(nullopt) == 3, "");
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp
deleted file mode 100644
index 0215417ce0b2..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class U> optional<T>& operator=(U&& v);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-#include <memory>
-
-using std::experimental::optional;
-
-struct AllowConstAssign {
- AllowConstAssign() {}
- AllowConstAssign(AllowConstAssign const&) {}
- AllowConstAssign const& operator=(AllowConstAssign const&) const {
- return *this;
- }
-};
-
-struct X
-{
-};
-
-int main()
-{
- static_assert(std::is_assignable<optional<int>, int>::value, "");
- static_assert(std::is_assignable<optional<int>, int&>::value, "");
- static_assert(std::is_assignable<optional<int>&, int>::value, "");
- static_assert(std::is_assignable<optional<int>&, int&>::value, "");
- static_assert(std::is_assignable<optional<int>&, const int&>::value, "");
- static_assert(!std::is_assignable<const optional<int>&, const int&>::value, "");
- static_assert(!std::is_assignable<optional<int>, X>::value, "");
- {
- optional<int> opt;
- opt = 1;
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 1);
- }
- {
- optional<int> opt;
- const int i = 2;
- opt = i;
- assert(static_cast<bool>(opt) == true);
- assert(*opt == i);
- }
- {
- optional<int> opt(3);
- const int i = 2;
- opt = i;
- assert(static_cast<bool>(opt) == true);
- assert(*opt == i);
- }
- {
- optional<const AllowConstAssign> opt;
- const AllowConstAssign other;
- opt = other;
- }
- {
- optional<std::unique_ptr<int>> opt;
- opt = std::unique_ptr<int>(new int(3));
- assert(static_cast<bool>(opt) == true);
- assert(**opt == 3);
- }
- {
- optional<std::unique_ptr<int>> opt(std::unique_ptr<int>(new int(2)));
- opt = std::unique_ptr<int>(new int(3));
- assert(static_cast<bool>(opt) == true);
- assert(**opt == 3);
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp
deleted file mode 100644
index 17ee9754531f..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// optional<T>& operator=(const optional<T>& rhs);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-struct AllowConstAssign {
- AllowConstAssign(AllowConstAssign const&) {}
- AllowConstAssign const& operator=(AllowConstAssign const&) const {
- return *this;
- }
-};
-
-struct X
-{
- static bool throw_now;
-
- X() = default;
- X(const X&)
- {
- if (throw_now)
- TEST_THROW(6);
- }
-};
-
-bool X::throw_now = false;
-
-int main()
-{
- {
- optional<int> opt;
- constexpr optional<int> opt2;
- opt = opt2;
- static_assert(static_cast<bool>(opt2) == false, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- }
- {
- optional<const AllowConstAssign> opt;
- optional<const AllowConstAssign> opt2;
- opt = opt2;
- }
- {
- optional<int> opt;
- constexpr optional<int> opt2(2);
- opt = opt2;
- static_assert(static_cast<bool>(opt2) == true, "");
- static_assert(*opt2 == 2, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- assert(*opt == *opt2);
- }
- {
- optional<int> opt(3);
- constexpr optional<int> opt2;
- opt = opt2;
- static_assert(static_cast<bool>(opt2) == false, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- }
- {
- optional<int> opt(3);
- constexpr optional<int> opt2(2);
- opt = opt2;
- static_assert(static_cast<bool>(opt2) == true, "");
- static_assert(*opt2 == 2, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- assert(*opt == *opt2);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- optional<X> opt;
- optional<X> opt2(X{});
- assert(static_cast<bool>(opt2) == true);
- try
- {
- X::throw_now = true;
- opt = opt2;
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- assert(static_cast<bool>(opt) == false);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
deleted file mode 100644
index 256396094a90..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class... Args> void optional<T>::emplace(Args&&... args);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-#include <memory>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-class X
-{
- int i_;
- int j_ = 0;
-public:
- X() : i_(0) {}
- X(int i) : i_(i) {}
- X(int i, int j) : i_(i), j_(j) {}
-
- friend bool operator==(const X& x, const X& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-class Y
-{
-public:
- static bool dtor_called;
- Y() = default;
- ~Y() {dtor_called = true;}
-};
-
-bool Y::dtor_called = false;
-
-class Z
-{
-public:
- static bool dtor_called;
- Z() = default;
- Z(int) {TEST_THROW(6);}
- ~Z() {dtor_called = true;}
-};
-
-bool Z::dtor_called = false;
-
-int main()
-{
- {
- optional<int> opt;
- opt.emplace();
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 0);
- }
- {
- optional<int> opt;
- opt.emplace(1);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 1);
- }
- {
- optional<int> opt(2);
- opt.emplace();
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 0);
- }
- {
- optional<int> opt(2);
- opt.emplace(1);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 1);
- }
- {
- optional<const int> opt(2);
- opt.emplace(1);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 1);
- }
- {
- optional<X> opt;
- opt.emplace();
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X());
- }
- {
- optional<X> opt;
- opt.emplace(1);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X(1));
- }
- {
- optional<X> opt;
- opt.emplace(1, 2);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X(1, 2));
- }
- {
- optional<X> opt(X{3});
- opt.emplace();
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X());
- }
- {
- optional<X> opt(X{3});
- opt.emplace(1);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X(1));
- }
- {
- optional<X> opt(X{3});
- opt.emplace(1, 2);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X(1, 2));
- }
- {
- Y y;
- {
- optional<Y> opt(y);
- assert(Y::dtor_called == false);
- opt.emplace();
- assert(Y::dtor_called == true);
- }
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- Z z;
- optional<Z> opt(z);
- try
- {
- assert(static_cast<bool>(opt) == true);
- assert(Z::dtor_called == false);
- opt.emplace(1);
- }
- catch (int i)
- {
- assert(i == 6);
- assert(static_cast<bool>(opt) == false);
- assert(Z::dtor_called == true);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
deleted file mode 100644
index 8a265808a3c3..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class U, class... Args>
-// void optional<T>::emplace(initializer_list<U> il, Args&&... args);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-#include <vector>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-class X
-{
- int i_;
- int j_ = 0;
-public:
- static bool dtor_called;
- constexpr X() : i_(0) {}
- constexpr X(int i) : i_(i) {}
- constexpr X(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
- ~X() {dtor_called = true;}
-
- friend constexpr bool operator==(const X& x, const X& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-bool X::dtor_called = false;
-
-class Y
-{
- int i_;
- int j_ = 0;
-public:
- constexpr Y() : i_(0) {}
- constexpr Y(int i) : i_(i) {}
- constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
-
- friend constexpr bool operator==(const Y& x, const Y& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-class Z
-{
- int i_;
- int j_ = 0;
-public:
- static bool dtor_called;
- constexpr Z() : i_(0) {}
- constexpr Z(int i) : i_(i) {}
- Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
- {TEST_THROW(6);}
- ~Z() {dtor_called = true;}
-
- friend constexpr bool operator==(const Z& x, const Z& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-bool Z::dtor_called = false;
-
-int main()
-{
- {
- X x;
- {
- optional<X> opt(x);
- assert(X::dtor_called == false);
- opt.emplace({1, 2});
- assert(X::dtor_called == true);
- assert(*opt == X({1, 2}));
- }
- }
- X::dtor_called = false;
- {
- X x;
- {
- optional<const X> opt(x);
- assert(X::dtor_called == false);
- opt.emplace({1, 2});
- assert(X::dtor_called == true);
- assert(*opt == X({1, 2}));
- }
- }
- {
- optional<std::vector<int>> opt;
- opt.emplace({1, 2, 3}, std::allocator<int>());
- assert(static_cast<bool>(opt) == true);
- assert(*opt == std::vector<int>({1, 2, 3}));
- }
- {
- optional<Y> opt;
- opt.emplace({1, 2});
- assert(static_cast<bool>(opt) == true);
- assert(*opt == Y({1, 2}));
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- Z z;
- optional<Z> opt(z);
- try
- {
- assert(static_cast<bool>(opt) == true);
- assert(Z::dtor_called == false);
- opt.emplace({1, 2});
- }
- catch (int i)
- {
- assert(i == 6);
- assert(static_cast<bool>(opt) == false);
- assert(Z::dtor_called == true);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp
deleted file mode 100644
index 4e2aca978865..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// optional<T>& operator=(optional<T>&& rhs)
-// noexcept(is_nothrow_move_assignable<T>::value &&
-// is_nothrow_move_constructible<T>::value);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-struct AllowConstAssign {
- AllowConstAssign(AllowConstAssign const&) {}
- AllowConstAssign const& operator=(AllowConstAssign const&) const {
- return *this;
- }
-};
-
-struct X
-{
- static bool throw_now;
-
- X() = default;
- X(X&&)
- {
- if (throw_now)
- TEST_THROW(6);
- }
- X& operator=(X&&) noexcept
- {
- return *this;
- }
-};
-
-bool X::throw_now = false;
-
-struct Y {};
-
-int main()
-{
- {
- static_assert(std::is_nothrow_move_assignable<optional<int>>::value, "");
- optional<int> opt;
- constexpr optional<int> opt2;
- opt = std::move(opt2);
- static_assert(static_cast<bool>(opt2) == false, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- }
- {
- optional<int> opt;
- constexpr optional<int> opt2(2);
- opt = std::move(opt2);
- static_assert(static_cast<bool>(opt2) == true, "");
- static_assert(*opt2 == 2, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- assert(*opt == *opt2);
- }
- {
- optional<int> opt(3);
- constexpr optional<int> opt2;
- opt = std::move(opt2);
- static_assert(static_cast<bool>(opt2) == false, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- }
- {
- optional<int> opt(3);
- constexpr optional<int> opt2(2);
- opt = std::move(opt2);
- static_assert(static_cast<bool>(opt2) == true, "");
- static_assert(*opt2 == 2, "");
- assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
- assert(*opt == *opt2);
- }
- {
- optional<const AllowConstAssign> opt;
- optional<const AllowConstAssign> opt2;
- opt = std::move(opt2);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- static_assert(!std::is_nothrow_move_assignable<optional<X>>::value, "");
- optional<X> opt;
- optional<X> opt2(X{});
- assert(static_cast<bool>(opt2) == true);
- try
- {
- X::throw_now = true;
- opt = std::move(opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- assert(static_cast<bool>(opt) == false);
- }
- }
-#endif
- {
- static_assert(std::is_nothrow_move_assignable<optional<Y>>::value, "");
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp
deleted file mode 100644
index b1d851b32f4c..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// optional<T>& operator=(nullopt_t) noexcept;
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-using std::experimental::nullopt_t;
-using std::experimental::nullopt;
-
-struct X
-{
- static bool dtor_called;
- ~X() {dtor_called = true;}
-};
-
-bool X::dtor_called = false;
-
-int main()
-{
- {
- optional<int> opt;
- static_assert(noexcept(opt = nullopt) == true, "");
- opt = nullopt;
- assert(static_cast<bool>(opt) == false);
- }
- {
- optional<int> opt(3);
- opt = nullopt;
- assert(static_cast<bool>(opt) == false);
- }
- {
- optional<X> opt;
- static_assert(noexcept(opt = nullopt) == true, "");
- assert(X::dtor_called == false);
- opt = nullopt;
- assert(X::dtor_called == false);
- assert(static_cast<bool>(opt) == false);
- }
- {
- X x;
- {
- optional<X> opt(x);
- assert(X::dtor_called == false);
- opt = nullopt;
- assert(X::dtor_called == true);
- assert(static_cast<bool>(opt) == false);
- }
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp
deleted file mode 100644
index 6371dcb4e51c..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <optional>
-
-// constexpr optional(const T& v);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-class X
-{
- int i_;
-public:
- X(int i) : i_(i) {}
-
- friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
-};
-
-class Y
-{
- int i_;
-public:
- constexpr Y(int i) : i_(i) {}
-
- friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
-};
-
-class Z
-{
-public:
- Z(int) {}
- Z(const Z&) {TEST_THROW(6);}
-};
-
-
-int main()
-{
- {
- typedef int T;
- constexpr T t(5);
- constexpr optional<T> opt(t);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 5, "");
-
- struct test_constexpr_ctor
- : public optional<T>
- {
- constexpr test_constexpr_ctor(const T&) {}
- };
-
- }
- {
- typedef double T;
- constexpr T t(3);
- constexpr optional<T> opt(t);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 3, "");
-
- struct test_constexpr_ctor
- : public optional<T>
- {
- constexpr test_constexpr_ctor(const T&) {}
- };
-
- }
- {
- typedef X T;
- const T t(3);
- optional<T> opt(t);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 3);
- }
- {
- typedef Y T;
- constexpr T t(3);
- constexpr optional<T> opt(t);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 3, "");
-
- struct test_constexpr_ctor
- : public optional<T>
- {
- constexpr test_constexpr_ctor(const T&) {}
- };
-
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- typedef Z T;
- try
- {
- const T t(3);
- optional<T> opt(t);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp
deleted file mode 100644
index 4b66fe80bbb2..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// optional(const optional<T>& rhs);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-template <class T>
-void
-test(const optional<T>& rhs, bool is_going_to_throw = false)
-{
- bool rhs_engaged = static_cast<bool>(rhs);
-#ifdef TEST_HAS_NO_EXCEPTIONS
- if (is_going_to_throw)
- return;
-#else
- try
-#endif
- {
- optional<T> lhs = rhs;
- assert(is_going_to_throw == false);
- assert(static_cast<bool>(lhs) == rhs_engaged);
- if (rhs_engaged)
- assert(*lhs == *rhs);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- catch (int i)
- {
- assert(i == 6);
- assert(is_going_to_throw);
- }
-#endif
-}
-
-class X
-{
- int i_;
-public:
- X(int i) : i_(i) {}
- X(const X& x) : i_(x.i_) {}
- ~X() {i_ = 0;}
- friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
-};
-
-class Y
-{
- int i_;
-public:
- Y(int i) : i_(i) {}
- Y(const Y& x) : i_(x.i_) {}
-
- friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
-};
-
-int count = 0;
-
-class Z
-{
- int i_;
-public:
- Z(int i) : i_(i) {}
- Z(const Z&)
- {
- if (++count == 2)
- TEST_THROW(6);
- }
-
- friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
-};
-
-
-int main()
-{
- {
- typedef int T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef int T;
- optional<T> rhs(3);
- test(rhs);
- }
- {
- typedef const int T;
- optional<T> rhs(3);
- test(rhs);
- }
- {
- typedef X T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef X T;
- optional<T> rhs(X(3));
- test(rhs);
- }
- {
- typedef const X T;
- optional<T> rhs(X(3));
- test(rhs);
- }
- {
- typedef Y T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef Y T;
- optional<T> rhs(Y(3));
- test(rhs);
- }
- {
- typedef Z T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef Z T;
- optional<T> rhs(Z(3));
- test(rhs, true);
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp
deleted file mode 100644
index d24a1ac69b86..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// constexpr optional() noexcept;
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-template <class Opt>
-void
-test_constexpr()
-{
- static_assert(std::is_nothrow_default_constructible<Opt>::value, "");
- constexpr Opt opt;
- static_assert(static_cast<bool>(opt) == false, "");
-
- struct test_constexpr_ctor
- : public Opt
- {
- constexpr test_constexpr_ctor() {}
- };
-
-}
-
-template <class Opt>
-void
-test()
-{
- static_assert(std::is_nothrow_default_constructible<Opt>::value, "");
- Opt opt;
- assert(static_cast<bool>(opt) == false);
-
- struct test_constexpr_ctor
- : public Opt
- {
- constexpr test_constexpr_ctor() {}
- };
-}
-
-struct X
-{
- X();
-};
-
-int main()
-{
- test_constexpr<optional<int>>();
- test_constexpr<optional<int*>>();
- test<optional<X>>();
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
deleted file mode 100644
index c46407896576..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <optional>
-
-// template <class... Args>
-// constexpr explicit optional(in_place_t, Args&&... args);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-using std::experimental::in_place_t;
-using std::experimental::in_place;
-
-class X
-{
- int i_;
- int j_ = 0;
-public:
- X() : i_(0) {}
- X(int i) : i_(i) {}
- X(int i, int j) : i_(i), j_(j) {}
-
- ~X() {}
-
- friend bool operator==(const X& x, const X& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-class Y
-{
- int i_;
- int j_ = 0;
-public:
- constexpr Y() : i_(0) {}
- constexpr Y(int i) : i_(i) {}
- constexpr Y(int i, int j) : i_(i), j_(j) {}
-
- friend constexpr bool operator==(const Y& x, const Y& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-class Z
-{
-public:
- Z(int) {TEST_THROW(6);}
-};
-
-
-int main()
-{
- {
- constexpr optional<int> opt(in_place, 5);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 5, "");
-
- struct test_constexpr_ctor
- : public optional<int>
- {
- constexpr test_constexpr_ctor(in_place_t, int i)
- : optional<int>(in_place, i) {}
- };
-
- }
- {
- const optional<X> opt(in_place);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X());
- }
- {
- const optional<X> opt(in_place, 5);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X(5));
- }
- {
- const optional<X> opt(in_place, 5, 4);
- assert(static_cast<bool>(opt) == true);
- assert(*opt == X(5, 4));
- }
- {
- constexpr optional<Y> opt(in_place);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == Y(), "");
-
- struct test_constexpr_ctor
- : public optional<Y>
- {
- constexpr test_constexpr_ctor(in_place_t)
- : optional<Y>(in_place) {}
- };
-
- }
- {
- constexpr optional<Y> opt(in_place, 5);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == Y(5), "");
-
- struct test_constexpr_ctor
- : public optional<Y>
- {
- constexpr test_constexpr_ctor(in_place_t, int i)
- : optional<Y>(in_place, i) {}
- };
-
- }
- {
- constexpr optional<Y> opt(in_place, 5, 4);
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == Y(5, 4), "");
-
- struct test_constexpr_ctor
- : public optional<Y>
- {
- constexpr test_constexpr_ctor(in_place_t, int i, int j)
- : optional<Y>(in_place, i, j) {}
- };
-
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- try
- {
- const optional<Z> opt(in_place, 1);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
deleted file mode 100644
index b75c147df513..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class U, class... Args>
-// constexpr
-// explicit optional(in_place_t, initializer_list<U> il, Args&&... args);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-using std::experimental::in_place_t;
-using std::experimental::in_place;
-
-class X
-{
- int i_;
- int j_ = 0;
-public:
- X() : i_(0) {}
- X(int i) : i_(i) {}
- X(int i, int j) : i_(i), j_(j) {}
-
- ~X() {}
-
- friend bool operator==(const X& x, const X& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-class Y
-{
- int i_;
- int j_ = 0;
-public:
- constexpr Y() : i_(0) {}
- constexpr Y(int i) : i_(i) {}
- constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
-
- friend constexpr bool operator==(const Y& x, const Y& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-class Z
-{
- int i_;
- int j_ = 0;
-public:
- constexpr Z() : i_(0) {}
- constexpr Z(int i) : i_(i) {}
- Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
- {TEST_THROW(6);}
-
- friend constexpr bool operator==(const Z& x, const Z& y)
- {return x.i_ == y.i_ && x.j_ == y.j_;}
-};
-
-int main()
-{
- {
- static_assert(!std::is_constructible<X, std::initializer_list<int>&>::value, "");
- static_assert(!std::is_constructible<optional<X>, std::initializer_list<int>&>::value, "");
- }
- {
- optional<std::vector<int>> opt(in_place, {3, 1});
- assert(static_cast<bool>(opt) == true);
- assert((*opt == std::vector<int>{3, 1}));
- assert(opt->size() == 2);
- }
- {
- optional<std::vector<int>> opt(in_place, {3, 1}, std::allocator<int>());
- assert(static_cast<bool>(opt) == true);
- assert((*opt == std::vector<int>{3, 1}));
- assert(opt->size() == 2);
- }
- {
- static_assert(std::is_constructible<optional<Y>, std::initializer_list<int>&>::value, "");
- constexpr optional<Y> opt(in_place, {3, 1});
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == Y{3, 1}, "");
-
- struct test_constexpr_ctor
- : public optional<Y>
- {
- constexpr test_constexpr_ctor(in_place_t, std::initializer_list<int> i)
- : optional<Y>(in_place, i) {}
- };
-
- constexpr test_constexpr_ctor dopt(in_place, {42, 101, -1});
- static_assert(*dopt == Y{42, 101, -1}, "");
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- static_assert(std::is_constructible<optional<Z>, std::initializer_list<int>&>::value, "");
- try
- {
- optional<Z> opt(in_place, {3, 1});
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp
deleted file mode 100644
index a8bb6e9c275c..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// optional(optional<T>&& rhs) noexcept(is_nothrow_move_constructible<T>::value);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-template <class T>
-void
-test(optional<T>& rhs, bool is_going_to_throw = false)
-{
- static_assert(std::is_nothrow_move_constructible<optional<T>>::value ==
- std::is_nothrow_move_constructible<T>::value, "");
- bool rhs_engaged = static_cast<bool>(rhs);
-#ifdef TEST_HAS_NO_EXCEPTIONS
- if (is_going_to_throw)
- return;
-#else
- try
-#endif
- {
- optional<T> lhs = std::move(rhs);
- assert(is_going_to_throw == false);
- assert(static_cast<bool>(lhs) == rhs_engaged);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- catch (int i)
- {
- assert(i == 6);
- assert(is_going_to_throw);
- }
-#endif
-}
-
-class X
-{
- int i_;
-public:
- X(int i) : i_(i) {}
- X(X&& x) : i_(x.i_) {x.i_ = 0;}
- ~X() {i_ = 0;}
- friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
-};
-
-class Y
-{
- int i_;
-public:
- Y(int i) : i_(i) {}
- Y(Y&& x) noexcept : i_(x.i_) {x.i_ = 0;}
-
- friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
-};
-
-int count = 0;
-
-class Z
-{
- int i_;
-public:
- Z(int i) : i_(i) {}
- Z(Z&&)
- {
- if (++count == 2)
- TEST_THROW(6);
- }
-
- friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
-};
-
-
-class ConstMovable
-{
- int i_;
-public:
- ConstMovable(int i) : i_(i) {}
- ConstMovable(const ConstMovable&& x) : i_(x.i_) {}
- ~ConstMovable() {i_ = 0;}
- friend bool operator==(const ConstMovable& x, const ConstMovable& y) {return x.i_ == y.i_;}
-};
-
-int main()
-{
- {
- typedef int T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef int T;
- optional<T> rhs(3);
- test(rhs);
- }
- {
- typedef const int T;
- optional<T> rhs(3);
- test(rhs);
- }
- {
- typedef X T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef X T;
- optional<T> rhs(X(3));
- test(rhs);
- }
- {
- typedef const ConstMovable T;
- optional<T> rhs(ConstMovable(3));
- test(rhs);
- }
- {
- typedef Y T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef Y T;
- optional<T> rhs(Y(3));
- test(rhs);
- }
- {
- typedef Z T;
- optional<T> rhs;
- test(rhs);
- }
- {
- typedef Z T;
- optional<T> rhs(Z(3));
- test(rhs, true);
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp
deleted file mode 100644
index 40c96581ed84..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// constexpr optional(nullopt_t) noexcept;
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-using std::experimental::nullopt_t;
-using std::experimental::nullopt;
-
-template <class Opt>
-void
-test_constexpr()
-{
- static_assert(noexcept(Opt(nullopt)), "");
- constexpr Opt opt(nullopt);
- static_assert(static_cast<bool>(opt) == false, "");
-
- struct test_constexpr_ctor
- : public Opt
- {
- constexpr test_constexpr_ctor() {}
- };
-}
-
-template <class Opt>
-void
-test()
-{
- static_assert(noexcept(Opt(nullopt)), "");
- Opt opt(nullopt);
- assert(static_cast<bool>(opt) == false);
-
- struct test_constexpr_ctor
- : public Opt
- {
- constexpr test_constexpr_ctor() {}
- };
-}
-
-struct X
-{
- X();
-};
-
-int main()
-{
- test_constexpr<optional<int>>();
- test_constexpr<optional<int*>>();
- test<optional<X>>();
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
deleted file mode 100644
index 1941546a53f7..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <optional>
-
-// constexpr optional(T&& v);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-class X
-{
- int i_;
-public:
- X(int i) : i_(i) {}
- X(X&& x) : i_(x.i_) {}
-
- friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
-};
-
-class Y
-{
- int i_;
-public:
- constexpr Y(int i) : i_(i) {}
- constexpr Y(Y&& x) : i_(x.i_) {}
-
- friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
-};
-
-class Z
-{
-public:
- Z(int) {}
- Z(Z&&) {TEST_THROW(6);}
-};
-
-
-int main()
-{
- {
- typedef int T;
- constexpr optional<T> opt(T(5));
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 5, "");
-
- struct test_constexpr_ctor
- : public optional<T>
- {
- constexpr test_constexpr_ctor(T&&) {}
- };
- }
- {
- typedef double T;
- constexpr optional<T> opt(T(3));
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 3, "");
-
- struct test_constexpr_ctor
- : public optional<T>
- {
- constexpr test_constexpr_ctor(T&&) {}
- };
- }
- {
- typedef X T;
- optional<T> opt(T(3));
- assert(static_cast<bool>(opt) == true);
- assert(*opt == 3);
- }
- {
- typedef Y T;
- constexpr optional<T> opt(T(3));
- static_assert(static_cast<bool>(opt) == true, "");
- static_assert(*opt == 3, "");
-
- struct test_constexpr_ctor
- : public optional<T>
- {
- constexpr test_constexpr_ctor(T&&) {}
- };
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- typedef Z T;
- try
- {
- optional<T> opt(T(3));
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp
deleted file mode 100644
index 2bec19e6b4f4..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// ~optional();
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-class X
-{
-public:
- static bool dtor_called;
- X() = default;
- ~X() {dtor_called = true;}
-};
-
-bool X::dtor_called = false;
-
-int main()
-{
- {
- typedef int T;
- static_assert(std::is_trivially_destructible<T>::value, "");
- static_assert(std::is_trivially_destructible<optional<T>>::value, "");
- }
- {
- typedef double T;
- static_assert(std::is_trivially_destructible<T>::value, "");
- static_assert(std::is_trivially_destructible<optional<T>>::value, "");
- }
- {
- typedef X T;
- static_assert(!std::is_trivially_destructible<T>::value, "");
- static_assert(!std::is_trivially_destructible<optional<T>>::value, "");
- {
- X x;
- optional<X> opt{x};
- assert(X::dtor_called == false);
- }
- assert(X::dtor_called == true);
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp
deleted file mode 100644
index faba8d256067..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// T& optional<T>::operator*();
-
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct X
-{
- constexpr int test() const {return 3;}
- int test() {return 4;}
-};
-
-int main()
-{
- {
- optional<X> opt(X{});
- assert((*opt).test() == 4);
- }
-#ifdef _LIBCPP_DEBUG
- {
- optional<X> opt;
- assert((*opt).test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
deleted file mode 100644
index f1bdc36424da..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// constexpr const T& optional<T>::operator*() const;
-
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct X
-{
- constexpr int test() const {return 3;}
-};
-
-struct Y
-{
- int test() const {return 2;}
-};
-
-int main()
-{
- {
- constexpr optional<X> opt(X{});
- static_assert((*opt).test() == 3, "");
- }
- {
- constexpr optional<Y> opt(Y{});
- assert((*opt).test() == 2);
- }
-#ifdef _LIBCPP_DEBUG
- {
- const optional<X> opt;
- assert((*opt).test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
deleted file mode 100644
index 954ccd71ff53..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// constexpr T* optional<T>::operator->();
-
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct X
-{
- constexpr int test() const {return 3;}
-};
-
-int main()
-{
- {
- constexpr optional<X> opt(X{});
- static_assert(opt->test() == 3, "");
- }
-#ifdef _LIBCPP_DEBUG
- {
- optional<X> opt;
- assert(opt->test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
deleted file mode 100644
index 46586c65a6e0..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// constexpr const T* optional<T>::operator->() const;
-
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct X
-{
- constexpr int test() const {return 3;}
-};
-
-struct Y
-{
- int test() const {return 2;}
-};
-
-struct Z
-{
- const Z* operator&() const {return this;}
- constexpr int test() const {return 1;}
-};
-
-int main()
-{
- {
- constexpr optional<X> opt(X{});
- static_assert(opt->test() == 3, "");
- }
- {
- constexpr optional<Y> opt(Y{});
- assert(opt->test() == 2);
- }
- {
- constexpr optional<Z> opt(Z{});
- assert(opt->test() == 1);
-#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
- static_assert(opt->test() == 1, "");
-#endif
- }
-#ifdef _LIBCPP_DEBUG
- {
- const optional<X> opt;
- assert(opt->test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
deleted file mode 100644
index 72d7790590d8..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
-
-// <optional>
-
-// T& optional<T>::value();
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-using std::experimental::bad_optional_access;
-
-struct X
-{
- X() = default;
- X(const X&) = delete;
- constexpr int test() const {return 3;}
- int test() {return 4;}
-};
-
-int main()
-{
- {
- optional<X> opt;
- opt.emplace();
- assert(opt.value().test() == 4);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- optional<X> opt;
- try
- {
- opt.value();
- assert(false);
- }
- catch (const bad_optional_access&)
- {
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
deleted file mode 100644
index b3d6dfda4fb5..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
-
-// <optional>
-
-// constexpr const T& optional<T>::value() const;
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-using std::experimental::in_place_t;
-using std::experimental::in_place;
-using std::experimental::bad_optional_access;
-
-struct X
-{
- X() = default;
- X(const X&) = delete;
- constexpr int test() const {return 3;}
- int test() {return 4;}
-};
-
-int main()
-{
- {
- constexpr optional<X> opt(in_place);
- static_assert(opt.value().test() == 3, "");
- }
- {
- const optional<X> opt(in_place);
- assert(opt.value().test() == 3);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- const optional<X> opt;
- try
- {
- opt.value();
- assert(false);
- }
- catch (const bad_optional_access&)
- {
- }
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp
deleted file mode 100644
index 6fca8c82cebd..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class U> T optional<T>::value_or(U&& v) &&;
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-using std::experimental::in_place_t;
-using std::experimental::in_place;
-
-struct Y
-{
- int i_;
-
- Y(int i) : i_(i) {}
-};
-
-struct X
-{
- int i_;
-
- X(int i) : i_(i) {}
- X(X&& x) : i_(x.i_) {x.i_ = 0;}
- X(const Y& y) : i_(y.i_) {}
- X(Y&& y) : i_(y.i_+1) {}
- friend constexpr bool operator==(const X& x, const X& y)
- {return x.i_ == y.i_;}
-};
-
-int main()
-{
- {
- optional<X> opt(in_place, 2);
- Y y(3);
- assert(std::move(opt).value_or(y) == 2);
- assert(*opt == 0);
- }
- {
- optional<X> opt(in_place, 2);
- assert(std::move(opt).value_or(Y(3)) == 2);
- assert(*opt == 0);
- }
- {
- optional<X> opt;
- Y y(3);
- assert(std::move(opt).value_or(y) == 3);
- assert(!opt);
- }
- {
- optional<X> opt;
- assert(std::move(opt).value_or(Y(3)) == 4);
- assert(!opt);
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp
deleted file mode 100644
index 4a008dce2386..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class U> constexpr T optional<T>::value_or(U&& v) const&;
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct Y
-{
- int i_;
-
- constexpr Y(int i) : i_(i) {}
-};
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
- constexpr X(const Y& y) : i_(y.i_) {}
- constexpr X(Y&& y) : i_(y.i_+1) {}
- friend constexpr bool operator==(const X& x, const X& y)
- {return x.i_ == y.i_;}
-};
-
-int main()
-{
- {
- constexpr optional<X> opt(2);
- constexpr Y y(3);
- static_assert(opt.value_or(y) == 2, "");
- }
- {
- constexpr optional<X> opt(2);
- static_assert(opt.value_or(Y(3)) == 2, "");
- }
- {
- constexpr optional<X> opt;
- constexpr Y y(3);
- static_assert(opt.value_or(y) == 3, "");
- }
- {
- constexpr optional<X> opt;
- static_assert(opt.value_or(Y(3)) == 4, "");
- }
- {
- const optional<X> opt(2);
- const Y y(3);
- assert(opt.value_or(y) == 2);
- }
- {
- const optional<X> opt(2);
- assert(opt.value_or(Y(3)) == 2);
- }
- {
- const optional<X> opt;
- const Y y(3);
- assert(opt.value_or(y) == 3);
- }
- {
- const optional<X> opt;
- assert(opt.value_or(Y(3)) == 4);
- }
-}
diff --git a/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp
deleted file mode 100644
index f2d373c299bf..000000000000
--- a/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// void swap(optional&)
-// noexcept(is_nothrow_move_constructible<T>::value &&
-// noexcept(swap(declval<T&>(), declval<T&>())));
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-class X
-{
- int i_;
-public:
- static unsigned dtor_called;
- X(int i) : i_(i) {}
- X(X&& x) = default;
- X& operator=(X&&) = default;
- ~X() {++dtor_called;}
-
- friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
-};
-
-unsigned X::dtor_called = 0;
-
-class Y
-{
- int i_;
-public:
- static unsigned dtor_called;
- Y(int i) : i_(i) {}
- Y(Y&&) = default;
- ~Y() {++dtor_called;}
-
- friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
- friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);}
-};
-
-unsigned Y::dtor_called = 0;
-
-class Z
-{
- int i_;
-public:
- Z(int i) : i_(i) {}
- Z(Z&&) {TEST_THROW(7);}
-
- friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
- friend void swap(Z&, Z&) {TEST_THROW(6);}
-};
-
-struct ConstSwappable {
-};
-void swap(ConstSwappable const&, ConstSwappable const&) {}
-
-int main()
-{
- {
- optional<int> opt1;
- optional<int> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<int> opt1(1);
- optional<int> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<int> opt1;
- optional<int> opt2(2);
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<int> opt1(1);
- optional<int> opt2(2);
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<const ConstSwappable> opt;
- optional<const ConstSwappable> opt2;
- opt.swap(opt2);
- }
- {
- optional<X> opt1;
- optional<X> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- assert(X::dtor_called == 0);
- }
- {
- optional<X> opt1(1);
- optional<X> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- X::dtor_called = 0;
- opt1.swap(opt2);
- assert(X::dtor_called == 1);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<X> opt1;
- optional<X> opt2(2);
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- X::dtor_called = 0;
- opt1.swap(opt2);
- assert(X::dtor_called == 1);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<X> opt1(1);
- optional<X> opt2(2);
- static_assert(noexcept(opt1.swap(opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- X::dtor_called = 0;
- opt1.swap(opt2);
- assert(X::dtor_called == 1); // from inside std::swap
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<Y> opt1;
- optional<Y> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- assert(Y::dtor_called == 0);
- }
- {
- optional<Y> opt1(1);
- optional<Y> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- Y::dtor_called = 0;
- opt1.swap(opt2);
- assert(Y::dtor_called == 1);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<Y> opt1;
- optional<Y> opt2(2);
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- Y::dtor_called = 0;
- opt1.swap(opt2);
- assert(Y::dtor_called == 1);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<Y> opt1(1);
- optional<Y> opt2(2);
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- Y::dtor_called = 0;
- opt1.swap(opt2);
- assert(Y::dtor_called == 0);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- optional<Z> opt1;
- optional<Z> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- opt1.swap(opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<Z> opt1;
- opt1.emplace(1);
- optional<Z> opt2;
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- try
- {
- opt1.swap(opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 7);
- }
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<Z> opt1;
- optional<Z> opt2;
- opt2.emplace(2);
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- try
- {
- opt1.swap(opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 7);
- }
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- }
- {
- optional<Z> opt1;
- opt1.emplace(1);
- optional<Z> opt2;
- opt2.emplace(2);
- static_assert(noexcept(opt1.swap(opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- try
- {
- opt1.swap(opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- }
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- }
-#endif
-}
diff --git a/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp b/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp
deleted file mode 100644
index 02c0a3a63a5e..000000000000
--- a/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// T shall be an object type and shall satisfy the requirements of Destructible
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
-
- optional<const void> opt;
-}
diff --git a/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp b/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp
deleted file mode 100644
index da8bd05f2c9b..000000000000
--- a/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// T shall be an object type and shall satisfy the requirements of Destructible
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
-private:
- ~X() {}
-};
-
-int main()
-{
- optional<X> opt;
-}
diff --git a/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp b/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp
deleted file mode 100644
index 7aa179afeaf6..000000000000
--- a/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// T shall be an object type and shall satisfy the requirements of Destructible
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- ~X() noexcept(false) {}
-};
-
-int main()
-{
- optional<X> opt;
-}
diff --git a/test/std/experimental/optional/optional.object/optional_void.fail.cpp b/test/std/experimental/optional/optional.object/optional_void.fail.cpp
deleted file mode 100644
index 73f689c56720..000000000000
--- a/test/std/experimental/optional/optional.object/optional_void.fail.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// T shall be an object type and shall satisfy the requirements of Destructible
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
-
- optional<void> opt;
-}
diff --git a/test/std/experimental/optional/optional.object/types.pass.cpp b/test/std/experimental/optional/optional.object/types.pass.cpp
deleted file mode 100644
index af8da2df8fd5..000000000000
--- a/test/std/experimental/optional/optional.object/types.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T>
-// class optional
-// {
-// public:
-// typedef T value_type;
-// ...
-
-#include <experimental/optional>
-#include <type_traits>
-
-using std::experimental::optional;
-
-template <class Opt, class T>
-void
-test()
-{
- static_assert(std::is_same<typename Opt::value_type, T>::value, "");
-}
-
-int main()
-{
- test<optional<int>, int>();
- test<optional<const int>, const int>();
- test<optional<double>, double>();
- test<optional<const double>, const double>();
-}
diff --git a/test/std/experimental/optional/optional.relops/equal.pass.cpp b/test/std/experimental/optional/optional.relops/equal.pass.cpp
deleted file mode 100644
index 413e7c8b3780..000000000000
--- a/test/std/experimental/optional/optional.relops/equal.pass.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator == ( const X &lhs, const X &rhs )
- { return lhs.i_ == rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2; // disengaged
- constexpr O o3{1}; // engaged
- constexpr O o4{2}; // engaged
- constexpr O o5{1}; // engaged
-
- static_assert ( o1 == o1 , "" );
- static_assert ( o1 == o2 , "" );
- static_assert ( !(o1 == o3), "" );
- static_assert ( !(o1 == o4), "" );
- static_assert ( !(o1 == o5), "" );
-
- static_assert ( o2 == o1 , "" );
- static_assert ( o2 == o2 , "" );
- static_assert ( !(o2 == o3), "" );
- static_assert ( !(o2 == o4), "" );
- static_assert ( !(o2 == o5), "" );
-
- static_assert ( !(o3 == o1), "" );
- static_assert ( !(o3 == o2), "" );
- static_assert ( o3 == o3 , "" );
- static_assert ( !(o3 == o4), "" );
- static_assert ( o3 == o5 , "" );
-
- static_assert ( !(o4 == o1), "" );
- static_assert ( !(o4 == o2), "" );
- static_assert ( !(o4 == o3), "" );
- static_assert ( o4 == o4 , "" );
- static_assert ( !(o4 == o5), "" );
-
- static_assert ( !(o5 == o1), "" );
- static_assert ( !(o5 == o2), "" );
- static_assert ( o5 == o3 , "" );
- static_assert ( !(o5 == o4), "" );
- static_assert ( o5 == o5 , "" );
-
- }
-}
diff --git a/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp b/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp
deleted file mode 100644
index c0739dda6b83..000000000000
--- a/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator>= (const optional<T>& x, const optional<T>& y);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef optional<X> O;
-
- constexpr O o1; // disengaged
- constexpr O o2; // disengaged
- constexpr O o3{1}; // engaged
- constexpr O o4{2}; // engaged
- constexpr O o5{1}; // engaged
-
- static_assert ( (o1 >= o1), "" );
- static_assert ( (o1 >= o2), "" );
- static_assert ( !(o1 >= o3), "" );
- static_assert ( !(o1 >= o4), "" );
- static_assert ( !(o1 >= o5), "" );
-
- static_assert ( (o2 >= o1), "" );
- static_assert ( (o2 >= o2), "" );
- static_assert ( !(o2 >= o3), "" );
- static_assert ( !(o2 >= o4), "" );
- static_assert ( !(o2 >= o5), "" );
-
- static_assert ( (o3 >= o1), "" );
- static_assert ( (o3 >= o2), "" );
- static_assert ( (o3 >= o3), "" );
- static_assert ( !(o3 >= o4), "" );
- static_assert ( (o3 >= o5), "" );
-
- static_assert ( (o4 >= o1), "" );
- static_assert ( (o4 >= o2), "" );
- static_assert ( (o4 >= o3), "" );
- static_assert ( (o4 >= o4), "" );
- static_assert ( (o4 >= o5), "" );
-
- static_assert ( (o5 >= o1), "" );
- static_assert ( (o5 >= o2), "" );
- static_assert ( (o5 >= o3), "" );
- static_assert ( !(o5 >= o4), "" );
- static_assert ( (o5 >= o5), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.relops/greater_than.pass.cpp b/test/std/experimental/optional/optional.relops/greater_than.pass.cpp
deleted file mode 100644
index df7dbb64717f..000000000000
--- a/test/std/experimental/optional/optional.relops/greater_than.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator> (const optional<T>& x, const optional<T>& y);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef optional<X> O;
-
- constexpr O o1; // disengaged
- constexpr O o2; // disengaged
- constexpr O o3{1}; // engaged
- constexpr O o4{2}; // engaged
- constexpr O o5{1}; // engaged
-
- static_assert ( !(o1 > o1), "" );
- static_assert ( !(o1 > o2), "" );
- static_assert ( !(o1 > o3), "" );
- static_assert ( !(o1 > o4), "" );
- static_assert ( !(o1 > o5), "" );
-
- static_assert ( !(o2 > o1), "" );
- static_assert ( !(o2 > o2), "" );
- static_assert ( !(o2 > o3), "" );
- static_assert ( !(o2 > o4), "" );
- static_assert ( !(o2 > o5), "" );
-
- static_assert ( (o3 > o1), "" );
- static_assert ( (o3 > o2), "" );
- static_assert ( !(o3 > o3), "" );
- static_assert ( !(o3 > o4), "" );
- static_assert ( !(o3 > o5), "" );
-
- static_assert ( (o4 > o1), "" );
- static_assert ( (o4 > o2), "" );
- static_assert ( (o4 > o3), "" );
- static_assert ( !(o4 > o4), "" );
- static_assert ( (o4 > o5), "" );
-
- static_assert ( (o5 > o1), "" );
- static_assert ( (o5 > o2), "" );
- static_assert ( !(o5 > o3), "" );
- static_assert ( !(o5 > o4), "" );
- static_assert ( !(o5 > o5), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.relops/less_equal.pass.cpp b/test/std/experimental/optional/optional.relops/less_equal.pass.cpp
deleted file mode 100644
index d4874d17b240..000000000000
--- a/test/std/experimental/optional/optional.relops/less_equal.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator<= (const optional<T>& x, const optional<T>& y);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef optional<X> O;
-
- constexpr O o1; // disengaged
- constexpr O o2; // disengaged
- constexpr O o3{1}; // engaged
- constexpr O o4{2}; // engaged
- constexpr O o5{1}; // engaged
-
- static_assert ( (o1 <= o1), "" );
- static_assert ( (o1 <= o2), "" );
- static_assert ( (o1 <= o3), "" );
- static_assert ( (o1 <= o4), "" );
- static_assert ( (o1 <= o5), "" );
-
- static_assert ( (o2 <= o1), "" );
- static_assert ( (o2 <= o2), "" );
- static_assert ( (o2 <= o3), "" );
- static_assert ( (o2 <= o4), "" );
- static_assert ( (o2 <= o5), "" );
-
- static_assert ( !(o3 <= o1), "" );
- static_assert ( !(o3 <= o2), "" );
- static_assert ( (o3 <= o3), "" );
- static_assert ( (o3 <= o4), "" );
- static_assert ( (o3 <= o5), "" );
-
- static_assert ( !(o4 <= o1), "" );
- static_assert ( !(o4 <= o2), "" );
- static_assert ( !(o4 <= o3), "" );
- static_assert ( (o4 <= o4), "" );
- static_assert ( !(o4 <= o5), "" );
-
- static_assert ( !(o5 <= o1), "" );
- static_assert ( !(o5 <= o2), "" );
- static_assert ( (o5 <= o3), "" );
- static_assert ( (o5 <= o4), "" );
- static_assert ( (o5 <= o5), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.relops/less_than.pass.cpp b/test/std/experimental/optional/optional.relops/less_than.pass.cpp
deleted file mode 100644
index 4113408268e8..000000000000
--- a/test/std/experimental/optional/optional.relops/less_than.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator< (const optional<T>& x, const optional<T>& y);
-
-#include <experimental/optional>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator < ( const X &lhs, const X &rhs )
- { return lhs.i_ < rhs.i_ ; }
-
-int main()
-{
- {
- typedef optional<X> O;
-
- constexpr O o1; // disengaged
- constexpr O o2; // disengaged
- constexpr O o3{1}; // engaged
- constexpr O o4{2}; // engaged
- constexpr O o5{1}; // engaged
-
- static_assert ( !(o1 < o1), "" );
- static_assert ( !(o1 < o2), "" );
- static_assert ( (o1 < o3), "" );
- static_assert ( (o1 < o4), "" );
- static_assert ( (o1 < o5), "" );
-
- static_assert ( !(o2 < o1), "" );
- static_assert ( !(o2 < o2), "" );
- static_assert ( (o2 < o3), "" );
- static_assert ( (o2 < o4), "" );
- static_assert ( (o2 < o5), "" );
-
- static_assert ( !(o3 < o1), "" );
- static_assert ( !(o3 < o2), "" );
- static_assert ( !(o3 < o3), "" );
- static_assert ( (o3 < o4), "" );
- static_assert ( !(o3 < o5), "" );
-
- static_assert ( !(o4 < o1), "" );
- static_assert ( !(o4 < o2), "" );
- static_assert ( !(o4 < o3), "" );
- static_assert ( !(o4 < o4), "" );
- static_assert ( !(o4 < o5), "" );
-
- static_assert ( !(o5 < o1), "" );
- static_assert ( !(o5 < o2), "" );
- static_assert ( !(o5 < o3), "" );
- static_assert ( (o5 < o4), "" );
- static_assert ( !(o5 < o5), "" );
- }
-}
diff --git a/test/std/experimental/optional/optional.relops/not_equal.pass.cpp b/test/std/experimental/optional/optional.relops/not_equal.pass.cpp
deleted file mode 100644
index 19a196317d4f..000000000000
--- a/test/std/experimental/optional/optional.relops/not_equal.pass.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y);
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-using std::experimental::optional;
-
-struct X
-{
- int i_;
-
- constexpr X(int i) : i_(i) {}
-};
-
-constexpr bool operator == ( const X &lhs, const X &rhs )
- { return lhs.i_ == rhs.i_ ; }
-
-int main()
-{
- {
- typedef X T;
- typedef optional<T> O;
-
- constexpr O o1; // disengaged
- constexpr O o2; // disengaged
- constexpr O o3{1}; // engaged
- constexpr O o4{2}; // engaged
- constexpr O o5{1}; // engaged
-
- static_assert ( !(o1 != o1), "" );
- static_assert ( !(o1 != o2), "" );
- static_assert ( (o1 != o3), "" );
- static_assert ( (o1 != o4), "" );
- static_assert ( (o1 != o5), "" );
-
- static_assert ( !(o2 != o1), "" );
- static_assert ( !(o2 != o2), "" );
- static_assert ( (o2 != o3), "" );
- static_assert ( (o2 != o4), "" );
- static_assert ( (o2 != o5), "" );
-
- static_assert ( (o3 != o1), "" );
- static_assert ( (o3 != o2), "" );
- static_assert ( !(o3 != o3), "" );
- static_assert ( (o3 != o4), "" );
- static_assert ( !(o3 != o5), "" );
-
- static_assert ( (o4 != o1), "" );
- static_assert ( (o4 != o2), "" );
- static_assert ( (o4 != o3), "" );
- static_assert ( !(o4 != o4), "" );
- static_assert ( (o4 != o5), "" );
-
- static_assert ( (o5 != o1), "" );
- static_assert ( (o5 != o2), "" );
- static_assert ( !(o5 != o3), "" );
- static_assert ( (o5 != o4), "" );
- static_assert ( !(o5 != o5), "" );
-
- }
-}
diff --git a/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp b/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
deleted file mode 100644
index 9abd87bd4051..000000000000
--- a/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T>
-// constexpr
-// optional<typename decay<T>::type>
-// make_optional(T&& v);
-
-#include <experimental/optional>
-#include <string>
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::make_optional;
-
- {
- optional<int> opt = make_optional(2);
- assert(*opt == 2);
- }
- {
- std::string s("123");
- optional<std::string> opt = make_optional(s);
- assert(*opt == s);
- }
- {
- std::string s("123");
- optional<std::string> opt = make_optional(std::move(s));
- assert(*opt == "123");
- LIBCPP_ASSERT(s.empty());
- }
- {
- std::unique_ptr<int> s(new int(3));
- optional<std::unique_ptr<int>> opt = make_optional(std::move(s));
- assert(**opt == 3);
- assert(s == nullptr);
- }
-}
diff --git a/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
deleted file mode 100644
index 4d643cb44b67..000000000000
--- a/test/std/experimental/optional/optional.specalg/swap.pass.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// template <class T> void swap(optional<T>& x, optional<T>& y)
-// noexcept(noexcept(x.swap(y)));
-
-#include <experimental/optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-using std::experimental::optional;
-
-class X
-{
- int i_;
-public:
- static unsigned dtor_called;
- X(int i) : i_(i) {}
- X(X&& x) = default;
- X& operator=(X&&) = default;
- ~X() {++dtor_called;}
-
- friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
-};
-
-unsigned X::dtor_called = 0;
-
-class Y
-{
- int i_;
-public:
- static unsigned dtor_called;
- Y(int i) : i_(i) {}
- Y(Y&&) = default;
- ~Y() {++dtor_called;}
-
- friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
- friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);}
-};
-
-unsigned Y::dtor_called = 0;
-
-class Z
-{
- int i_;
-public:
- Z(int i) : i_(i) {}
- Z(Z&&) {TEST_THROW(7);}
-
- friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
- friend void swap(Z&, Z&) {TEST_THROW(6);}
-};
-
-int main()
-{
- {
- optional<int> opt1;
- optional<int> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<int> opt1(1);
- optional<int> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<int> opt1;
- optional<int> opt2(2);
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<int> opt1(1);
- optional<int> opt2(2);
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<X> opt1;
- optional<X> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- assert(X::dtor_called == 0);
- }
- {
- optional<X> opt1(1);
- optional<X> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- X::dtor_called = 0;
- swap(opt1, opt2);
- assert(X::dtor_called == 1);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<X> opt1;
- optional<X> opt2(2);
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- X::dtor_called = 0;
- swap(opt1, opt2);
- assert(X::dtor_called == 1);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<X> opt1(1);
- optional<X> opt2(2);
- static_assert(noexcept(swap(opt1, opt2)) == true, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- X::dtor_called = 0;
- swap(opt1, opt2);
- assert(X::dtor_called == 1); // from inside std::swap
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<Y> opt1;
- optional<Y> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- assert(Y::dtor_called == 0);
- }
- {
- optional<Y> opt1(1);
- optional<Y> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- Y::dtor_called = 0;
- swap(opt1, opt2);
- assert(Y::dtor_called == 1);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<Y> opt1;
- optional<Y> opt2(2);
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- Y::dtor_called = 0;
- swap(opt1, opt2);
- assert(Y::dtor_called == 1);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<Y> opt1(1);
- optional<Y> opt2(2);
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- Y::dtor_called = 0;
- swap(opt1, opt2);
- assert(Y::dtor_called == 0);
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 2);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 1);
- }
- {
- optional<Z> opt1;
- optional<Z> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- swap(opt1, opt2);
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == false);
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- optional<Z> opt1;
- opt1.emplace(1);
- optional<Z> opt2;
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- try
- {
- swap(opt1, opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 7);
- }
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == false);
- }
- {
- optional<Z> opt1;
- optional<Z> opt2;
- opt2.emplace(2);
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- try
- {
- swap(opt1, opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 7);
- }
- assert(static_cast<bool>(opt1) == false);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- }
- {
- optional<Z> opt1;
- opt1.emplace(1);
- optional<Z> opt2;
- opt2.emplace(2);
- static_assert(noexcept(swap(opt1, opt2)) == false, "");
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- try
- {
- swap(opt1, opt2);
- assert(false);
- }
- catch (int i)
- {
- assert(i == 6);
- }
- assert(static_cast<bool>(opt1) == true);
- assert(*opt1 == 1);
- assert(static_cast<bool>(opt2) == true);
- assert(*opt2 == 2);
- }
-#endif // TEST_HAS_NO_EXCEPTIONS
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp
deleted file mode 100644
index bdf01eba406f..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for
-// (possibly cv-qualified) in_place_t is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::in_place_t;
- using std::experimental::in_place;
-
- optional<const in_place_t> opt;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp b/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp
deleted file mode 100644
index 61393c105e95..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for a
-// reference type is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
-
- optional<const int&> opt;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp
deleted file mode 100644
index 89c207306aba..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for
-// (possibly cv-qualified) nullopt_t is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- optional<const nullopt_t> opt;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp
deleted file mode 100644
index 47c2be7da0d0..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for
-// (possibly cv-qualified) in_place_t is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::in_place_t;
- using std::experimental::in_place;
-
- optional<in_place_t> opt;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp b/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp
deleted file mode 100644
index b8fba47f7e78..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// #include <initializer_list>
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
-
- std::initializer_list<int> list;
- (void)list;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp b/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp
deleted file mode 100644
index de2f18991b24..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for a
-// reference type is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
-
- optional<int&> opt;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp
deleted file mode 100644
index 3d276d642022..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for
-// (possibly cv-qualified) nullopt_t is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
- using std::experimental::nullopt_t;
- using std::experimental::nullopt;
-
- optional<nullopt_t> opt;
-}
diff --git a/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp b/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp
deleted file mode 100644
index fd6da18e8c16..000000000000
--- a/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <optional>
-
-// A program that necessitates the instantiation of template optional for a
-// reference type is ill-formed.
-
-#include <experimental/optional>
-
-int main()
-{
- using std::experimental::optional;
-
- optional<int&&> opt;
-}
diff --git a/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp b/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp
new file mode 100644
index 000000000000..af6b13fe878d
--- /dev/null
+++ b/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.casts]
+// template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&);
+#include <experimental/simd>
+#include <cstdint>
+
+using namespace std::experimental::parallelism_v2;
+
+static_assert(std::is_same<decltype(simd_cast<int32_t>(native_simd<int32_t>())),
+ native_simd<int32_t>>::value,
+ "");
+
+static_assert(
+ std::is_same<decltype(simd_cast<int64_t>(fixed_size_simd<int32_t, 4>())),
+ fixed_size_simd<int64_t, 4>>::value,
+ "");
+
+static_assert(std::is_same<decltype(simd_cast<fixed_size_simd<int64_t, 1>>(
+ simd<int32_t, simd_abi::scalar>())),
+ fixed_size_simd<int64_t, 1>>::value,
+ "");
+
+static_assert(std::is_same<decltype(simd_cast<simd<int64_t, simd_abi::scalar>>(
+ fixed_size_simd<int32_t, 1>())),
+ simd<int64_t, simd_abi::scalar>>::value,
+ "");
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp b/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp
new file mode 100644
index 000000000000..eb1fa55e0a44
--- /dev/null
+++ b/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.casts]
+// template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&);
+
+#include <experimental/simd>
+#include <cstdint>
+
+using namespace std::experimental::parallelism_v2;
+
+static_assert(
+ std::is_same<decltype(static_simd_cast<float>(native_simd<int>())),
+ native_simd<float>>::value,
+ "");
+
+static_assert(std::is_same<decltype(static_simd_cast<fixed_size_simd<float, 1>>(
+ simd<int, simd_abi::scalar>())),
+ fixed_size_simd<float, 1>>::value,
+ "");
+
+static_assert(
+ std::is_same<decltype(static_simd_cast<simd<float, simd_abi::scalar>>(
+ fixed_size_simd<int, 1>())),
+ simd<float, simd_abi::scalar>>::value,
+ "");
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.cons/broadcast.pass.cpp b/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
new file mode 100644
index 000000000000..60230cc63735
--- /dev/null
+++ b/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// See GCC PR63723.
+// UNSUPPORTED: gcc-4.9
+
+// <experimental/simd>
+//
+// [simd.class]
+// template <class U> simd(U&& value);
+
+#include <cstdint>
+#include <experimental/simd>
+
+using namespace std::experimental::parallelism_v2;
+
+template <class T, class... Args>
+auto not_supported_native_simd_ctor(Args&&... args)
+ -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete;
+
+template <class T>
+void not_supported_native_simd_ctor(...) {}
+
+template <class T, class... Args>
+auto supported_native_simd_ctor(Args&&... args)
+ -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {}
+
+template <class T>
+void supported_native_simd_ctor(...) = delete;
+
+void compile_narrowing_conversion() {
+ supported_native_simd_ctor<int8_t>(3);
+ supported_native_simd_ctor<int16_t>(3);
+ supported_native_simd_ctor<int32_t>(3);
+ supported_native_simd_ctor<int64_t>(3);
+ supported_native_simd_ctor<uint8_t>(3);
+ supported_native_simd_ctor<uint16_t>(3);
+ supported_native_simd_ctor<uint32_t>(3);
+ supported_native_simd_ctor<uint64_t>(3);
+ supported_native_simd_ctor<float>(3.f);
+ supported_native_simd_ctor<double>(3.);
+ supported_native_simd_ctor<long double>(3.);
+
+ not_supported_native_simd_ctor<float>(3.);
+ not_supported_native_simd_ctor<int8_t>(long(3));
+ not_supported_native_simd_ctor<float>(long(3));
+ not_supported_native_simd_ctor<int>(3.);
+}
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.cons/generator.pass.cpp b/test/std/experimental/simd/simd.cons/generator.pass.cpp
new file mode 100644
index 000000000000..baf7d936c6a3
--- /dev/null
+++ b/test/std/experimental/simd/simd.cons/generator.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// See GCC PR63723.
+// UNSUPPORTED: gcc-4.9
+
+// <experimental/simd>
+//
+// [simd.class]
+// template <class G> explicit simd(G&& gen);
+
+#include <cstdint>
+#include <experimental/simd>
+
+using namespace std::experimental::parallelism_v2;
+
+template <class T, class... Args>
+auto not_supported_native_simd_ctor(Args&&... args)
+ -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete;
+
+template <class T>
+void not_supported_native_simd_ctor(...) {}
+
+template <class T, class... Args>
+auto supported_native_simd_ctor(Args&&... args)
+ -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {}
+
+template <class T>
+void supported_native_simd_ctor(...) = delete;
+
+void compile_generator() {
+ supported_native_simd_ctor<int>([](int i) { return i; });
+ not_supported_native_simd_ctor<int>([](int i) { return float(i); });
+ not_supported_native_simd_ctor<int>([](intptr_t i) { return (int*)(i); });
+ not_supported_native_simd_ctor<int>([](int* i) { return i; });
+}
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp b/test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp
new file mode 100644
index 000000000000..6e244220d7e2
--- /dev/null
+++ b/test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.traits]
+// template <class T, size_t N> struct abi_for_size { using type = see below ; };
+// template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type;
+
+#include <cstdint>
+#include <experimental/simd>
+
+using namespace std::experimental::parallelism_v2;
+
+static_assert(std::is_same<typename abi_for_size<int, 4>::type,
+ simd_abi::fixed_size<4>>::value,
+ "");
+
+static_assert(
+ std::is_same<abi_for_size_t<int, 4>, simd_abi::fixed_size<4>>::value, "");
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp b/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp
new file mode 100644
index 000000000000..4f4f738a8351
--- /dev/null
+++ b/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp
@@ -0,0 +1,115 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.traits]
+// template <class T> struct is_abi_tag;
+// template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value;
+
+#include <cstdint>
+#include <experimental/simd>
+#include "test_macros.h"
+
+using namespace std::experimental::parallelism_v2;
+
+struct UserType {};
+
+static_assert( is_abi_tag<simd_abi::native<int8_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<int16_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<int32_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<int64_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<uint8_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<uint16_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<uint32_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<uint64_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<float>>::value, "");
+static_assert( is_abi_tag<simd_abi::native<double>>::value, "");
+
+static_assert( is_abi_tag<simd_abi::compatible<int8_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<int16_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<int32_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<int64_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<uint8_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<uint16_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<uint32_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<uint64_t>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<float>>::value, "");
+static_assert( is_abi_tag<simd_abi::compatible<double>>::value, "");
+
+static_assert( is_abi_tag<simd_abi::scalar>::value, "");
+static_assert(!std::is_same<simd_abi::scalar, simd_abi::fixed_size<1>>::value,
+ "");
+
+static_assert( is_abi_tag<simd_abi::fixed_size<1>>::value, "");
+static_assert( is_abi_tag<simd_abi::fixed_size<2>>::value, "");
+static_assert( is_abi_tag<simd_abi::fixed_size<3>>::value, "");
+static_assert( is_abi_tag<simd_abi::fixed_size<4>>::value, "");
+static_assert( is_abi_tag<simd_abi::fixed_size<5>>::value, "");
+static_assert( is_abi_tag<simd_abi::fixed_size<32>>::value, "");
+
+static_assert(!is_abi_tag<void>::value, "");
+static_assert(!is_abi_tag<int>::value, "");
+static_assert(!is_abi_tag<float>::value, "");
+static_assert(!is_abi_tag<UserType>::value, "");
+static_assert(!is_abi_tag<simd<int>>::value, "");
+static_assert(!is_abi_tag<simd<float>>::value, "");
+static_assert(!is_abi_tag<simd_mask<int>>::value, "");
+static_assert(!is_abi_tag<simd_mask<float>>::value, "");
+
+#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
+ !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
+
+static_assert( is_abi_tag_v<simd_abi::native<int8_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<int16_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<int32_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<int64_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<uint8_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<uint16_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<uint32_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<uint64_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<float>>, "");
+static_assert( is_abi_tag_v<simd_abi::native<double>>, "");
+
+static_assert( is_abi_tag_v<simd_abi::compatible<int8_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<int16_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<int32_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<int64_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<uint8_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<uint16_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<uint32_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<uint64_t>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<float>>, "");
+static_assert( is_abi_tag_v<simd_abi::compatible<double>>, "");
+
+static_assert( is_abi_tag_v<simd_abi::scalar>, "");
+static_assert(!std::is_same<simd_abi::scalar, simd_abi::fixed_size<1>>::value,
+ "");
+
+static_assert( is_abi_tag_v<simd_abi::fixed_size<1>>, "");
+static_assert( is_abi_tag_v<simd_abi::fixed_size<2>>, "");
+static_assert( is_abi_tag_v<simd_abi::fixed_size<3>>, "");
+static_assert( is_abi_tag_v<simd_abi::fixed_size<4>>, "");
+static_assert( is_abi_tag_v<simd_abi::fixed_size<5>>, "");
+static_assert( is_abi_tag_v<simd_abi::fixed_size<32>>, "");
+
+static_assert(!is_abi_tag_v<void>, "");
+static_assert(!is_abi_tag_v<int>, "");
+static_assert(!is_abi_tag_v<float>, "");
+static_assert(!is_abi_tag_v<UserType>, "");
+static_assert(!is_abi_tag_v<simd<int>>, "");
+static_assert(!is_abi_tag_v<simd<float>>, "");
+static_assert(!is_abi_tag_v<simd_mask<int>>, "");
+static_assert(!is_abi_tag_v<simd_mask<float>>, "");
+
+#endif
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.traits/is_simd.pass.cpp b/test/std/experimental/simd/simd.traits/is_simd.pass.cpp
new file mode 100644
index 000000000000..77f5d10ed3a8
--- /dev/null
+++ b/test/std/experimental/simd/simd.traits/is_simd.pass.cpp
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.traits]
+// template <class T> struct is_simd;
+// template <class T> inline constexpr bool is_simd_v = is_simd<T>::value;
+
+#include <cstdint>
+#include <experimental/simd>
+#include "test_macros.h"
+
+using namespace std::experimental::parallelism_v2;
+
+struct UserType {};
+
+static_assert( is_simd<native_simd<int8_t>>::value, "");
+static_assert( is_simd<native_simd<int16_t>>::value, "");
+static_assert( is_simd<native_simd<int32_t>>::value, "");
+static_assert( is_simd<native_simd<int64_t>>::value, "");
+static_assert( is_simd<native_simd<uint8_t>>::value, "");
+static_assert( is_simd<native_simd<uint16_t>>::value, "");
+static_assert( is_simd<native_simd<uint32_t>>::value, "");
+static_assert( is_simd<native_simd<uint64_t>>::value, "");
+static_assert( is_simd<native_simd<float>>::value, "");
+static_assert( is_simd<native_simd<double>>::value, "");
+
+static_assert( is_simd<fixed_size_simd<int8_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<int16_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<int32_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<int64_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint8_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint16_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint32_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint64_t, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<float, 1>>::value, "");
+static_assert( is_simd<fixed_size_simd<double, 1>>::value, "");
+
+static_assert( is_simd<fixed_size_simd<int8_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<int16_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<int32_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<int64_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint8_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint16_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint32_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint64_t, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<float, 3>>::value, "");
+static_assert( is_simd<fixed_size_simd<double, 3>>::value, "");
+
+static_assert( is_simd<fixed_size_simd<int8_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<int16_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<int32_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<int64_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint8_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint16_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint32_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<uint64_t, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<float, 32>>::value, "");
+static_assert( is_simd<fixed_size_simd<double, 32>>::value, "");
+
+static_assert(!is_simd<void>::value, "");
+static_assert(!is_simd<int>::value, "");
+static_assert(!is_simd<float>::value, "");
+static_assert(!is_simd<simd_mask<int>>::value, "");
+static_assert(!is_simd<simd_mask<float>>::value, "");
+static_assert(!is_simd<UserType>::value, "");
+
+#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
+ !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
+
+static_assert( is_simd_v<native_simd<int8_t>>, "");
+static_assert( is_simd_v<native_simd<int16_t>>, "");
+static_assert( is_simd_v<native_simd<int32_t>>, "");
+static_assert( is_simd_v<native_simd<int64_t>>, "");
+static_assert( is_simd_v<native_simd<uint8_t>>, "");
+static_assert( is_simd_v<native_simd<uint16_t>>, "");
+static_assert( is_simd_v<native_simd<uint32_t>>, "");
+static_assert( is_simd_v<native_simd<uint64_t>>, "");
+static_assert( is_simd_v<native_simd<float>>, "");
+static_assert( is_simd_v<native_simd<double>>, "");
+
+static_assert( is_simd_v<fixed_size_simd<int8_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<int16_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<int32_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<int64_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint8_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint16_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint32_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint64_t, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<float, 1>>, "");
+static_assert( is_simd_v<fixed_size_simd<double, 1>>, "");
+
+static_assert( is_simd_v<fixed_size_simd<int8_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<int16_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<int32_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<int64_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint8_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint16_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint32_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint64_t, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<float, 3>>, "");
+static_assert( is_simd_v<fixed_size_simd<double, 3>>, "");
+
+static_assert( is_simd_v<fixed_size_simd<int8_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<int16_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<int32_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<int64_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint8_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint16_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint32_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<uint64_t, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<float, 32>>, "");
+static_assert( is_simd_v<fixed_size_simd<double, 32>>, "");
+
+static_assert(!is_simd_v<void>, "");
+static_assert(!is_simd_v<int>, "");
+static_assert(!is_simd_v<float>, "");
+static_assert(!is_simd_v<simd_mask<int>>, "");
+static_assert(!is_simd_v<simd_mask<float>>, "");
+static_assert(!is_simd_v<UserType>, "");
+
+#endif
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp b/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp
new file mode 100644
index 000000000000..a6fe409057c2
--- /dev/null
+++ b/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.traits]
+// template <class T> struct is_simd_flag_type;
+// template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value;
+
+#include <cstdint>
+#include <experimental/simd>
+#include "test_macros.h"
+
+using namespace std::experimental::parallelism_v2;
+
+struct UserType {};
+
+static_assert( is_simd_flag_type<element_aligned_tag>::value, "");
+static_assert( is_simd_flag_type<vector_aligned_tag>::value, "");
+static_assert( is_simd_flag_type<overaligned_tag<16>>::value, "");
+static_assert( is_simd_flag_type<overaligned_tag<32>>::value, "");
+
+static_assert(!is_simd_flag_type<void>::value, "");
+static_assert(!is_simd_flag_type<int>::value, "");
+static_assert(!is_simd_flag_type<float>::value, "");
+static_assert(!is_simd_flag_type<UserType>::value, "");
+static_assert(!is_simd_flag_type<simd<int8_t>>::value, "");
+static_assert(!is_simd_flag_type<simd_mask<int8_t>>::value, "");
+
+#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
+ !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
+
+static_assert( is_simd_flag_type_v<element_aligned_tag>, "");
+static_assert( is_simd_flag_type_v<vector_aligned_tag>, "");
+static_assert( is_simd_flag_type_v<overaligned_tag<16>>, "");
+static_assert( is_simd_flag_type_v<overaligned_tag<32>>, "");
+
+static_assert(!is_simd_flag_type_v<void>, "");
+static_assert(!is_simd_flag_type_v<int>, "");
+static_assert(!is_simd_flag_type_v<float>, "");
+static_assert(!is_simd_flag_type_v<UserType>, "");
+static_assert(!is_simd_flag_type_v<simd<int8_t>>, "");
+static_assert(!is_simd_flag_type_v<simd_mask<int8_t>>, "");
+
+#endif
+
+int main() {}
diff --git a/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp b/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp
new file mode 100644
index 000000000000..8c2e0ed5bf43
--- /dev/null
+++ b/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/simd>
+//
+// [simd.traits]
+// template <class T> struct is_simd_mask;
+// template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value;
+
+#include <cstdint>
+#include <experimental/simd>
+#include "test_macros.h"
+
+using namespace std::experimental::parallelism_v2;
+
+struct UserType {};
+
+static_assert( is_simd_mask<native_simd_mask<int8_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<int16_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<int32_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<int64_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<uint8_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<uint16_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<uint32_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<uint64_t>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<float>>::value, "");
+static_assert( is_simd_mask<native_simd_mask<double>>::value, "");
+
+static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<float, 1>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<double, 1>>::value, "");
+
+static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<float, 3>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<double, 3>>::value, "");
+
+static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<float, 32>>::value, "");
+static_assert( is_simd_mask<fixed_size_simd_mask<double, 32>>::value, "");
+
+static_assert(!is_simd_mask<void>::value, "");
+static_assert(!is_simd_mask<int>::value, "");
+static_assert(!is_simd_mask<float>::value, "");
+static_assert(!is_simd_mask<simd<int>>::value, "");
+static_assert(!is_simd_mask<simd<float>>::value, "");
+static_assert(!is_simd_mask<UserType>::value, "");
+
+#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
+ !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
+
+static_assert( is_simd_mask_v<native_simd_mask<int8_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<int16_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<int32_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<int64_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<uint8_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<uint16_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<uint32_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<uint64_t>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<float>>, "");
+static_assert( is_simd_mask_v<native_simd_mask<double>>, "");
+
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 1>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 1>>, "");
+
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 3>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 3>>, "");
+
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 32>>, "");
+static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 32>>, "");
+
+static_assert(!is_simd_mask_v<void>, "");
+static_assert(!is_simd_mask_v<int>, "");
+static_assert(!is_simd_mask_v<float>, "");
+static_assert(!is_simd_mask_v<simd<int>>, "");
+static_assert(!is_simd_mask_v<simd<float>>, "");
+static_assert(!is_simd_mask_v<UserType>, "");
+
+#endif
+
+int main() {}
diff --git a/test/std/experimental/string.view/lit.local.cfg b/test/std/experimental/string.view/lit.local.cfg
deleted file mode 100644
index 376dbe7c16ec..000000000000
--- a/test/std/experimental/string.view/lit.local.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Disable all of the filesystem tests if the correct feature is not available.
-if 'msvc' in config.available_features:
- config.unsupported = True
diff --git a/test/std/experimental/string.view/nothing_to_do.pass.cpp b/test/std/experimental/string.view/nothing_to_do.pass.cpp
deleted file mode 100644
index c21f8a701685..000000000000
--- a/test/std/experimental/string.view/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <experimental/string_view>
-
-int main () {}
diff --git a/test/std/experimental/string.view/string.view.access/at.pass.cpp b/test/std/experimental/string.view/string.view.access/at.pass.cpp
deleted file mode 100644
index eaea062987fb..000000000000
--- a/test/std/experimental/string.view/string.view.access/at.pass.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// NOTE: Older versions of clang have a bug where they fail to evaluate
-// string_view::at as a constant expression.
-// XFAIL: clang-3.4, clang-3.3
-
-
-// <string_view>
-
-// constexpr const _CharT& at(size_type _pos) const;
-
-#include <experimental/string_view>
-#include <stdexcept>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <typename CharT>
-void test ( const CharT *s, size_t len ) {
- std::experimental::basic_string_view<CharT> sv ( s, len );
- assert ( sv.length() == len );
- for ( size_t i = 0; i < len; ++i ) {
- assert ( sv.at(i) == s[i] );
- assert ( &sv.at(i) == s + i );
- }
-
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try { sv.at(len); } catch ( const std::out_of_range & ) { return ; }
- assert ( false );
-#endif
-}
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
-#endif
-
-#if TEST_STD_VER >= 11
- {
- constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
- static_assert ( sv.length() == 2, "" );
- static_assert ( sv.at(0) == 'A', "" );
- static_assert ( sv.at(1) == 'B', "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.access/back.pass.cpp b/test/std/experimental/string.view/string.view.access/back.pass.cpp
deleted file mode 100644
index 09f7950341a8..000000000000
--- a/test/std/experimental/string.view/string.view.access/back.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr const _CharT& front();
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <typename CharT>
-bool test ( const CharT *s, size_t len ) {
- std::experimental::basic_string_view<CharT> sv ( s, len );
- assert ( sv.length() == len );
- assert ( sv.back() == s[len-1] );
- return &sv.back() == s + len - 1;
- }
-
-int main () {
- assert ( test ( "ABCDE", 5 ));
- assert ( test ( "a", 1 ));
-
- assert ( test ( L"ABCDE", 5 ));
- assert ( test ( L"a", 1 ));
-
-#if TEST_STD_VER >= 11
- assert ( test ( u"ABCDE", 5 ));
- assert ( test ( u"a", 1 ));
-
- assert ( test ( U"ABCDE", 5 ));
- assert ( test ( U"a", 1 ));
-#endif
-
-#if TEST_STD_VER >= 11
- {
- constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
- static_assert ( sv.length() == 2, "" );
- static_assert ( sv.back() == 'B', "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.access/data.pass.cpp b/test/std/experimental/string.view/string.view.access/data.pass.cpp
deleted file mode 100644
index 4b581d653eac..000000000000
--- a/test/std/experimental/string.view/string.view.access/data.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr const _CharT* data() const noexcept;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <typename CharT>
-void test ( const CharT *s, size_t len ) {
- std::experimental::basic_string_view<CharT> sv ( s, len );
- assert ( sv.length() == len );
- assert ( sv.data() == s );
- }
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
-#endif
-
-#if TEST_STD_VER > 11
- {
- constexpr const char *s = "ABC";
- constexpr std::experimental::basic_string_view<char> sv( s, 2 );
- static_assert( sv.length() == 2, "" );
- static_assert( sv.data() == s, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.access/front.pass.cpp b/test/std/experimental/string.view/string.view.access/front.pass.cpp
deleted file mode 100644
index acb00a46a2e5..000000000000
--- a/test/std/experimental/string.view/string.view.access/front.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr const _CharT& back();
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <typename CharT>
-bool test ( const CharT *s, size_t len ) {
- std::experimental::basic_string_view<CharT> sv ( s, len );
- assert ( sv.length() == len );
- assert ( sv.front() == s[0] );
- return &sv.front() == s;
- }
-
-int main () {
- assert ( test ( "ABCDE", 5 ));
- assert ( test ( "a", 1 ));
-
- assert ( test ( L"ABCDE", 5 ));
- assert ( test ( L"a", 1 ));
-
-#if TEST_STD_VER >= 11
- assert ( test ( u"ABCDE", 5 ));
- assert ( test ( u"a", 1 ));
-
- assert ( test ( U"ABCDE", 5 ));
- assert ( test ( U"a", 1 ));
-#endif
-
-#if TEST_STD_VER >= 11
- {
- constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
- static_assert ( sv.length() == 2, "" );
- static_assert ( sv.front() == 'A', "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.access/index.pass.cpp b/test/std/experimental/string.view/string.view.access/index.pass.cpp
deleted file mode 100644
index 0cb385eeff58..000000000000
--- a/test/std/experimental/string.view/string.view.access/index.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr const _CharT& operator[](size_type _pos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <typename CharT>
-void test ( const CharT *s, size_t len ) {
- std::experimental::basic_string_view<CharT> sv ( s, len );
- assert ( sv.length() == len );
- for ( size_t i = 0; i < len; ++i ) {
- assert ( sv[i] == s[i] );
- assert ( &sv[i] == s + i );
- }
- }
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
-#endif
-
-#if TEST_STD_VER > 11
- {
- constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
- static_assert ( sv.length() == 2, "" );
- static_assert ( sv[0] == 'A', "" );
- static_assert ( sv[1] == 'B', "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp b/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp
deleted file mode 100644
index a5108bf12660..000000000000
--- a/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// [string.view.capacity], capacity
-// constexpr size_type size() const noexcept;
-// constexpr size_type length() const noexcept;
-// constexpr size_type max_size() const noexcept;
-// constexpr bool empty() const noexcept;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename SV>
-void test1 () {
-#if TEST_STD_VER > 11
- {
- constexpr SV sv1;
- static_assert ( sv1.size() == 0, "" );
- static_assert ( sv1.empty(), "");
- static_assert ( sv1.size() == sv1.length(), "" );
- static_assert ( sv1.max_size() > sv1.size(), "");
- }
-#endif
-
- {
- SV sv1;
- assert ( sv1.size() == 0 );
- assert ( sv1.empty());
- assert ( sv1.size() == sv1.length());
- assert ( sv1.max_size() > sv1.size());
- }
-}
-
-template<typename CharT>
-void test2 ( const CharT *s, size_t len ) {
- {
- std::experimental::basic_string_view<CharT> sv1 ( s );
- assert ( sv1.size() == len );
- assert ( sv1.data() == s );
- assert ( sv1.empty() == (len == 0));
- assert ( sv1.size() == sv1.length());
- assert ( sv1.max_size() > sv1.size());
- }
-}
-
-int main () {
- typedef std::experimental::string_view string_view;
- typedef std::experimental::u16string_view u16string_view;
- typedef std::experimental::u32string_view u32string_view;
- typedef std::experimental::wstring_view wstring_view;
-
- test1<string_view> ();
- test1<u16string_view> ();
- test1<u32string_view> ();
- test1<wstring_view> ();
-
- test2 ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
- test2 ( "ABCDE", 5 );
- test2 ( "a", 1 );
- test2 ( "", 0 );
-
- test2 ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
- test2 ( L"ABCDE", 5 );
- test2 ( L"a", 1 );
- test2 ( L"", 0 );
-
-#if TEST_STD_VER >= 11
- test2 ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
- test2 ( u"ABCDE", 5 );
- test2 ( u"a", 1 );
- test2 ( u"", 0 );
-
- test2 ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
- test2 ( U"ABCDE", 5 );
- test2 ( U"a", 1 );
- test2 ( U"", 0 );
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
deleted file mode 100644
index bd566a986276..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits>
-// constexpr bool operator==(basic_string_view<charT,traits> lhs, const charT* rhs);
-// template<class charT, class traits>
-// constexpr bool operator==(const charT* lhs, basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(S lhs, const typename S::value_type* rhs, bool x)
-{
- assert((lhs == rhs) == x);
- assert((rhs == lhs) == x);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), "", true);
- test(S(""), "abcde", false);
- test(S(""), "abcdefghij", false);
- test(S(""), "abcdefghijklmnopqrst", false);
- test(S("abcde"), "", false);
- test(S("abcde"), "abcde", true);
- test(S("abcde"), "abcdefghij", false);
- test(S("abcde"), "abcdefghijklmnopqrst", false);
- test(S("abcdefghij"), "", false);
- test(S("abcdefghij"), "abcde", false);
- test(S("abcdefghij"), "abcdefghij", true);
- test(S("abcdefghij"), "abcdefghijklmnopqrst", false);
- test(S("abcdefghijklmnopqrst"), "", false);
- test(S("abcdefghijklmnopqrst"), "abcde", false);
- test(S("abcdefghijklmnopqrst"), "abcdefghij", false);
- test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
- static_assert ( sv1 == "", "" );
- static_assert ( "" == sv1, "" );
- static_assert (!(sv1 == "abcde"), "" );
- static_assert (!("abcde" == sv1), "" );
-
- static_assert ( sv2 == "abcde", "" );
- static_assert ( "abcde" == sv2, "" );
- static_assert (!(sv2 == "abcde0"), "" );
- static_assert (!("abcde0" == sv2), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp
deleted file mode 100644
index 1fd72d7964b6..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// bool operator==(const charT* lhs, const basic_string<charT,traits> rhs);
-// template<class charT, class traits, class Allocator>
-// bool operator==(const basic_string_view<charT,traits> lhs, const CharT* rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const std::string &lhs, S rhs, bool x)
-{
- assert((lhs == rhs) == x);
- assert((rhs == lhs) == x);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test("", S(""), true);
- test("", S("abcde"), false);
- test("", S("abcdefghij"), false);
- test("", S("abcdefghijklmnopqrst"), false);
- test("abcde", S(""), false);
- test("abcde", S("abcde"), true);
- test("abcde", S("abcdefghij"), false);
- test("abcde", S("abcdefghijklmnopqrst"), false);
- test("abcdefghij", S(""), false);
- test("abcdefghij", S("abcde"), false);
- test("abcdefghij", S("abcdefghij"), true);
- test("abcdefghij", S("abcdefghijklmnopqrst"), false);
- test("abcdefghijklmnopqrst", S(""), false);
- test("abcdefghijklmnopqrst", S("abcde"), false);
- test("abcdefghijklmnopqrst", S("abcdefghij"), false);
- test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true);
- }
-}
-
diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
deleted file mode 100644
index 51decdca67cd..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator==(const basic_string_view<charT,traits> lhs,
-// const basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(S lhs, S rhs, bool x)
-{
- assert((lhs == rhs) == x);
- assert((rhs == lhs) == x);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), S(""), true);
- test(S(""), S("abcde"), false);
- test(S(""), S("abcdefghij"), false);
- test(S(""), S("abcdefghijklmnopqrst"), false);
- test(S("abcde"), S(""), false);
- test(S("abcde"), S("abcde"), true);
- test(S("abcde"), S("abcdefghij"), false);
- test(S("abcde"), S("abcdefghijklmnopqrst"), false);
- test(S("abcdefghij"), S(""), false);
- test(S("abcdefghij"), S("abcde"), false);
- test(S("abcdefghij"), S("abcdefghij"), true);
- test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false);
- test(S("abcdefghijklmnopqrst"), S(""), false);
- test(S("abcdefghijklmnopqrst"), S("abcde"), false);
- test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false);
- test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2;
- constexpr SV sv3 { "abcde", 5 };
- static_assert ( sv1 == sv2, "" );
- static_assert (!(sv1 == sv3), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
deleted file mode 100644
index cf8a30a3942c..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator>=(const charT* lhs, basic_string_wiew<charT,traits> rhs);
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator>=(basic_string_wiew<charT,traits> lhs, const charT* rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs >= rhs) == x);
- assert((rhs >= lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test("", S(""), true, true);
- test("", S("abcde"), false, true);
- test("", S("abcdefghij"), false, true);
- test("", S("abcdefghijklmnopqrst"), false, true);
- test("abcde", S(""), true, false);
- test("abcde", S("abcde"), true, true);
- test("abcde", S("abcdefghij"), false, true);
- test("abcde", S("abcdefghijklmnopqrst"), false, true);
- test("abcdefghij", S(""), true, false);
- test("abcdefghij", S("abcde"), true, false);
- test("abcdefghij", S("abcdefghij"), true, true);
- test("abcdefghij", S("abcdefghijklmnopqrst"), false, true);
- test("abcdefghijklmnopqrst", S(""), true, false);
- test("abcdefghijklmnopqrst", S("abcde"), true, false);
- test("abcdefghijklmnopqrst", S("abcdefghij"), true, false);
- test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert ( sv1 >= "", "" );
- static_assert ( "" >= sv1, "" );
- static_assert (!(sv1 >= "abcde"), "" );
- static_assert ( "abcde" >= sv1, "" );
-
- static_assert ( sv2 >= "", "" );
- static_assert (!("" >= sv2), "" );
- static_assert ( sv2 >= "abcde", "" );
- static_assert ( "abcde" >= sv2, "" );
- static_assert (!(sv2 >= "abcde0"), "" );
- static_assert ( "abcde0" >= sv2, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp
deleted file mode 100644
index 0790f80f863c..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// bool operator>=(const basic_string<charT,traits,Allocator>& lhs,
-// basic_string_view<charT,traits> rhs);
-// bool operator>=(basic_string_view<charT,traits> lhs,
-// const basic_string<charT,traits,Allocator>& rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
-{
- assert((lhs >= rhs) == x);
- assert((rhs >= lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), "", true, true);
- test(S(""), "abcde", false, true);
- test(S(""), "abcdefghij", false, true);
- test(S(""), "abcdefghijklmnopqrst", false, true);
- test(S("abcde"), "", true, false);
- test(S("abcde"), "abcde", true, true);
- test(S("abcde"), "abcdefghij", false, true);
- test(S("abcde"), "abcdefghijklmnopqrst", false, true);
- test(S("abcdefghij"), "", true, false);
- test(S("abcdefghij"), "abcde", true, false);
- test(S("abcdefghij"), "abcdefghij", true, true);
- test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true);
- test(S("abcdefghijklmnopqrst"), "", true, false);
- test(S("abcdefghijklmnopqrst"), "abcde", true, false);
- test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false);
- test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true);
- }
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
deleted file mode 100644
index 1bacf285f4eb..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits>
-// constexpr bool operator>=(basic_string_view<charT,traits> lhs,
-// basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs >= rhs) == x);
- assert((rhs >= lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), S(""), true, true);
- test(S(""), S("abcde"), false, true);
- test(S(""), S("abcdefghij"), false, true);
- test(S(""), S("abcdefghijklmnopqrst"), false, true);
- test(S("abcde"), S(""), true, false);
- test(S("abcde"), S("abcde"), true, true);
- test(S("abcde"), S("abcdefghij"), false, true);
- test(S("abcde"), S("abcdefghijklmnopqrst"), false, true);
- test(S("abcdefghij"), S(""), true, false);
- test(S("abcdefghij"), S("abcde"), true, false);
- test(S("abcdefghij"), S("abcdefghij"), true, true);
- test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false, true);
- test(S("abcdefghijklmnopqrst"), S(""), true, false);
- test(S("abcdefghijklmnopqrst"), S("abcde"), true, false);
- test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true, false);
- test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert ( sv1 >= sv1, "" );
- static_assert ( sv2 >= sv2, "" );
-
- static_assert (!(sv1 >= sv2), "" );
- static_assert ( sv2 >= sv1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
deleted file mode 100644
index 0aae3d41a825..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// constexpr template<class charT, class traits, class Allocator>
-// bool operator>(const charT* lhs, basic_string_wiew<charT,traits> rhs);
-// constexpr template<class charT, class traits, class Allocator>
-// bool operator>(basic_string_wiew<charT,traits> lhs, const charT* rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs > rhs) == x);
- assert((rhs > lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test("", S(""), false, false);
- test("", S("abcde"), false, true);
- test("", S("abcdefghij"), false, true);
- test("", S("abcdefghijklmnopqrst"), false, true);
- test("abcde", S(""), true, false);
- test("abcde", S("abcde"), false, false);
- test("abcde", S("abcdefghij"), false, true);
- test("abcde", S("abcdefghijklmnopqrst"), false, true);
- test("abcdefghij", S(""), true, false);
- test("abcdefghij", S("abcde"), true, false);
- test("abcdefghij", S("abcdefghij"), false, false);
- test("abcdefghij", S("abcdefghijklmnopqrst"), false, true);
- test("abcdefghijklmnopqrst", S(""), true, false);
- test("abcdefghijklmnopqrst", S("abcde"), true, false);
- test("abcdefghijklmnopqrst", S("abcdefghij"), true, false);
- test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (!(sv1 > ""), "" );
- static_assert (!("" > sv1), "" );
- static_assert (!(sv1 > "abcde"), "" );
- static_assert ( "abcde" > sv1, "" );
-
- static_assert ( sv2 > "", "" );
- static_assert (!("" > sv2), "" );
- static_assert (!(sv2 > "abcde"), "" );
- static_assert (!("abcde" > sv2), "" );
- static_assert (!(sv2 > "abcde0"), "" );
- static_assert ( "abcde0" > sv2, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp
deleted file mode 100644
index 92f812f8249c..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// bool operator>(const basic_string<charT,traits,Allocator>& lhs,
-// basic_string_view<charT,traits> rhs);
-// bool operator>(basic_string_view<charT,traits> lhs,
-// const basic_string<charT,traits,Allocator>& rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
-{
- assert((lhs > rhs) == x);
- assert((rhs > lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), "", false, false);
- test(S(""), "abcde", false, true);
- test(S(""), "abcdefghij", false, true);
- test(S(""), "abcdefghijklmnopqrst", false, true);
- test(S("abcde"), "", true, false);
- test(S("abcde"), "abcde", false, false);
- test(S("abcde"), "abcdefghij", false, true);
- test(S("abcde"), "abcdefghijklmnopqrst", false, true);
- test(S("abcdefghij"), "", true, false);
- test(S("abcdefghij"), "abcde", true, false);
- test(S("abcdefghij"), "abcdefghij", false, false);
- test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true);
- test(S("abcdefghijklmnopqrst"), "", true, false);
- test(S("abcdefghijklmnopqrst"), "abcde", true, false);
- test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false);
- test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false);
- }
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
deleted file mode 100644
index e014872a613c..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits>
-// constexpr bool operator>(basic_string_view<charT,traits> lhs,
-// basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs > rhs) == x);
- assert((rhs > lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), S(""), false, false);
- test(S(""), S("abcde"), false, true);
- test(S(""), S("abcdefghij"), false, true);
- test(S(""), S("abcdefghijklmnopqrst"), false, true);
- test(S("abcde"), S(""), true, false);
- test(S("abcde"), S("abcde"), false, false);
- test(S("abcde"), S("abcdefghij"), false, true);
- test(S("abcde"), S("abcdefghijklmnopqrst"), false, true);
- test(S("abcdefghij"), S(""), true, false);
- test(S("abcdefghij"), S("abcde"), true, false);
- test(S("abcdefghij"), S("abcdefghij"), false, false);
- test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false, true);
- test(S("abcdefghijklmnopqrst"), S(""), true, false);
- test(S("abcdefghijklmnopqrst"), S("abcde"), true, false);
- test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true, false);
- test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (!(sv1 > sv1), "" );
- static_assert (!(sv2 > sv2), "" );
-
- static_assert (!(sv1 > sv2), "" );
- static_assert ( sv2 > sv1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
deleted file mode 100644
index bdc4c966fd06..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator<=(const charT* lhs, basic_string_wiew<charT,traits> rhs);
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator<=(basic_string_wiew<charT,traits> lhs, const charT* rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs <= rhs) == x);
- assert((rhs <= lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test("", S(""), true, true);
- test("", S("abcde"), true, false);
- test("", S("abcdefghij"), true, false);
- test("", S("abcdefghijklmnopqrst"), true, false);
- test("abcde", S(""), false, true);
- test("abcde", S("abcde"), true, true);
- test("abcde", S("abcdefghij"), true, false);
- test("abcde", S("abcdefghijklmnopqrst"), true, false);
- test("abcdefghij", S(""), false, true);
- test("abcdefghij", S("abcde"), false, true);
- test("abcdefghij", S("abcdefghij"), true, true);
- test("abcdefghij", S("abcdefghijklmnopqrst"), true, false);
- test("abcdefghijklmnopqrst", S(""), false, true);
- test("abcdefghijklmnopqrst", S("abcde"), false, true);
- test("abcdefghijklmnopqrst", S("abcdefghij"), false, true);
- test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert ( sv1 <= "", "" );
- static_assert ( "" <= sv1, "" );
- static_assert ( sv1 <= "abcde", "" );
- static_assert (!("abcde" <= sv1), "" );
-
- static_assert (!(sv2 <= ""), "" );
- static_assert ( "" <= sv2, "" );
- static_assert ( sv2 <= "abcde", "" );
- static_assert ( "abcde" <= sv2, "" );
- static_assert ( sv2 <= "abcde0", "" );
- static_assert (!("abcde0" <= sv2), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp
deleted file mode 100644
index 39abbd04fc5d..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// bool operator<=(const basic_string<charT,traits,Allocator>& lhs,
-// basic_string_view<charT,traits> rhs);
-// bool operator<=(basic_string_view<charT,traits> lhs,
-// const basic_string<charT,traits,Allocator>& rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
-{
- assert((lhs <= rhs) == x);
- assert((rhs <= lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), "", true, true);
- test(S(""), "abcde", true, false);
- test(S(""), "abcdefghij", true, false);
- test(S(""), "abcdefghijklmnopqrst", true, false);
- test(S("abcde"), "", false, true);
- test(S("abcde"), "abcde", true, true);
- test(S("abcde"), "abcdefghij", true, false);
- test(S("abcde"), "abcdefghijklmnopqrst", true, false);
- test(S("abcdefghij"), "", false, true);
- test(S("abcdefghij"), "abcde", false, true);
- test(S("abcdefghij"), "abcdefghij", true, true);
- test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false);
- test(S("abcdefghijklmnopqrst"), "", false, true);
- test(S("abcdefghijklmnopqrst"), "abcde", false, true);
- test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true);
- test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true);
- }
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
deleted file mode 100644
index e814283ad5b6..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits>
-// constexpr bool operator<=(basic_string_view<charT,traits> lhs,
-// basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs <= rhs) == x);
- assert((rhs <= lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), S(""), true, true);
- test(S(""), S("abcde"), true, false);
- test(S(""), S("abcdefghij"), true, false);
- test(S(""), S("abcdefghijklmnopqrst"), true, false);
- test(S("abcde"), S(""), false, true);
- test(S("abcde"), S("abcde"), true, true);
- test(S("abcde"), S("abcdefghij"), true, false);
- test(S("abcde"), S("abcdefghijklmnopqrst"), true, false);
- test(S("abcdefghij"), S(""), false, true);
- test(S("abcdefghij"), S("abcde"), false, true);
- test(S("abcdefghij"), S("abcdefghij"), true, true);
- test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true, false);
- test(S("abcdefghijklmnopqrst"), S(""), false, true);
- test(S("abcdefghijklmnopqrst"), S("abcde"), false, true);
- test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false, true);
- test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert ( sv1 <= sv1, "" );
- static_assert ( sv2 <= sv2, "" );
-
- static_assert ( sv1 <= sv2, "" );
- static_assert (!(sv2 <= sv1), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
deleted file mode 100644
index 10e82437cd6d..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator<(const charT* lhs, basic_string_wiew<charT,traits> rhs);
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator<(basic_string_wiew<charT,traits> lhs, const charT* rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs < rhs) == x);
- assert((rhs < lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test("", S(""), false, false);
- test("", S("abcde"), true, false);
- test("", S("abcdefghij"), true, false);
- test("", S("abcdefghijklmnopqrst"), true, false);
- test("abcde", S(""), false, true);
- test("abcde", S("abcde"), false, false);
- test("abcde", S("abcdefghij"), true, false);
- test("abcde", S("abcdefghijklmnopqrst"), true, false);
- test("abcdefghij", S(""), false, true);
- test("abcdefghij", S("abcde"), false, true);
- test("abcdefghij", S("abcdefghij"), false, false);
- test("abcdefghij", S("abcdefghijklmnopqrst"), true, false);
- test("abcdefghijklmnopqrst", S(""), false, true);
- test("abcdefghijklmnopqrst", S("abcde"), false, true);
- test("abcdefghijklmnopqrst", S("abcdefghij"), false, true);
- test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (!(sv1 < ""), "" );
- static_assert (!("" < sv1), "" );
- static_assert ( sv1 < "abcde", "" );
- static_assert (!("abcde" < sv1), "" );
-
- static_assert (!(sv2 < ""), "" );
- static_assert ( "" < sv2, "" );
- static_assert (!(sv2 < "abcde"), "" );
- static_assert (!("abcde" < sv2), "" );
- static_assert ( sv2 < "abcde0", "" );
- static_assert (!("abcde0" < sv2), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp
deleted file mode 100644
index 51ea639ba432..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// bool operator<(const basic_string<charT,traits,Allocator>& lhs,
-// basic_string_view<charT,traits> rhs);
-// bool operator<(basic_string_view<charT,traits> lhs,
-// const basic_string<charT,traits,Allocator>& rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
-{
- assert((lhs < rhs) == x);
- assert((rhs < lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), "", false, false);
- test(S(""), "abcde", true, false);
- test(S(""), "abcdefghij", true, false);
- test(S(""), "abcdefghijklmnopqrst", true, false);
- test(S("abcde"), "", false, true);
- test(S("abcde"), "abcde", false, false);
- test(S("abcde"), "abcdefghij", true, false);
- test(S("abcde"), "abcdefghijklmnopqrst", true, false);
- test(S("abcdefghij"), "", false, true);
- test(S("abcdefghij"), "abcde", false, true);
- test(S("abcdefghij"), "abcdefghij", false, false);
- test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false);
- test(S("abcdefghijklmnopqrst"), "", false, true);
- test(S("abcdefghijklmnopqrst"), "abcde", false, true);
- test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true);
- test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false);
- }
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
deleted file mode 100644
index 77d8fa3e5b27..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits>
-// constexpr bool operator<(basic_string_view<charT,traits> lhs,
-// basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& lhs, const S& rhs, bool x, bool y)
-{
- assert((lhs < rhs) == x);
- assert((rhs < lhs) == y);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), S(""), false, false);
- test(S(""), S("abcde"), true, false);
- test(S(""), S("abcdefghij"), true, false);
- test(S(""), S("abcdefghijklmnopqrst"), true, false);
- test(S("abcde"), S(""), false, true);
- test(S("abcde"), S("abcde"), false, false);
- test(S("abcde"), S("abcdefghij"), true, false);
- test(S("abcde"), S("abcdefghijklmnopqrst"), true, false);
- test(S("abcdefghij"), S(""), false, true);
- test(S("abcdefghij"), S("abcde"), false, true);
- test(S("abcdefghij"), S("abcdefghij"), false, false);
- test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true, false);
- test(S("abcdefghijklmnopqrst"), S(""), false, true);
- test(S("abcdefghijklmnopqrst"), S("abcde"), false, true);
- test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false, true);
- test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (!(sv1 < sv1), "" );
- static_assert (!(sv2 < sv2), "" );
-
- static_assert ( sv1 < sv2, "" );
- static_assert (!(sv2 < sv1), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
deleted file mode 100644
index 9c13199d24a7..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits>
-// constexpr bool operator!=(basic_string_view<charT,traits> lhs, const charT* rhs);
-// template<class charT, class traits>
-// constexpr bool operator!=(const charT* lhs, basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(S lhs, const typename S::value_type* rhs, bool x)
-{
- assert((lhs != rhs) == x);
- assert((rhs != lhs) == x);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), "", false);
- test(S(""), "abcde", true);
- test(S(""), "abcdefghij", true);
- test(S(""), "abcdefghijklmnopqrst", true);
- test(S("abcde"), "", true);
- test(S("abcde"), "abcde", false);
- test(S("abcde"), "abcdefghij", true);
- test(S("abcde"), "abcdefghijklmnopqrst", true);
- test(S("abcdefghij"), "", true);
- test(S("abcdefghij"), "abcde", true);
- test(S("abcdefghij"), "abcdefghij", false);
- test(S("abcdefghij"), "abcdefghijklmnopqrst", true);
- test(S("abcdefghijklmnopqrst"), "", true);
- test(S("abcdefghijklmnopqrst"), "abcde", true);
- test(S("abcdefghijklmnopqrst"), "abcdefghij", true);
- test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (!(sv1 != ""), "" );
- static_assert (!("" != sv1), "" );
- static_assert ( sv1 != "abcde", "" );
- static_assert ( "abcde" != sv1, "" );
-
- static_assert (!(sv2 != "abcde"), "" );
- static_assert (!("abcde" != sv2), "" );
- static_assert ( sv2 != "abcde0", "" );
- static_assert ( "abcde0" != sv2, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp
deleted file mode 100644
index 9ed0ac1d0fda..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// bool operator!=(const basic_string<charT, traits, Allocator> &lhs, basic_string_view<charT,traits> rhs);
-// template<class charT, class traits, class Allocator>
-// bool operator!=(basic_string_view<charT,traits> lhs, const basic_string<charT, traits, Allocator> &rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const std::string &lhs, S rhs, bool x)
-{
- assert((lhs != rhs) == x);
- assert((rhs != lhs) == x);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test("", S(""), false);
- test("", S("abcde"), true);
- test("", S("abcdefghij"), true);
- test("", S("abcdefghijklmnopqrst"), true);
- test("abcde", S(""), true);
- test("abcde", S("abcde"), false);
- test("abcde", S("abcdefghij"), true);
- test("abcde", S("abcdefghijklmnopqrst"), true);
- test("abcdefghij", S(""), true);
- test("abcdefghij", S("abcde"), true);
- test("abcdefghij", S("abcdefghij"), false);
- test("abcdefghij", S("abcdefghijklmnopqrst"), true);
- test("abcdefghijklmnopqrst", S(""), true);
- test("abcdefghijklmnopqrst", S("abcde"), true);
- test("abcdefghijklmnopqrst", S("abcdefghij"), true);
- test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false);
- }
-}
diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
deleted file mode 100644
index c74b327f14bb..000000000000
--- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// template<class charT, class traits, class Allocator>
-// constexpr bool operator!=(const basic_string_view<charT,traits> lhs,
-// const basic_string_view<charT,traits> rhs);
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(S lhs, S rhs, bool x)
-{
- assert((lhs != rhs) == x);
- assert((rhs != lhs) == x);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), S(""), false);
- test(S(""), S("abcde"), true);
- test(S(""), S("abcdefghij"), true);
- test(S(""), S("abcdefghijklmnopqrst"), true);
- test(S("abcde"), S(""), true);
- test(S("abcde"), S("abcde"), false);
- test(S("abcde"), S("abcdefghij"), true);
- test(S("abcde"), S("abcdefghijklmnopqrst"), true);
- test(S("abcdefghij"), S(""), true);
- test(S("abcdefghij"), S("abcde"), true);
- test(S("abcdefghij"), S("abcdefghij"), false);
- test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true);
- test(S("abcdefghijklmnopqrst"), S(""), true);
- test(S("abcdefghijklmnopqrst"), S("abcde"), true);
- test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true);
- test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2;
- constexpr SV sv3 { "abcde", 5 };
- static_assert (!( sv1 != sv2), "" );
- static_assert ( sv1 != sv3, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.cons/default.pass.cpp b/test/std/experimental/string.view/string.view.cons/default.pass.cpp
deleted file mode 100644
index 37df020e7ea4..000000000000
--- a/test/std/experimental/string.view/string.view.cons/default.pass.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr basic_string_view () noexcept;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename T>
-void test () {
-#if TEST_STD_VER > 11
- {
- constexpr T sv1;
- static_assert ( sv1.size() == 0, "" );
- static_assert ( sv1.empty(), "");
- }
-#endif
-
- {
- T sv1;
- assert ( sv1.size() == 0 );
- assert ( sv1.empty());
- }
-}
-
-int main () {
- typedef std::experimental::string_view string_view;
- typedef std::experimental::u16string_view u16string_view;
- typedef std::experimental::u32string_view u32string_view;
- typedef std::experimental::wstring_view wstring_view;
-
- test<string_view> ();
- test<u16string_view> ();
- test<u32string_view> ();
- test<wstring_view> ();
-
-}
diff --git a/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp
deleted file mode 100644
index a8638389e168..000000000000
--- a/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr basic_string_view(const _CharT* _s)
-// : __data (_s), __size(_Traits::length(_s)) {}
-
-
-#include <experimental/string_view>
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template<typename CharT>
-size_t StrLen ( const CharT *s ) {
- size_t retVal = 0;
- while ( *s != 0 ) { ++retVal; ++s; }
- return retVal;
- }
-
-template<typename CharT>
-void test ( const CharT *s ) {
- std::experimental::basic_string_view<CharT> sv1 ( s );
- assert ( sv1.size() == StrLen( s ));
- assert ( sv1.data() == s );
- }
-
-
-int main () {
-
- test ( "QBCDE" );
- test ( "A" );
- test ( "" );
-
- test ( L"QBCDE" );
- test ( L"A" );
- test ( L"" );
-
-#if TEST_STD_VER >= 11
- test ( u"QBCDE" );
- test ( u"A" );
- test ( u"" );
-
- test ( U"QBCDE" );
- test ( U"A" );
- test ( U"" );
-#endif
-
-#if TEST_STD_VER > 11
- {
- constexpr std::experimental::basic_string_view<char, constexpr_char_traits<char>> sv1 ( "ABCDE" );
- static_assert ( sv1.size() == 5, "");
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp
deleted file mode 100644
index c2f312daa863..000000000000
--- a/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// constexpr basic_string_view(const _CharT* _s, size_type _len)
-// : __data (_s), __size(_len) {}
-
-
-#include <experimental/string_view>
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test ( const CharT *s, size_t sz ) {
- {
- std::experimental::basic_string_view<CharT> sv1 ( s, sz );
- assert ( sv1.size() == sz );
- assert ( sv1.data() == s );
- }
-}
-
-int main () {
-
- test ( "QBCDE", 5 );
- test ( "QBCDE", 2 );
- test ( "", 0 );
-#if TEST_STD_VER > 11
- {
- constexpr const char *s = "QBCDE";
- constexpr std::experimental::basic_string_view<char> sv1 ( s, 2 );
- static_assert ( sv1.size() == 2, "" );
- static_assert ( sv1.data() == s, "" );
- }
-#endif
-
- test ( L"QBCDE", 5 );
- test ( L"QBCDE", 2 );
- test ( L"", 0 );
-#if TEST_STD_VER > 11
- {
- constexpr const wchar_t *s = L"QBCDE";
- constexpr std::experimental::basic_string_view<wchar_t> sv1 ( s, 2 );
- static_assert ( sv1.size() == 2, "" );
- static_assert ( sv1.data() == s, "" );
- }
-#endif
-
-#if TEST_STD_VER >= 11
- test ( u"QBCDE", 5 );
- test ( u"QBCDE", 2 );
- test ( u"", 0 );
-#if TEST_STD_VER > 11
- {
- constexpr const char16_t *s = u"QBCDE";
- constexpr std::experimental::basic_string_view<char16_t> sv1 ( s, 2 );
- static_assert ( sv1.size() == 2, "" );
- static_assert ( sv1.data() == s, "" );
- }
-#endif
-
- test ( U"QBCDE", 5 );
- test ( U"QBCDE", 2 );
- test ( U"", 0 );
-#if TEST_STD_VER > 11
- {
- constexpr const char32_t *s = U"QBCDE";
- constexpr std::experimental::basic_string_view<char32_t> sv1 ( s, 2 );
- static_assert ( sv1.size() == 2, "" );
- static_assert ( sv1.data() == s, "" );
- }
-#endif
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.cons/from_string.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_string.pass.cpp
deleted file mode 100644
index 4ecd2cdff9ba..000000000000
--- a/test/std/experimental/string.view/string.view.cons/from_string.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// template<class Allocator>
-// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
-
-
-#include <experimental/string_view>
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct dummy_char_traits : public std::char_traits<char> {};
-
-template<typename CharT, typename Traits>
-void test ( const std::basic_string<CharT, Traits> &str ) {
- std::experimental::basic_string_view<CharT, Traits> sv1 ( str );
- assert ( sv1.size() == str.size());
- assert ( sv1.data() == str.data());
-}
-
-int main () {
-
- test ( std::string("QBCDE") );
- test ( std::string("") );
- test ( std::string() );
-
- test ( std::wstring(L"QBCDE") );
- test ( std::wstring(L"") );
- test ( std::wstring() );
-
-#if TEST_STD_VER >= 11
- test ( std::u16string{u"QBCDE"} );
- test ( std::u16string{u""} );
- test ( std::u16string{} );
-
- test ( std::u32string{U"QBCDE"} );
- test ( std::u32string{U""} );
- test ( std::u32string{} );
-#endif
-
- test ( std::basic_string<char, dummy_char_traits>("QBCDE") );
- test ( std::basic_string<char, dummy_char_traits>("") );
- test ( std::basic_string<char, dummy_char_traits>() );
-
-}
diff --git a/test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp b/test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp
deleted file mode 100644
index 72e9dad83c84..000000000000
--- a/test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// template<class Allocator>
-// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
-
-#include <experimental/string_view>
-#include <string>
-#include <cassert>
-
-struct dummy_char_traits : public std::char_traits<char> {};
-
-int main () {
- using string_view = std::experimental::basic_string_view<char>;
- using string = std:: basic_string <char, dummy_char_traits>;
-
- {
- string s{"QBCDE"};
- string_view sv1 ( s );
- assert ( sv1.size() == s.size());
- assert ( sv1.data() == s.data());
- }
-}
diff --git a/test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp b/test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp
deleted file mode 100644
index a14e131c85aa..000000000000
--- a/test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// template<class Allocator>
-// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
-
-#include <experimental/string_view>
-#include <string>
-#include <cassert>
-
-struct dummy_char_traits : public std::char_traits<char> {};
-
-int main () {
- using string_view = std::experimental::basic_string_view<char, dummy_char_traits>;
- using string = std:: basic_string <char>;
-
- {
- string s{"QBCDE"};
- string_view sv1 ( s );
- assert ( sv1.size() == s.size());
- assert ( sv1.data() == s.data());
- }
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp
deleted file mode 100644
index fdaf8aa066f5..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find(charT c, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find(c, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x + 1 <= s.size());
-}
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type x)
-{
- assert(s.find(c) == x);
- if (x != S::npos)
- assert(0 <= x && x + 1 <= s.size());
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), 'c', 0, S::npos);
- test(S(""), 'c', 1, S::npos);
- test(S("abcde"), 'c', 0, 2);
- test(S("abcde"), 'c', 1, 2);
- test(S("abcde"), 'c', 2, 2);
- test(S("abcde"), 'c', 4, S::npos);
- test(S("abcde"), 'c', 5, S::npos);
- test(S("abcde"), 'c', 6, S::npos);
- test(S("abcdeabcde"), 'c', 0, 2);
- test(S("abcdeabcde"), 'c', 1, 2);
- test(S("abcdeabcde"), 'c', 5, 7);
- test(S("abcdeabcde"), 'c', 9, S::npos);
- test(S("abcdeabcde"), 'c', 10, S::npos);
- test(S("abcdeabcde"), 'c', 11, S::npos);
- test(S("abcdeabcdeabcdeabcde"), 'c', 0, 2);
- test(S("abcdeabcdeabcdeabcde"), 'c', 1, 2);
- test(S("abcdeabcdeabcdeabcde"), 'c', 10, 12);
- test(S("abcdeabcdeabcdeabcde"), 'c', 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), 'c', 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), 'c', 21, S::npos);
-
- test(S(""), 'c', S::npos);
- test(S("abcde"), 'c', 2);
- test(S("abcdeabcde"), 'c', 2);
- test(S("abcdeabcdeabcdeabcde"), 'c', 2);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find( 'c', 0 ) == SV::npos, "" );
- static_assert (sv1.find( 'c', 1 ) == SV::npos, "" );
- static_assert (sv2.find( 'c', 0 ) == 2, "" );
- static_assert (sv2.find( 'c', 1 ) == 2, "" );
- static_assert (sv2.find( 'c', 2 ) == 2, "" );
- static_assert (sv2.find( 'c', 3 ) == SV::npos, "" );
- static_assert (sv2.find( 'c', 4 ) == SV::npos, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
deleted file mode 100644
index 859980af2956..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_first_not_of(charT c, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_first_not_of(c, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type x)
-{
- assert(s.find_first_not_of(c) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), 'q', 0, S::npos);
- test(S(""), 'q', 1, S::npos);
- test(S("kitcj"), 'q', 0, 0);
- test(S("qkamf"), 'q', 1, 1);
- test(S("nhmko"), 'q', 2, 2);
- test(S("tpsaf"), 'q', 4, 4);
- test(S("lahfb"), 'q', 5, S::npos);
- test(S("irkhs"), 'q', 6, S::npos);
- test(S("gmfhdaipsr"), 'q', 0, 0);
- test(S("kantesmpgj"), 'q', 1, 1);
- test(S("odaftiegpm"), 'q', 5, 5);
- test(S("oknlrstdpi"), 'q', 9, 9);
- test(S("eolhfgpjqk"), 'q', 10, S::npos);
- test(S("pcdrofikas"), 'q', 11, S::npos);
- test(S("nbatdlmekrgcfqsophij"), 'q', 0, 0);
- test(S("bnrpehidofmqtcksjgla"), 'q', 1, 1);
- test(S("jdmciepkaqgotsrfnhlb"), 'q', 10, 10);
- test(S("jtdaefblsokrmhpgcnqi"), 'q', 19, 19);
- test(S("hkbgspofltajcnedqmri"), 'q', 20, S::npos);
- test(S("oselktgbcapndfjihrmq"), 'q', 21, S::npos);
-
- test(S(""), 'q', S::npos);
- test(S("q"), 'q', S::npos);
- test(S("qqq"), 'q', S::npos);
- test(S("csope"), 'q', 0);
- test(S("gfsmthlkon"), 'q', 0);
- test(S("laenfsbridchgotmkqpj"), 'q', 0);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_first_not_of( 'q', 0 ) == SV::npos, "" );
- static_assert (sv1.find_first_not_of( 'q', 1 ) == SV::npos, "" );
- static_assert (sv2.find_first_not_of( 'q', 0 ) == 0, "" );
- static_assert (sv2.find_first_not_of( 'q', 1 ) == 1, "" );
- static_assert (sv2.find_first_not_of( 'q', 5 ) == SV::npos, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
deleted file mode 100644
index 1f7ce3ef54d1..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_first_not_of(str, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type x)
-{
- assert(s.find_first_not_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, S::npos);
- test(S(""), "laenf", 0, S::npos);
- test(S(""), "pqlnkmbdjo", 0, S::npos);
- test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
- test(S(""), "", 1, S::npos);
- test(S(""), "bjaht", 1, S::npos);
- test(S(""), "hjlcmgpket", 1, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
- test(S("fodgq"), "", 0, 0);
- test(S("qanej"), "dfkap", 0, 0);
- test(S("clbao"), "ihqrfebgad", 0, 0);
- test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, S::npos);
- test(S("srdfq"), "", 1, 1);
- test(S("oemth"), "ikcrq", 1, 1);
- test(S("cdaih"), "dmajblfhsg", 1, 3);
- test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, S::npos);
- test(S("cshmd"), "", 2, 2);
- test(S("lhcdo"), "oebqi", 2, 2);
- test(S("qnsoh"), "kojhpmbsfe", 2, S::npos);
- test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, S::npos);
- test(S("fmtsp"), "", 4, 4);
- test(S("khbpm"), "aobjd", 4, 4);
- test(S("pbsji"), "pcbahntsje", 4, 4);
- test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, S::npos);
- test(S("eqmpa"), "", 5, S::npos);
- test(S("omigs"), "kocgb", 5, S::npos);
- test(S("onmje"), "fbslrjiqkm", 5, S::npos);
- test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos);
- test(S("schfa"), "", 6, S::npos);
- test(S("igdsc"), "qngpd", 6, S::npos);
- test(S("brqgo"), "rodhqklgmb", 6, S::npos);
- test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos);
- test(S("hcjitbfapl"), "", 0, 0);
- test(S("daiprenocl"), "ashjd", 0, 2);
- test(S("litpcfdghe"), "mgojkldsqh", 0, 1);
- test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, S::npos);
- test(S("qpghtfbaji"), "", 1, 1);
- test(S("gfshlcmdjr"), "nadkh", 1, 1);
- test(S("nkodajteqp"), "ofdrqmkebl", 1, 4);
- test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, S::npos);
- test(S("crnklpmegd"), "", 5, 5);
- test(S("jsbtafedoc"), "prqgn", 5, 5);
- test(S("qnmodrtkeb"), "pejafmnokr", 5, 6);
- test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, S::npos);
- test(S("lmofqdhpki"), "", 9, 9);
- test(S("hnefkqimca"), "rtjpa", 9, S::npos);
- test(S("drtasbgmfp"), "ktsrmnqagd", 9, 9);
- test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, S::npos);
- test(S("elgofjmbrq"), "", 10, S::npos);
- test(S("mjqdgalkpc"), "dplqa", 10, S::npos);
- test(S("kthqnfcerm"), "dkacjoptns", 10, S::npos);
- test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos);
- test(S("eqsgalomhb"), "", 11, S::npos);
- test(S("akiteljmoh"), "lofbc", 11, S::npos);
- test(S("hlbdfreqjo"), "astoegbfpn", 11, S::npos);
- test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos);
- test(S("snafbdlghrjkpqtoceim"), "", 0, 0);
- test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 0);
- test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 1);
- test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, S::npos);
- test(S("jlnkraeodhcspfgbqitm"), "", 1, 1);
- test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 1);
- test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 3);
- test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, S::npos);
- test(S("hdpkobnsalmcfijregtq"), "", 10, 10);
- test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 11);
- test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 13);
- test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, S::npos);
- test(S("niptglfbosehkamrdqcj"), "", 19, 19);
- test(S("copqdhstbingamjfkler"), "djkqc", 19, 19);
- test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, S::npos);
- test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, S::npos);
- test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos);
- test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, S::npos);
- test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, S::npos);
- test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos);
- test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos);
- test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, S::npos);
- test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, S::npos);
- test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), "", S::npos);
- test(S(""), "laenf", S::npos);
- test(S(""), "pqlnkmbdjo", S::npos);
- test(S(""), "qkamfogpnljdcshbreti", S::npos);
- test(S("nhmko"), "", 0);
- test(S("lahfb"), "irkhs", 0);
- test(S("gmfhd"), "kantesmpgj", 2);
- test(S("odaft"), "oknlrstdpiqmjbaghcfe", S::npos);
- test(S("eolhfgpjqk"), "", 0);
- test(S("nbatdlmekr"), "bnrpe", 2);
- test(S("jdmciepkaq"), "jtdaefblso", 2);
- test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", S::npos);
- test(S("gprdcokbnjhlsfmtieqa"), "", 0);
- test(S("qjghlnftcaismkropdeb"), "bjaht", 0);
- test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 1);
- test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_first_not_of( "", 0) == SV::npos, "" );
- static_assert (sv1.find_first_not_of( "irkhs", 0) == SV::npos, "" );
- static_assert (sv2.find_first_not_of( "", 0) == 0, "" );
- static_assert (sv2.find_first_not_of( "gfsrt", 0) == 0, "" );
- static_assert (sv2.find_first_not_of( "lecar", 0) == 1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
deleted file mode 100644
index 28255dd457f7..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type n, typename S::size_type x)
-{
- assert(s.find_first_not_of(str, pos, n) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0, S::npos);
- test(S(""), "irkhs", 0, 0, S::npos);
- test(S(""), "kante", 0, 1, S::npos);
- test(S(""), "oknlr", 0, 2, S::npos);
- test(S(""), "pcdro", 0, 4, S::npos);
- test(S(""), "bnrpe", 0, 5, S::npos);
- test(S(""), "jtdaefblso", 0, 0, S::npos);
- test(S(""), "oselktgbca", 0, 1, S::npos);
- test(S(""), "eqgaplhckj", 0, 5, S::npos);
- test(S(""), "bjahtcmnlp", 0, 9, S::npos);
- test(S(""), "hjlcmgpket", 0, 10, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
- test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
- test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
- test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
- test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
- test(S(""), "", 1, 0, S::npos);
- test(S(""), "lbtqd", 1, 0, S::npos);
- test(S(""), "tboim", 1, 1, S::npos);
- test(S(""), "slcer", 1, 2, S::npos);
- test(S(""), "cbjfs", 1, 4, S::npos);
- test(S(""), "aqibs", 1, 5, S::npos);
- test(S(""), "gtfblmqinc", 1, 0, S::npos);
- test(S(""), "mkqpbtdalg", 1, 1, S::npos);
- test(S(""), "kphatlimcd", 1, 5, S::npos);
- test(S(""), "pblasqogic", 1, 9, S::npos);
- test(S(""), "arosdhcfme", 1, 10, S::npos);
- test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
- test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
- test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
- test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
- test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
- test(S("eaint"), "", 0, 0, 0);
- test(S("binja"), "gfsrt", 0, 0, 0);
- test(S("latkm"), "pfsoc", 0, 1, 0);
- test(S("lecfr"), "tpflm", 0, 2, 0);
- test(S("eqkst"), "sgkec", 0, 4, 1);
- test(S("cdafr"), "romds", 0, 5, 0);
- test(S("prbhe"), "qhjistlgmr", 0, 0, 0);
- test(S("lbisk"), "pedfirsglo", 0, 1, 0);
- test(S("hrlpd"), "aqcoslgrmk", 0, 5, 0);
- test(S("ehmja"), "dabckmepqj", 0, 9, 1);
- test(S("mhqgd"), "pqscrjthli", 0, 10, 0);
- test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, 0);
- test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, 0);
- test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, 0);
- test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, S::npos);
- test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, S::npos);
- test(S("clrgb"), "", 1, 0, 1);
- test(S("tjmek"), "osmia", 1, 0, 1);
- test(S("bgstp"), "ckonl", 1, 1, 1);
- test(S("hstrk"), "ilcaj", 1, 2, 1);
- test(S("kmspj"), "lasiq", 1, 4, 1);
- test(S("tjboh"), "kfqmr", 1, 5, 1);
- test(S("ilbcj"), "klnitfaobg", 1, 0, 1);
- test(S("jkngf"), "gjhmdlqikp", 1, 1, 1);
- test(S("gfcql"), "skbgtahqej", 1, 5, 1);
- test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 1);
- test(S("bthpg"), "bjgfmnlkio", 1, 10, 1);
- test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, 1);
- test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, 1);
- test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 3);
- test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, S::npos);
- test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, S::npos);
- test(S("ndrhl"), "", 2, 0, 2);
- test(S("mrecp"), "otkgb", 2, 0, 2);
- test(S("qlasf"), "cqsjl", 2, 1, 2);
- test(S("smaqd"), "dpifl", 2, 2, 2);
- test(S("hjeni"), "oapht", 2, 4, 2);
- test(S("ocmfj"), "cifts", 2, 5, 2);
- test(S("hmftq"), "nmsckbgalo", 2, 0, 2);
- test(S("fklad"), "tpksqhamle", 2, 1, 2);
- test(S("dirnm"), "tpdrchmkji", 2, 5, 3);
- test(S("hrgdc"), "ijagfkblst", 2, 9, 3);
- test(S("ifakg"), "kpocsignjb", 2, 10, 2);
- test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, 2);
- test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, 2);
- test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 2);
- test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, S::npos);
- test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, S::npos);
- test(S("cjgao"), "", 4, 0, 4);
- test(S("kjplq"), "mabns", 4, 0, 4);
- test(S("herni"), "bdnrp", 4, 1, 4);
- test(S("tadrb"), "scidp", 4, 2, 4);
- test(S("pkfeo"), "agbjl", 4, 4, 4);
- test(S("hoser"), "jfmpr", 4, 5, S::npos);
- test(S("kgrsp"), "rbpefghsmj", 4, 0, 4);
- test(S("pgejb"), "apsfntdoqc", 4, 1, 4);
- test(S("thlnq"), "ndkjeisgcl", 4, 5, 4);
- test(S("nbmit"), "rnfpqatdeo", 4, 9, S::npos);
- test(S("jgmib"), "bntjlqrfik", 4, 10, S::npos);
- test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, 4);
- test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, 4);
- test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, S::npos);
- test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, S::npos);
- test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, S::npos);
- test(S("klopi"), "", 5, 0, S::npos);
- test(S("dajhn"), "psthd", 5, 0, S::npos);
- test(S("jbgno"), "rpmjd", 5, 1, S::npos);
- test(S("hkjae"), "dfsmk", 5, 2, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S("gbhqo"), "skqne", 5, 4, S::npos);
- test(S("ktdor"), "kipnf", 5, 5, S::npos);
- test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos);
- test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos);
- test(S("armql"), "pcdgltbrfj", 5, 5, S::npos);
- test(S("cdhjo"), "aekfctpirg", 5, 9, S::npos);
- test(S("jcons"), "ledihrsgpf", 5, 10, S::npos);
- test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos);
- test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos);
- test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, S::npos);
- test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, S::npos);
- test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos);
- test(S("gajqn"), "", 6, 0, S::npos);
- test(S("stedk"), "hrnat", 6, 0, S::npos);
- test(S("tjkaf"), "gsqdt", 6, 1, S::npos);
- test(S("dthpe"), "bspkd", 6, 2, S::npos);
- test(S("klhde"), "ohcmb", 6, 4, S::npos);
- test(S("bhlki"), "heatr", 6, 5, S::npos);
- test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos);
- test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos);
- test(S("dpqbr"), "lmbtdehjrn", 6, 5, S::npos);
- test(S("kdhmo"), "teqmcrlgib", 6, 9, S::npos);
- test(S("jblqp"), "njolbmspac", 6, 10, S::npos);
- test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos);
- test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos);
- test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, S::npos);
- test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos);
- test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos);
- test(S("jnkrfhotgl"), "", 0, 0, 0);
- test(S("dltjfngbko"), "rqegt", 0, 0, 0);
- test(S("bmjlpkiqde"), "dashm", 0, 1, 0);
- test(S("skrflobnqm"), "jqirk", 0, 2, 0);
- test(S("jkpldtshrm"), "rckeg", 0, 4, 0);
- test(S("ghasdbnjqo"), "jscie", 0, 5, 0);
- test(S("igrkhpbqjt"), "efsphndliq", 0, 0, 0);
- test(S("ikthdgcamf"), "gdicosleja", 0, 1, 0);
- test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 2);
- test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 4);
- test(S("itphbqsker"), "dtablcrseo", 0, 10, 0);
- test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, 0);
- test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, 0);
- test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 0);
- test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 1);
- test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, S::npos);
- test(S("shbcqnmoar"), "", 1, 0, 1);
- test(S("bdoshlmfin"), "ontrs", 1, 0, 1);
- test(S("khfrebnsgq"), "pfkna", 1, 1, 1);
- test(S("getcrsaoji"), "ekosa", 1, 2, 2);
- test(S("fjiknedcpq"), "anqhk", 1, 4, 1);
- test(S("tkejgnafrm"), "jekca", 1, 5, 4);
- test(S("jnakolqrde"), "ikemsjgacf", 1, 0, 1);
- test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, 1);
- test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 3);
- test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 1);
- test(S("cigfqkated"), "sqcflrgtim", 1, 10, 5);
- test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, 1);
- test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, 1);
- test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 5);
- test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 5);
- test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, S::npos);
- test(S("ectnhskflp"), "", 5, 0, 5);
- test(S("fgtianblpq"), "pijag", 5, 0, 5);
- test(S("mfeqklirnh"), "jrckd", 5, 1, 5);
- test(S("astedncjhk"), "qcloh", 5, 2, 5);
- test(S("fhlqgcajbr"), "thlmp", 5, 4, 5);
- test(S("epfhocmdng"), "qidmo", 5, 5, 5);
- test(S("apcnsibger"), "lnegpsjqrd", 5, 0, 5);
- test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 6);
- test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 5);
- test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 6);
- test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 5);
- test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, 5);
- test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, 5);
- test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 6);
- test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 8);
- test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, S::npos);
- test(S("shoiedtcjb"), "", 9, 0, 9);
- test(S("ebcinjgads"), "tqbnh", 9, 0, 9);
- test(S("dqmregkcfl"), "akmle", 9, 1, 9);
- test(S("ngcrieqajf"), "iqfkm", 9, 2, 9);
- test(S("qosmilgnjb"), "tqjsr", 9, 4, 9);
- test(S("ikabsjtdfl"), "jplqg", 9, 5, S::npos);
- test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, 9);
- test(S("fdnplotmgh"), "morkglpesn", 9, 1, 9);
- test(S("fdbicojerm"), "dmicerngat", 9, 5, S::npos);
- test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 9);
- test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 9);
- test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, 9);
- test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 9);
- test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 9);
- test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, S::npos);
- test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, S::npos);
- test(S("ncjpmaekbs"), "", 10, 0, S::npos);
- test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos);
- test(S("pqfhsgilen"), "qnpor", 10, 1, S::npos);
- test(S("gqtjsbdckh"), "otdma", 10, 2, S::npos);
- test(S("cfkqpjlegi"), "efhjg", 10, 4, S::npos);
- test(S("beanrfodgj"), "odpte", 10, 5, S::npos);
- test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos);
- test(S("iomkfthagj"), "oaklidrbqg", 10, 1, S::npos);
-}
-
-template <class S>
-void test2()
-{
- test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, S::npos);
- test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, S::npos);
- test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, S::npos);
- test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos);
- test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, S::npos);
- test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, S::npos);
- test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, S::npos);
- test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos);
- test(S("cqjohampgd"), "", 11, 0, S::npos);
- test(S("hobitmpsan"), "aocjb", 11, 0, S::npos);
- test(S("tjehkpsalm"), "jbrnk", 11, 1, S::npos);
- test(S("ngfbojitcl"), "tqedg", 11, 2, S::npos);
- test(S("rcfkdbhgjo"), "nqskp", 11, 4, S::npos);
- test(S("qghptonrea"), "eaqkl", 11, 5, S::npos);
- test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos);
- test(S("hlmgabenti"), "lsftgajqpm", 11, 1, S::npos);
- test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, S::npos);
- test(S("jqedtkornm"), "shkncmiaqj", 11, 9, S::npos);
- test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, S::npos);
- test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos);
- test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos);
- test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, S::npos);
- test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos);
- test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos);
- test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, 0);
- test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, 0);
- test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 0);
- test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 0);
- test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 0);
- test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 0);
- test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, 0);
- test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 0);
- test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 0);
- test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 0);
- test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 0);
- test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, 0);
- test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 0);
- test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 0);
- test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 11);
- test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, S::npos);
- test(S("febhmqtjanokscdirpgl"), "", 1, 0, 1);
- test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, 1);
- test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 1);
- test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 2);
- test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 2);
- test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 1);
- test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, 1);
- test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 1);
- test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 1);
- test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 3);
- test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 2);
- test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, 1);
- test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 1);
- test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 2);
- test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 13);
- test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, S::npos);
- test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, 10);
- test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, 10);
- test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 10);
- test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 10);
- test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 11);
- test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 10);
- test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, 10);
- test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 10);
- test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 10);
- test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 11);
- test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 10);
- test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, 10);
- test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 10);
- test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 11);
- test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 11);
- test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, S::npos);
- test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, 19);
- test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, 19);
- test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 19);
- test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 19);
- test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 19);
- test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, S::npos);
- test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, 19);
- test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 19);
- test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 19);
- test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 19);
- test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 19);
- test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, 19);
- test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 19);
- test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, S::npos);
- test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, S::npos);
- test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, S::npos);
- test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos);
- test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos);
- test(S("grkpahljcftesdmonqib"), "odife", 20, 1, S::npos);
- test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, S::npos);
- test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, S::npos);
- test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, S::npos);
- test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos);
- test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, S::npos);
- test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, S::npos);
- test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, S::npos);
- test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, S::npos);
- test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos);
-}
-
-template <class S>
-void test3()
-{
- test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, S::npos);
- test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, S::npos);
- test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, S::npos);
- test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos);
- test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos);
- test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos);
- test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, S::npos);
- test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, S::npos);
- test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, S::npos);
- test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, S::npos);
- test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos);
- test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, S::npos);
- test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, S::npos);
- test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, S::npos);
- test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, S::npos);
- test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos);
- test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, S::npos);
- test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, S::npos);
- test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, S::npos);
- test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- test2<S>();
- test3<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_first_not_of( "", 0, 0) == SV::npos, "" );
- static_assert (sv1.find_first_not_of( "irkhs", 0, 5) == SV::npos, "" );
- static_assert (sv2.find_first_not_of( "", 0, 0) == 0, "" );
- static_assert (sv2.find_first_not_of( "gfsrt", 0, 5) == 0, "" );
- static_assert (sv2.find_first_not_of( "lecar", 0, 5) == 1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
deleted file mode 100644
index 700231294092..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// size_type find_first_not_of(const basic_string& str, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
-{
- assert(s.find_first_not_of(str, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type x)
-{
- assert(s.find_first_not_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), S(""), 0, S::npos);
- test(S(""), S("laenf"), 0, S::npos);
- test(S(""), S("pqlnkmbdjo"), 0, S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
- test(S(""), S(""), 1, S::npos);
- test(S(""), S("bjaht"), 1, S::npos);
- test(S(""), S("hjlcmgpket"), 1, S::npos);
- test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
- test(S("fodgq"), S(""), 0, 0);
- test(S("qanej"), S("dfkap"), 0, 0);
- test(S("clbao"), S("ihqrfebgad"), 0, 0);
- test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, S::npos);
- test(S("srdfq"), S(""), 1, 1);
- test(S("oemth"), S("ikcrq"), 1, 1);
- test(S("cdaih"), S("dmajblfhsg"), 1, 3);
- test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, S::npos);
- test(S("cshmd"), S(""), 2, 2);
- test(S("lhcdo"), S("oebqi"), 2, 2);
- test(S("qnsoh"), S("kojhpmbsfe"), 2, S::npos);
- test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, S::npos);
- test(S("fmtsp"), S(""), 4, 4);
- test(S("khbpm"), S("aobjd"), 4, 4);
- test(S("pbsji"), S("pcbahntsje"), 4, 4);
- test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, S::npos);
- test(S("eqmpa"), S(""), 5, S::npos);
- test(S("omigs"), S("kocgb"), 5, S::npos);
- test(S("onmje"), S("fbslrjiqkm"), 5, S::npos);
- test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos);
- test(S("schfa"), S(""), 6, S::npos);
- test(S("igdsc"), S("qngpd"), 6, S::npos);
- test(S("brqgo"), S("rodhqklgmb"), 6, S::npos);
- test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos);
- test(S("hcjitbfapl"), S(""), 0, 0);
- test(S("daiprenocl"), S("ashjd"), 0, 2);
- test(S("litpcfdghe"), S("mgojkldsqh"), 0, 1);
- test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, S::npos);
- test(S("qpghtfbaji"), S(""), 1, 1);
- test(S("gfshlcmdjr"), S("nadkh"), 1, 1);
- test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 4);
- test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, S::npos);
- test(S("crnklpmegd"), S(""), 5, 5);
- test(S("jsbtafedoc"), S("prqgn"), 5, 5);
- test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 6);
- test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, S::npos);
- test(S("lmofqdhpki"), S(""), 9, 9);
- test(S("hnefkqimca"), S("rtjpa"), 9, S::npos);
- test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 9);
- test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, S::npos);
- test(S("elgofjmbrq"), S(""), 10, S::npos);
- test(S("mjqdgalkpc"), S("dplqa"), 10, S::npos);
- test(S("kthqnfcerm"), S("dkacjoptns"), 10, S::npos);
- test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos);
- test(S("eqsgalomhb"), S(""), 11, S::npos);
- test(S("akiteljmoh"), S("lofbc"), 11, S::npos);
- test(S("hlbdfreqjo"), S("astoegbfpn"), 11, S::npos);
- test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos);
- test(S("snafbdlghrjkpqtoceim"), S(""), 0, 0);
- test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 0);
- test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 1);
- test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, S::npos);
- test(S("jlnkraeodhcspfgbqitm"), S(""), 1, 1);
- test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 1);
- test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 3);
- test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, S::npos);
- test(S("hdpkobnsalmcfijregtq"), S(""), 10, 10);
- test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 11);
- test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 13);
- test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, S::npos);
- test(S("niptglfbosehkamrdqcj"), S(""), 19, 19);
- test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 19);
- test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, S::npos);
- test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, S::npos);
- test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos);
- test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, S::npos);
- test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, S::npos);
- test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos);
- test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos);
- test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, S::npos);
- test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, S::npos);
- test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), S(""), S::npos);
- test(S(""), S("laenf"), S::npos);
- test(S(""), S("pqlnkmbdjo"), S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
- test(S("nhmko"), S(""), 0);
- test(S("lahfb"), S("irkhs"), 0);
- test(S("gmfhd"), S("kantesmpgj"), 2);
- test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), S::npos);
- test(S("eolhfgpjqk"), S(""), 0);
- test(S("nbatdlmekr"), S("bnrpe"), 2);
- test(S("jdmciepkaq"), S("jtdaefblso"), 2);
- test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), S::npos);
- test(S("gprdcokbnjhlsfmtieqa"), S(""), 0);
- test(S("qjghlnftcaismkropdeb"), S("bjaht"), 0);
- test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 1);
- test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp
deleted file mode 100644
index ffafcfc04481..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// constexpr size_type find_first_of(charT c, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_first_of(c, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type x)
-{
- assert(s.find_first_of(c) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), 'e', 0, S::npos);
- test(S(""), 'e', 1, S::npos);
- test(S("kitcj"), 'e', 0, S::npos);
- test(S("qkamf"), 'e', 1, S::npos);
- test(S("nhmko"), 'e', 2, S::npos);
- test(S("tpsaf"), 'e', 4, S::npos);
- test(S("lahfb"), 'e', 5, S::npos);
- test(S("irkhs"), 'e', 6, S::npos);
- test(S("gmfhdaipsr"), 'e', 0, S::npos);
- test(S("kantesmpgj"), 'e', 1, 4);
- test(S("odaftiegpm"), 'e', 5, 6);
- test(S("oknlrstdpi"), 'e', 9, S::npos);
- test(S("eolhfgpjqk"), 'e', 10, S::npos);
- test(S("pcdrofikas"), 'e', 11, S::npos);
- test(S("nbatdlmekrgcfqsophij"), 'e', 0, 7);
- test(S("bnrpehidofmqtcksjgla"), 'e', 1, 4);
- test(S("jdmciepkaqgotsrfnhlb"), 'e', 10, S::npos);
- test(S("jtdaefblsokrmhpgcnqi"), 'e', 19, S::npos);
- test(S("hkbgspofltajcnedqmri"), 'e', 20, S::npos);
- test(S("oselktgbcapndfjihrmq"), 'e', 21, S::npos);
-
- test(S(""), 'e', S::npos);
- test(S("csope"), 'e', 4);
- test(S("gfsmthlkon"), 'e', S::npos);
- test(S("laenfsbridchgotmkqpj"), 'e', 2);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_first_of( 'e', 0 ) == SV::npos, "" );
- static_assert (sv1.find_first_of( 'e', 1 ) == SV::npos, "" );
- static_assert (sv2.find_first_of( 'q', 0 ) == SV::npos, "" );
- static_assert (sv2.find_first_of( 'e', 1 ) == 4, "" );
- static_assert (sv2.find_first_of( 'e', 5 ) == SV::npos, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
deleted file mode 100644
index 7b37fe057213..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_first_of(str, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type x)
-{
- assert(s.find_first_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, S::npos);
- test(S(""), "laenf", 0, S::npos);
- test(S(""), "pqlnkmbdjo", 0, S::npos);
- test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
- test(S(""), "", 1, S::npos);
- test(S(""), "bjaht", 1, S::npos);
- test(S(""), "hjlcmgpket", 1, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
- test(S("fodgq"), "", 0, S::npos);
- test(S("qanej"), "dfkap", 0, 1);
- test(S("clbao"), "ihqrfebgad", 0, 2);
- test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, 0);
- test(S("srdfq"), "", 1, S::npos);
- test(S("oemth"), "ikcrq", 1, S::npos);
- test(S("cdaih"), "dmajblfhsg", 1, 1);
- test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, 1);
- test(S("cshmd"), "", 2, S::npos);
- test(S("lhcdo"), "oebqi", 2, 4);
- test(S("qnsoh"), "kojhpmbsfe", 2, 2);
- test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, 2);
- test(S("fmtsp"), "", 4, S::npos);
- test(S("khbpm"), "aobjd", 4, S::npos);
- test(S("pbsji"), "pcbahntsje", 4, S::npos);
- test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, 4);
- test(S("eqmpa"), "", 5, S::npos);
- test(S("omigs"), "kocgb", 5, S::npos);
- test(S("onmje"), "fbslrjiqkm", 5, S::npos);
- test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos);
- test(S("schfa"), "", 6, S::npos);
- test(S("igdsc"), "qngpd", 6, S::npos);
- test(S("brqgo"), "rodhqklgmb", 6, S::npos);
- test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos);
- test(S("hcjitbfapl"), "", 0, S::npos);
- test(S("daiprenocl"), "ashjd", 0, 0);
- test(S("litpcfdghe"), "mgojkldsqh", 0, 0);
- test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, 0);
- test(S("qpghtfbaji"), "", 1, S::npos);
- test(S("gfshlcmdjr"), "nadkh", 1, 3);
- test(S("nkodajteqp"), "ofdrqmkebl", 1, 1);
- test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, 1);
- test(S("crnklpmegd"), "", 5, S::npos);
- test(S("jsbtafedoc"), "prqgn", 5, S::npos);
- test(S("qnmodrtkeb"), "pejafmnokr", 5, 5);
- test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, 5);
- test(S("lmofqdhpki"), "", 9, S::npos);
- test(S("hnefkqimca"), "rtjpa", 9, 9);
- test(S("drtasbgmfp"), "ktsrmnqagd", 9, S::npos);
- test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, 9);
- test(S("elgofjmbrq"), "", 10, S::npos);
- test(S("mjqdgalkpc"), "dplqa", 10, S::npos);
- test(S("kthqnfcerm"), "dkacjoptns", 10, S::npos);
- test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos);
- test(S("eqsgalomhb"), "", 11, S::npos);
- test(S("akiteljmoh"), "lofbc", 11, S::npos);
- test(S("hlbdfreqjo"), "astoegbfpn", 11, S::npos);
- test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos);
- test(S("snafbdlghrjkpqtoceim"), "", 0, S::npos);
- test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 3);
- test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 0);
- test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, 0);
- test(S("jlnkraeodhcspfgbqitm"), "", 1, S::npos);
- test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 3);
- test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 1);
- test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, 1);
- test(S("hdpkobnsalmcfijregtq"), "", 10, S::npos);
- test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 10);
- test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 10);
- test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, 10);
- test(S("niptglfbosehkamrdqcj"), "", 19, S::npos);
- test(S("copqdhstbingamjfkler"), "djkqc", 19, S::npos);
- test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 19);
- test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, 19);
- test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos);
- test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, S::npos);
- test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, S::npos);
- test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos);
- test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos);
- test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, S::npos);
- test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, S::npos);
- test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), "", S::npos);
- test(S(""), "laenf", S::npos);
- test(S(""), "pqlnkmbdjo", S::npos);
- test(S(""), "qkamfogpnljdcshbreti", S::npos);
- test(S("nhmko"), "", S::npos);
- test(S("lahfb"), "irkhs", 2);
- test(S("gmfhd"), "kantesmpgj", 0);
- test(S("odaft"), "oknlrstdpiqmjbaghcfe", 0);
- test(S("eolhfgpjqk"), "", S::npos);
- test(S("nbatdlmekr"), "bnrpe", 0);
- test(S("jdmciepkaq"), "jtdaefblso", 0);
- test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", 0);
- test(S("gprdcokbnjhlsfmtieqa"), "", S::npos);
- test(S("qjghlnftcaismkropdeb"), "bjaht", 1);
- test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 0);
- test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_first_of( "", 0) == SV::npos, "" );
- static_assert (sv1.find_first_of( "irkhs", 0) == SV::npos, "" );
- static_assert (sv2.find_first_of( "", 0) == SV::npos, "" );
- static_assert (sv2.find_first_of( "gfsrt", 0) == SV::npos, "" );
- static_assert (sv2.find_first_of( "lecar", 0) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
deleted file mode 100644
index 1f7ea383a589..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type n, typename S::size_type x)
-{
- assert(s.find_first_of(str, pos, n) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0, S::npos);
- test(S(""), "irkhs", 0, 0, S::npos);
- test(S(""), "kante", 0, 1, S::npos);
- test(S(""), "oknlr", 0, 2, S::npos);
- test(S(""), "pcdro", 0, 4, S::npos);
- test(S(""), "bnrpe", 0, 5, S::npos);
- test(S(""), "jtdaefblso", 0, 0, S::npos);
- test(S(""), "oselktgbca", 0, 1, S::npos);
- test(S(""), "eqgaplhckj", 0, 5, S::npos);
- test(S(""), "bjahtcmnlp", 0, 9, S::npos);
- test(S(""), "hjlcmgpket", 0, 10, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
- test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
- test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
- test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
- test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
- test(S(""), "", 1, 0, S::npos);
- test(S(""), "lbtqd", 1, 0, S::npos);
- test(S(""), "tboim", 1, 1, S::npos);
- test(S(""), "slcer", 1, 2, S::npos);
- test(S(""), "cbjfs", 1, 4, S::npos);
- test(S(""), "aqibs", 1, 5, S::npos);
- test(S(""), "gtfblmqinc", 1, 0, S::npos);
- test(S(""), "mkqpbtdalg", 1, 1, S::npos);
- test(S(""), "kphatlimcd", 1, 5, S::npos);
- test(S(""), "pblasqogic", 1, 9, S::npos);
- test(S(""), "arosdhcfme", 1, 10, S::npos);
- test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
- test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
- test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
- test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
- test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
- test(S("eaint"), "", 0, 0, S::npos);
- test(S("binja"), "gfsrt", 0, 0, S::npos);
- test(S("latkm"), "pfsoc", 0, 1, S::npos);
- test(S("lecfr"), "tpflm", 0, 2, S::npos);
- test(S("eqkst"), "sgkec", 0, 4, 0);
- test(S("cdafr"), "romds", 0, 5, 1);
- test(S("prbhe"), "qhjistlgmr", 0, 0, S::npos);
- test(S("lbisk"), "pedfirsglo", 0, 1, S::npos);
- test(S("hrlpd"), "aqcoslgrmk", 0, 5, S::npos);
- test(S("ehmja"), "dabckmepqj", 0, 9, 0);
- test(S("mhqgd"), "pqscrjthli", 0, 10, 1);
- test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, S::npos);
- test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, S::npos);
- test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, S::npos);
- test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, 0);
- test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, 0);
- test(S("clrgb"), "", 1, 0, S::npos);
- test(S("tjmek"), "osmia", 1, 0, S::npos);
- test(S("bgstp"), "ckonl", 1, 1, S::npos);
- test(S("hstrk"), "ilcaj", 1, 2, S::npos);
- test(S("kmspj"), "lasiq", 1, 4, 2);
- test(S("tjboh"), "kfqmr", 1, 5, S::npos);
- test(S("ilbcj"), "klnitfaobg", 1, 0, S::npos);
- test(S("jkngf"), "gjhmdlqikp", 1, 1, 3);
- test(S("gfcql"), "skbgtahqej", 1, 5, S::npos);
- test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 2);
- test(S("bthpg"), "bjgfmnlkio", 1, 10, 4);
- test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, S::npos);
- test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, S::npos);
- test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 1);
- test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, 1);
- test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, 1);
- test(S("ndrhl"), "", 2, 0, S::npos);
- test(S("mrecp"), "otkgb", 2, 0, S::npos);
- test(S("qlasf"), "cqsjl", 2, 1, S::npos);
- test(S("smaqd"), "dpifl", 2, 2, 4);
- test(S("hjeni"), "oapht", 2, 4, S::npos);
- test(S("ocmfj"), "cifts", 2, 5, 3);
- test(S("hmftq"), "nmsckbgalo", 2, 0, S::npos);
- test(S("fklad"), "tpksqhamle", 2, 1, S::npos);
- test(S("dirnm"), "tpdrchmkji", 2, 5, 2);
- test(S("hrgdc"), "ijagfkblst", 2, 9, 2);
- test(S("ifakg"), "kpocsignjb", 2, 10, 3);
- test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, S::npos);
- test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, S::npos);
- test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 3);
- test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, 2);
- test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, 2);
- test(S("cjgao"), "", 4, 0, S::npos);
- test(S("kjplq"), "mabns", 4, 0, S::npos);
- test(S("herni"), "bdnrp", 4, 1, S::npos);
- test(S("tadrb"), "scidp", 4, 2, S::npos);
- test(S("pkfeo"), "agbjl", 4, 4, S::npos);
- test(S("hoser"), "jfmpr", 4, 5, 4);
- test(S("kgrsp"), "rbpefghsmj", 4, 0, S::npos);
- test(S("pgejb"), "apsfntdoqc", 4, 1, S::npos);
- test(S("thlnq"), "ndkjeisgcl", 4, 5, S::npos);
- test(S("nbmit"), "rnfpqatdeo", 4, 9, 4);
- test(S("jgmib"), "bntjlqrfik", 4, 10, 4);
- test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, S::npos);
- test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, S::npos);
- test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 4);
- test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 4);
- test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, 4);
- test(S("klopi"), "", 5, 0, S::npos);
- test(S("dajhn"), "psthd", 5, 0, S::npos);
- test(S("jbgno"), "rpmjd", 5, 1, S::npos);
- test(S("hkjae"), "dfsmk", 5, 2, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S("gbhqo"), "skqne", 5, 4, S::npos);
- test(S("ktdor"), "kipnf", 5, 5, S::npos);
- test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos);
- test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos);
- test(S("armql"), "pcdgltbrfj", 5, 5, S::npos);
- test(S("cdhjo"), "aekfctpirg", 5, 9, S::npos);
- test(S("jcons"), "ledihrsgpf", 5, 10, S::npos);
- test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos);
- test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos);
- test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, S::npos);
- test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, S::npos);
- test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos);
- test(S("gajqn"), "", 6, 0, S::npos);
- test(S("stedk"), "hrnat", 6, 0, S::npos);
- test(S("tjkaf"), "gsqdt", 6, 1, S::npos);
- test(S("dthpe"), "bspkd", 6, 2, S::npos);
- test(S("klhde"), "ohcmb", 6, 4, S::npos);
- test(S("bhlki"), "heatr", 6, 5, S::npos);
- test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos);
- test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos);
- test(S("dpqbr"), "lmbtdehjrn", 6, 5, S::npos);
- test(S("kdhmo"), "teqmcrlgib", 6, 9, S::npos);
- test(S("jblqp"), "njolbmspac", 6, 10, S::npos);
- test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos);
- test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos);
- test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, S::npos);
- test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos);
- test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos);
- test(S("jnkrfhotgl"), "", 0, 0, S::npos);
- test(S("dltjfngbko"), "rqegt", 0, 0, S::npos);
- test(S("bmjlpkiqde"), "dashm", 0, 1, 8);
- test(S("skrflobnqm"), "jqirk", 0, 2, 8);
- test(S("jkpldtshrm"), "rckeg", 0, 4, 1);
- test(S("ghasdbnjqo"), "jscie", 0, 5, 3);
- test(S("igrkhpbqjt"), "efsphndliq", 0, 0, S::npos);
- test(S("ikthdgcamf"), "gdicosleja", 0, 1, 5);
- test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 0);
- test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 0);
- test(S("itphbqsker"), "dtablcrseo", 0, 10, 1);
- test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, S::npos);
- test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, S::npos);
- test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 4);
- test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 0);
- test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, 0);
- test(S("shbcqnmoar"), "", 1, 0, S::npos);
- test(S("bdoshlmfin"), "ontrs", 1, 0, S::npos);
- test(S("khfrebnsgq"), "pfkna", 1, 1, S::npos);
- test(S("getcrsaoji"), "ekosa", 1, 2, 1);
- test(S("fjiknedcpq"), "anqhk", 1, 4, 4);
- test(S("tkejgnafrm"), "jekca", 1, 5, 1);
- test(S("jnakolqrde"), "ikemsjgacf", 1, 0, S::npos);
- test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, S::npos);
- test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 1);
- test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 4);
- test(S("cigfqkated"), "sqcflrgtim", 1, 10, 1);
- test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, S::npos);
- test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, S::npos);
- test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 1);
- test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 1);
- test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, 1);
- test(S("ectnhskflp"), "", 5, 0, S::npos);
- test(S("fgtianblpq"), "pijag", 5, 0, S::npos);
- test(S("mfeqklirnh"), "jrckd", 5, 1, S::npos);
- test(S("astedncjhk"), "qcloh", 5, 2, 6);
- test(S("fhlqgcajbr"), "thlmp", 5, 4, S::npos);
- test(S("epfhocmdng"), "qidmo", 5, 5, 6);
- test(S("apcnsibger"), "lnegpsjqrd", 5, 0, S::npos);
- test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 5);
- test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 7);
- test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 5);
- test(S("jbhcfposld"), "trfqgmckbe", 5, 10, S::npos);
- test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, S::npos);
- test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, S::npos);
- test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 5);
- test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 5);
- test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, 5);
- test(S("shoiedtcjb"), "", 9, 0, S::npos);
- test(S("ebcinjgads"), "tqbnh", 9, 0, S::npos);
- test(S("dqmregkcfl"), "akmle", 9, 1, S::npos);
- test(S("ngcrieqajf"), "iqfkm", 9, 2, S::npos);
- test(S("qosmilgnjb"), "tqjsr", 9, 4, S::npos);
- test(S("ikabsjtdfl"), "jplqg", 9, 5, 9);
- test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, S::npos);
- test(S("fdnplotmgh"), "morkglpesn", 9, 1, S::npos);
- test(S("fdbicojerm"), "dmicerngat", 9, 5, 9);
- test(S("mbtafndjcq"), "radgeskbtc", 9, 9, S::npos);
- test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, S::npos);
- test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, S::npos);
- test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, S::npos);
- test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, S::npos);
- test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 9);
- test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, 9);
- test(S("ncjpmaekbs"), "", 10, 0, S::npos);
- test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos);
- test(S("pqfhsgilen"), "qnpor", 10, 1, S::npos);
- test(S("gqtjsbdckh"), "otdma", 10, 2, S::npos);
- test(S("cfkqpjlegi"), "efhjg", 10, 4, S::npos);
- test(S("beanrfodgj"), "odpte", 10, 5, S::npos);
- test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos);
- test(S("iomkfthagj"), "oaklidrbqg", 10, 1, S::npos);
-}
-
-template <class S>
-void test2()
-{
- test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, S::npos);
- test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, S::npos);
- test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, S::npos);
- test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos);
- test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, S::npos);
- test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, S::npos);
- test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, S::npos);
- test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos);
- test(S("cqjohampgd"), "", 11, 0, S::npos);
- test(S("hobitmpsan"), "aocjb", 11, 0, S::npos);
- test(S("tjehkpsalm"), "jbrnk", 11, 1, S::npos);
- test(S("ngfbojitcl"), "tqedg", 11, 2, S::npos);
- test(S("rcfkdbhgjo"), "nqskp", 11, 4, S::npos);
- test(S("qghptonrea"), "eaqkl", 11, 5, S::npos);
- test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos);
- test(S("hlmgabenti"), "lsftgajqpm", 11, 1, S::npos);
- test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, S::npos);
- test(S("jqedtkornm"), "shkncmiaqj", 11, 9, S::npos);
- test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, S::npos);
- test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos);
- test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos);
- test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, S::npos);
- test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos);
- test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos);
- test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, S::npos);
- test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, S::npos);
- test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 4);
- test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 3);
- test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 3);
- test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 3);
- test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, S::npos);
- test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 19);
- test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 2);
- test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 2);
- test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 2);
- test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, S::npos);
- test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 16);
- test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 1);
- test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 0);
- test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, 0);
- test(S("febhmqtjanokscdirpgl"), "", 1, 0, S::npos);
- test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, S::npos);
- test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 6);
- test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 1);
- test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 1);
- test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 6);
- test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, S::npos);
- test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 19);
- test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 4);
- test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 1);
- test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 1);
- test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, S::npos);
- test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 7);
- test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 1);
- test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 1);
- test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, 1);
- test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, S::npos);
- test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, S::npos);
- test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 12);
- test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, S::npos);
- test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 10);
- test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 15);
- test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, S::npos);
- test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, S::npos);
- test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 11);
- test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 10);
- test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 11);
- test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, S::npos);
- test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 18);
- test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 10);
- test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 10);
- test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, 10);
- test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, S::npos);
- test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, S::npos);
- test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, S::npos);
- test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, S::npos);
- test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, S::npos);
- test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 19);
- test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, S::npos);
- test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, S::npos);
- test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, S::npos);
- test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, S::npos);
- test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, S::npos);
- test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, S::npos);
- test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, S::npos);
- test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 19);
- test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 19);
- test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, 19);
- test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos);
- test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos);
- test(S("grkpahljcftesdmonqib"), "odife", 20, 1, S::npos);
- test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, S::npos);
- test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, S::npos);
- test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, S::npos);
- test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos);
- test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, S::npos);
- test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, S::npos);
- test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, S::npos);
- test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, S::npos);
- test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos);
-}
-
-template <class S>
-void test3()
-{
- test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, S::npos);
- test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, S::npos);
- test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, S::npos);
- test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos);
- test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos);
- test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos);
- test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, S::npos);
- test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, S::npos);
- test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, S::npos);
- test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, S::npos);
- test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos);
- test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, S::npos);
- test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, S::npos);
- test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, S::npos);
- test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, S::npos);
- test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos);
- test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, S::npos);
- test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, S::npos);
- test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, S::npos);
- test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- test2<S>();
- test3<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_first_of( "", 0, 0) == SV::npos, "" );
- static_assert (sv1.find_first_of( "irkhs", 0, 5) == SV::npos, "" );
- static_assert (sv2.find_first_of( "", 0, 0) == SV::npos, "" );
- static_assert (sv2.find_first_of( "gfsrt", 0, 5) == SV::npos, "" );
- static_assert (sv2.find_first_of( "lecar", 0, 5) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
deleted file mode 100644
index fddd47171dd8..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// size_type find_first_of(const basic_string_view& str, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
-{
- assert(s.find_first_of(str, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type x)
-{
- assert(s.find_first_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), S(""), 0, S::npos);
- test(S(""), S("laenf"), 0, S::npos);
- test(S(""), S("pqlnkmbdjo"), 0, S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
- test(S(""), S(""), 1, S::npos);
- test(S(""), S("bjaht"), 1, S::npos);
- test(S(""), S("hjlcmgpket"), 1, S::npos);
- test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
- test(S("fodgq"), S(""), 0, S::npos);
- test(S("qanej"), S("dfkap"), 0, 1);
- test(S("clbao"), S("ihqrfebgad"), 0, 2);
- test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, 0);
- test(S("srdfq"), S(""), 1, S::npos);
- test(S("oemth"), S("ikcrq"), 1, S::npos);
- test(S("cdaih"), S("dmajblfhsg"), 1, 1);
- test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, 1);
- test(S("cshmd"), S(""), 2, S::npos);
- test(S("lhcdo"), S("oebqi"), 2, 4);
- test(S("qnsoh"), S("kojhpmbsfe"), 2, 2);
- test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, 2);
- test(S("fmtsp"), S(""), 4, S::npos);
- test(S("khbpm"), S("aobjd"), 4, S::npos);
- test(S("pbsji"), S("pcbahntsje"), 4, S::npos);
- test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, 4);
- test(S("eqmpa"), S(""), 5, S::npos);
- test(S("omigs"), S("kocgb"), 5, S::npos);
- test(S("onmje"), S("fbslrjiqkm"), 5, S::npos);
- test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos);
- test(S("schfa"), S(""), 6, S::npos);
- test(S("igdsc"), S("qngpd"), 6, S::npos);
- test(S("brqgo"), S("rodhqklgmb"), 6, S::npos);
- test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos);
- test(S("hcjitbfapl"), S(""), 0, S::npos);
- test(S("daiprenocl"), S("ashjd"), 0, 0);
- test(S("litpcfdghe"), S("mgojkldsqh"), 0, 0);
- test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, 0);
- test(S("qpghtfbaji"), S(""), 1, S::npos);
- test(S("gfshlcmdjr"), S("nadkh"), 1, 3);
- test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 1);
- test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, 1);
- test(S("crnklpmegd"), S(""), 5, S::npos);
- test(S("jsbtafedoc"), S("prqgn"), 5, S::npos);
- test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 5);
- test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, 5);
- test(S("lmofqdhpki"), S(""), 9, S::npos);
- test(S("hnefkqimca"), S("rtjpa"), 9, 9);
- test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, S::npos);
- test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, 9);
- test(S("elgofjmbrq"), S(""), 10, S::npos);
- test(S("mjqdgalkpc"), S("dplqa"), 10, S::npos);
- test(S("kthqnfcerm"), S("dkacjoptns"), 10, S::npos);
- test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos);
- test(S("eqsgalomhb"), S(""), 11, S::npos);
- test(S("akiteljmoh"), S("lofbc"), 11, S::npos);
- test(S("hlbdfreqjo"), S("astoegbfpn"), 11, S::npos);
- test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos);
- test(S("snafbdlghrjkpqtoceim"), S(""), 0, S::npos);
- test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 3);
- test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 0);
- test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, 0);
- test(S("jlnkraeodhcspfgbqitm"), S(""), 1, S::npos);
- test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 3);
- test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 1);
- test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, 1);
- test(S("hdpkobnsalmcfijregtq"), S(""), 10, S::npos);
- test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 10);
- test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 10);
- test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, 10);
- test(S("niptglfbosehkamrdqcj"), S(""), 19, S::npos);
- test(S("copqdhstbingamjfkler"), S("djkqc"), 19, S::npos);
- test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 19);
- test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, 19);
- test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos);
- test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, S::npos);
- test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, S::npos);
- test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos);
- test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos);
- test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, S::npos);
- test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, S::npos);
- test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), S(""), S::npos);
- test(S(""), S("laenf"), S::npos);
- test(S(""), S("pqlnkmbdjo"), S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
- test(S("nhmko"), S(""), S::npos);
- test(S("lahfb"), S("irkhs"), 2);
- test(S("gmfhd"), S("kantesmpgj"), 0);
- test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), 0);
- test(S("eolhfgpjqk"), S(""), S::npos);
- test(S("nbatdlmekr"), S("bnrpe"), 0);
- test(S("jdmciepkaq"), S("jtdaefblso"), 0);
- test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), 0);
- test(S("gprdcokbnjhlsfmtieqa"), S(""), S::npos);
- test(S("qjghlnftcaismkropdeb"), S("bjaht"), 1);
- test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 0);
- test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
deleted file mode 100644
index 307be23708b3..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// const size_type find_last_not_of(charT c, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_last_not_of(c, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type x)
-{
- assert(s.find_last_not_of(c) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), 'i', 0, S::npos);
- test(S(""), 'i', 1, S::npos);
- test(S("kitcj"), 'i', 0, 0);
- test(S("qkamf"), 'i', 1, 1);
- test(S("nhmko"), 'i', 2, 2);
- test(S("tpsaf"), 'i', 4, 4);
- test(S("lahfb"), 'i', 5, 4);
- test(S("irkhs"), 'i', 6, 4);
- test(S("gmfhdaipsr"), 'i', 0, 0);
- test(S("kantesmpgj"), 'i', 1, 1);
- test(S("odaftiegpm"), 'i', 5, 4);
- test(S("oknlrstdpi"), 'i', 9, 8);
- test(S("eolhfgpjqk"), 'i', 10, 9);
- test(S("pcdrofikas"), 'i', 11, 9);
- test(S("nbatdlmekrgcfqsophij"), 'i', 0, 0);
- test(S("bnrpehidofmqtcksjgla"), 'i', 1, 1);
- test(S("jdmciepkaqgotsrfnhlb"), 'i', 10, 10);
- test(S("jtdaefblsokrmhpgcnqi"), 'i', 19, 18);
- test(S("hkbgspofltajcnedqmri"), 'i', 20, 18);
- test(S("oselktgbcapndfjihrmq"), 'i', 21, 19);
-
- test(S(""), 'i', S::npos);
- test(S("csope"), 'i', 4);
- test(S("gfsmthlkon"), 'i', 9);
- test(S("laenfsbridchgotmkqpj"), 'i', 19);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_last_not_of( 'i', 0 ) == SV::npos, "" );
- static_assert (sv1.find_last_not_of( 'i', 1 ) == SV::npos, "" );
- static_assert (sv2.find_last_not_of( 'a', 0 ) == SV::npos, "" );
- static_assert (sv2.find_last_not_of( 'a', 1 ) == 1, "" );
- static_assert (sv2.find_last_not_of( 'e', 5 ) == 3, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
deleted file mode 100644
index b0d3f0636b21..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_last_not_of(str, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type x)
-{
- assert(s.find_last_not_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, S::npos);
- test(S(""), "laenf", 0, S::npos);
- test(S(""), "pqlnkmbdjo", 0, S::npos);
- test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
- test(S(""), "", 1, S::npos);
- test(S(""), "bjaht", 1, S::npos);
- test(S(""), "hjlcmgpket", 1, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
- test(S("fodgq"), "", 0, 0);
- test(S("qanej"), "dfkap", 0, 0);
- test(S("clbao"), "ihqrfebgad", 0, 0);
- test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, S::npos);
- test(S("srdfq"), "", 1, 1);
- test(S("oemth"), "ikcrq", 1, 1);
- test(S("cdaih"), "dmajblfhsg", 1, 0);
- test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, S::npos);
- test(S("cshmd"), "", 2, 2);
- test(S("lhcdo"), "oebqi", 2, 2);
- test(S("qnsoh"), "kojhpmbsfe", 2, 1);
- test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, S::npos);
- test(S("fmtsp"), "", 4, 4);
- test(S("khbpm"), "aobjd", 4, 4);
- test(S("pbsji"), "pcbahntsje", 4, 4);
- test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, S::npos);
- test(S("eqmpa"), "", 5, 4);
- test(S("omigs"), "kocgb", 5, 4);
- test(S("onmje"), "fbslrjiqkm", 5, 4);
- test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos);
- test(S("schfa"), "", 6, 4);
- test(S("igdsc"), "qngpd", 6, 4);
- test(S("brqgo"), "rodhqklgmb", 6, S::npos);
- test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos);
- test(S("hcjitbfapl"), "", 0, 0);
- test(S("daiprenocl"), "ashjd", 0, S::npos);
- test(S("litpcfdghe"), "mgojkldsqh", 0, S::npos);
- test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, S::npos);
- test(S("qpghtfbaji"), "", 1, 1);
- test(S("gfshlcmdjr"), "nadkh", 1, 1);
- test(S("nkodajteqp"), "ofdrqmkebl", 1, 0);
- test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, S::npos);
- test(S("crnklpmegd"), "", 5, 5);
- test(S("jsbtafedoc"), "prqgn", 5, 5);
- test(S("qnmodrtkeb"), "pejafmnokr", 5, 4);
- test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, S::npos);
- test(S("lmofqdhpki"), "", 9, 9);
- test(S("hnefkqimca"), "rtjpa", 9, 8);
- test(S("drtasbgmfp"), "ktsrmnqagd", 9, 9);
- test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, S::npos);
- test(S("elgofjmbrq"), "", 10, 9);
- test(S("mjqdgalkpc"), "dplqa", 10, 9);
- test(S("kthqnfcerm"), "dkacjoptns", 10, 9);
- test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos);
- test(S("eqsgalomhb"), "", 11, 9);
- test(S("akiteljmoh"), "lofbc", 11, 9);
- test(S("hlbdfreqjo"), "astoegbfpn", 11, 8);
- test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos);
- test(S("snafbdlghrjkpqtoceim"), "", 0, 0);
- test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 0);
- test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, S::npos);
- test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, S::npos);
- test(S("jlnkraeodhcspfgbqitm"), "", 1, 1);
- test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 1);
- test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 0);
- test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, S::npos);
- test(S("hdpkobnsalmcfijregtq"), "", 10, 10);
- test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 9);
- test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 9);
- test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, S::npos);
- test(S("niptglfbosehkamrdqcj"), "", 19, 19);
- test(S("copqdhstbingamjfkler"), "djkqc", 19, 19);
- test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 16);
- test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, S::npos);
- test(S("eaintpchlqsbdgrkjofm"), "", 20, 19);
- test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, 18);
- test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, 19);
- test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos);
- test(S("liatsqdoegkmfcnbhrpj"), "", 21, 19);
- test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, 19);
- test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, 19);
- test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), "", S::npos);
- test(S(""), "laenf", S::npos);
- test(S(""), "pqlnkmbdjo", S::npos);
- test(S(""), "qkamfogpnljdcshbreti", S::npos);
- test(S("nhmko"), "", 4);
- test(S("lahfb"), "irkhs", 4);
- test(S("gmfhd"), "kantesmpgj", 4);
- test(S("odaft"), "oknlrstdpiqmjbaghcfe", S::npos);
- test(S("eolhfgpjqk"), "", 9);
- test(S("nbatdlmekr"), "bnrpe", 8);
- test(S("jdmciepkaq"), "jtdaefblso", 9);
- test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", S::npos);
- test(S("gprdcokbnjhlsfmtieqa"), "", 19);
- test(S("qjghlnftcaismkropdeb"), "bjaht", 18);
- test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 17);
- test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_last_not_of( "", 0) == SV::npos, "" );
- static_assert (sv1.find_last_not_of( "irkhs", 5) == SV::npos, "" );
- static_assert (sv2.find_last_not_of( "", 0) == 0, "" );
- static_assert (sv2.find_last_not_of( "gfsrt", 5) == 4, "" );
- static_assert (sv2.find_last_not_of( "lecar", 5) == 3, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
deleted file mode 100644
index 8a591ccbe44a..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type n, typename S::size_type x)
-{
- assert(s.find_last_not_of(str, pos, n) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0, S::npos);
- test(S(""), "irkhs", 0, 0, S::npos);
- test(S(""), "kante", 0, 1, S::npos);
- test(S(""), "oknlr", 0, 2, S::npos);
- test(S(""), "pcdro", 0, 4, S::npos);
- test(S(""), "bnrpe", 0, 5, S::npos);
- test(S(""), "jtdaefblso", 0, 0, S::npos);
- test(S(""), "oselktgbca", 0, 1, S::npos);
- test(S(""), "eqgaplhckj", 0, 5, S::npos);
- test(S(""), "bjahtcmnlp", 0, 9, S::npos);
- test(S(""), "hjlcmgpket", 0, 10, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
- test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
- test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
- test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
- test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
- test(S(""), "", 1, 0, S::npos);
- test(S(""), "lbtqd", 1, 0, S::npos);
- test(S(""), "tboim", 1, 1, S::npos);
- test(S(""), "slcer", 1, 2, S::npos);
- test(S(""), "cbjfs", 1, 4, S::npos);
- test(S(""), "aqibs", 1, 5, S::npos);
- test(S(""), "gtfblmqinc", 1, 0, S::npos);
- test(S(""), "mkqpbtdalg", 1, 1, S::npos);
- test(S(""), "kphatlimcd", 1, 5, S::npos);
- test(S(""), "pblasqogic", 1, 9, S::npos);
- test(S(""), "arosdhcfme", 1, 10, S::npos);
- test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
- test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
- test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
- test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
- test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
- test(S("eaint"), "", 0, 0, 0);
- test(S("binja"), "gfsrt", 0, 0, 0);
- test(S("latkm"), "pfsoc", 0, 1, 0);
- test(S("lecfr"), "tpflm", 0, 2, 0);
- test(S("eqkst"), "sgkec", 0, 4, S::npos);
- test(S("cdafr"), "romds", 0, 5, 0);
- test(S("prbhe"), "qhjistlgmr", 0, 0, 0);
- test(S("lbisk"), "pedfirsglo", 0, 1, 0);
- test(S("hrlpd"), "aqcoslgrmk", 0, 5, 0);
- test(S("ehmja"), "dabckmepqj", 0, 9, S::npos);
- test(S("mhqgd"), "pqscrjthli", 0, 10, 0);
- test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, 0);
- test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, 0);
- test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, 0);
- test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, S::npos);
- test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, S::npos);
- test(S("clrgb"), "", 1, 0, 1);
- test(S("tjmek"), "osmia", 1, 0, 1);
- test(S("bgstp"), "ckonl", 1, 1, 1);
- test(S("hstrk"), "ilcaj", 1, 2, 1);
- test(S("kmspj"), "lasiq", 1, 4, 1);
- test(S("tjboh"), "kfqmr", 1, 5, 1);
- test(S("ilbcj"), "klnitfaobg", 1, 0, 1);
- test(S("jkngf"), "gjhmdlqikp", 1, 1, 1);
- test(S("gfcql"), "skbgtahqej", 1, 5, 1);
- test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 1);
- test(S("bthpg"), "bjgfmnlkio", 1, 10, 1);
- test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, 1);
- test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, 1);
- test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, S::npos);
- test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, S::npos);
- test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, S::npos);
- test(S("ndrhl"), "", 2, 0, 2);
- test(S("mrecp"), "otkgb", 2, 0, 2);
- test(S("qlasf"), "cqsjl", 2, 1, 2);
- test(S("smaqd"), "dpifl", 2, 2, 2);
- test(S("hjeni"), "oapht", 2, 4, 2);
- test(S("ocmfj"), "cifts", 2, 5, 2);
- test(S("hmftq"), "nmsckbgalo", 2, 0, 2);
- test(S("fklad"), "tpksqhamle", 2, 1, 2);
- test(S("dirnm"), "tpdrchmkji", 2, 5, 1);
- test(S("hrgdc"), "ijagfkblst", 2, 9, 1);
- test(S("ifakg"), "kpocsignjb", 2, 10, 2);
- test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, 2);
- test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, 2);
- test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 2);
- test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, S::npos);
- test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, S::npos);
- test(S("cjgao"), "", 4, 0, 4);
- test(S("kjplq"), "mabns", 4, 0, 4);
- test(S("herni"), "bdnrp", 4, 1, 4);
- test(S("tadrb"), "scidp", 4, 2, 4);
- test(S("pkfeo"), "agbjl", 4, 4, 4);
- test(S("hoser"), "jfmpr", 4, 5, 3);
- test(S("kgrsp"), "rbpefghsmj", 4, 0, 4);
- test(S("pgejb"), "apsfntdoqc", 4, 1, 4);
- test(S("thlnq"), "ndkjeisgcl", 4, 5, 4);
- test(S("nbmit"), "rnfpqatdeo", 4, 9, 3);
- test(S("jgmib"), "bntjlqrfik", 4, 10, 2);
- test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, 4);
- test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, 4);
- test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 3);
- test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 2);
- test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, S::npos);
- test(S("klopi"), "", 5, 0, 4);
- test(S("dajhn"), "psthd", 5, 0, 4);
- test(S("jbgno"), "rpmjd", 5, 1, 4);
- test(S("hkjae"), "dfsmk", 5, 2, 4);
-}
-
-template <class S>
-void test1()
-{
- test(S("gbhqo"), "skqne", 5, 4, 4);
- test(S("ktdor"), "kipnf", 5, 5, 4);
- test(S("ldprn"), "hmrnqdgifl", 5, 0, 4);
- test(S("egmjk"), "fsmjcdairn", 5, 1, 4);
- test(S("armql"), "pcdgltbrfj", 5, 5, 3);
- test(S("cdhjo"), "aekfctpirg", 5, 9, 4);
- test(S("jcons"), "ledihrsgpf", 5, 10, 3);
- test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, 4);
- test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, 4);
- test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, 1);
- test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, 2);
- test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos);
- test(S("gajqn"), "", 6, 0, 4);
- test(S("stedk"), "hrnat", 6, 0, 4);
- test(S("tjkaf"), "gsqdt", 6, 1, 4);
- test(S("dthpe"), "bspkd", 6, 2, 4);
- test(S("klhde"), "ohcmb", 6, 4, 4);
- test(S("bhlki"), "heatr", 6, 5, 4);
- test(S("lqmoh"), "pmblckedfn", 6, 0, 4);
- test(S("mtqin"), "aceqmsrbik", 6, 1, 4);
- test(S("dpqbr"), "lmbtdehjrn", 6, 5, 4);
- test(S("kdhmo"), "teqmcrlgib", 6, 9, 4);
- test(S("jblqp"), "njolbmspac", 6, 10, 3);
- test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, 4);
- test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, 4);
- test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, 1);
- test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos);
- test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos);
- test(S("jnkrfhotgl"), "", 0, 0, 0);
- test(S("dltjfngbko"), "rqegt", 0, 0, 0);
- test(S("bmjlpkiqde"), "dashm", 0, 1, 0);
- test(S("skrflobnqm"), "jqirk", 0, 2, 0);
- test(S("jkpldtshrm"), "rckeg", 0, 4, 0);
- test(S("ghasdbnjqo"), "jscie", 0, 5, 0);
- test(S("igrkhpbqjt"), "efsphndliq", 0, 0, 0);
- test(S("ikthdgcamf"), "gdicosleja", 0, 1, 0);
- test(S("pcofgeniam"), "qcpjibosfl", 0, 5, S::npos);
- test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, S::npos);
- test(S("itphbqsker"), "dtablcrseo", 0, 10, 0);
- test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, 0);
- test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, 0);
- test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 0);
- test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, S::npos);
- test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, S::npos);
- test(S("shbcqnmoar"), "", 1, 0, 1);
- test(S("bdoshlmfin"), "ontrs", 1, 0, 1);
- test(S("khfrebnsgq"), "pfkna", 1, 1, 1);
- test(S("getcrsaoji"), "ekosa", 1, 2, 0);
- test(S("fjiknedcpq"), "anqhk", 1, 4, 1);
- test(S("tkejgnafrm"), "jekca", 1, 5, 0);
- test(S("jnakolqrde"), "ikemsjgacf", 1, 0, 1);
- test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, 1);
- test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 0);
- test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 1);
- test(S("cigfqkated"), "sqcflrgtim", 1, 10, S::npos);
- test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, 1);
- test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, 1);
- test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, S::npos);
- test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, S::npos);
- test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, S::npos);
- test(S("ectnhskflp"), "", 5, 0, 5);
- test(S("fgtianblpq"), "pijag", 5, 0, 5);
- test(S("mfeqklirnh"), "jrckd", 5, 1, 5);
- test(S("astedncjhk"), "qcloh", 5, 2, 5);
- test(S("fhlqgcajbr"), "thlmp", 5, 4, 5);
- test(S("epfhocmdng"), "qidmo", 5, 5, 5);
- test(S("apcnsibger"), "lnegpsjqrd", 5, 0, 5);
- test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 4);
- test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 5);
- test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 3);
- test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 5);
- test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, 5);
- test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, 5);
- test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 1);
- test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, S::npos);
- test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, S::npos);
- test(S("shoiedtcjb"), "", 9, 0, 9);
- test(S("ebcinjgads"), "tqbnh", 9, 0, 9);
- test(S("dqmregkcfl"), "akmle", 9, 1, 9);
- test(S("ngcrieqajf"), "iqfkm", 9, 2, 9);
- test(S("qosmilgnjb"), "tqjsr", 9, 4, 9);
- test(S("ikabsjtdfl"), "jplqg", 9, 5, 8);
- test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, 9);
- test(S("fdnplotmgh"), "morkglpesn", 9, 1, 9);
- test(S("fdbicojerm"), "dmicerngat", 9, 5, 8);
- test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 9);
- test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 9);
- test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, 9);
- test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 9);
- test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 9);
- test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 3);
- test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, S::npos);
- test(S("ncjpmaekbs"), "", 10, 0, 9);
- test(S("hlbosgmrak"), "hpmsd", 10, 0, 9);
- test(S("pqfhsgilen"), "qnpor", 10, 1, 9);
- test(S("gqtjsbdckh"), "otdma", 10, 2, 9);
- test(S("cfkqpjlegi"), "efhjg", 10, 4, 9);
- test(S("beanrfodgj"), "odpte", 10, 5, 9);
- test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, 9);
- test(S("iomkfthagj"), "oaklidrbqg", 10, 1, 9);
-}
-
-template <class S>
-void test2()
-{
- test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, 8);
- test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, 9);
- test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, 8);
- test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, 9);
- test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, 9);
- test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, 7);
- test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, 5);
- test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos);
- test(S("cqjohampgd"), "", 11, 0, 9);
- test(S("hobitmpsan"), "aocjb", 11, 0, 9);
- test(S("tjehkpsalm"), "jbrnk", 11, 1, 9);
- test(S("ngfbojitcl"), "tqedg", 11, 2, 9);
- test(S("rcfkdbhgjo"), "nqskp", 11, 4, 9);
- test(S("qghptonrea"), "eaqkl", 11, 5, 7);
- test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, 9);
- test(S("hlmgabenti"), "lsftgajqpm", 11, 1, 9);
- test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, 9);
- test(S("jqedtkornm"), "shkncmiaqj", 11, 9, 7);
- test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, 8);
- test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, 9);
- test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, 9);
- test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, 8);
- test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos);
- test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos);
- test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, 0);
- test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, 0);
- test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 0);
- test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 0);
- test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 0);
- test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 0);
- test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, 0);
- test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 0);
- test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 0);
- test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 0);
- test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 0);
- test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, 0);
- test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 0);
- test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 0);
- test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, S::npos);
- test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, S::npos);
- test(S("febhmqtjanokscdirpgl"), "", 1, 0, 1);
- test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, 1);
- test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 1);
- test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 0);
- test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 0);
- test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 1);
- test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, 1);
- test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 1);
- test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 1);
- test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 0);
- test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 0);
- test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, 1);
- test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 1);
- test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 0);
- test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, S::npos);
- test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, S::npos);
- test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, 10);
- test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, 10);
- test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 10);
- test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 10);
- test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 9);
- test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 10);
- test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, 10);
- test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 10);
- test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 10);
- test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 8);
- test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 10);
- test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, 10);
- test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 10);
- test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 8);
- test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, S::npos);
- test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, S::npos);
- test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, 19);
- test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, 19);
- test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 19);
- test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 19);
- test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 19);
- test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 17);
- test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, 19);
- test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 19);
- test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 19);
- test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 19);
- test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 19);
- test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, 19);
- test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 19);
- test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 18);
- test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 7);
- test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, S::npos);
- test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, 19);
- test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, 19);
- test(S("grkpahljcftesdmonqib"), "odife", 20, 1, 19);
- test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, 19);
- test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, 18);
- test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, 18);
- test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, 19);
- test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, 19);
- test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, 18);
- test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, 18);
- test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, 17);
- test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, 19);
-}
-
-template <class S>
-void test3()
-{
- test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, 19);
- test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, 19);
- test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, 1);
- test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos);
- test(S("ecgdanriptblhjfqskom"), "", 21, 0, 19);
- test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, 19);
- test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, 19);
- test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, 19);
- test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, 19);
- test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, 19);
- test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, 19);
- test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, 19);
- test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, 18);
- test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, 19);
- test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, 19);
- test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, 19);
- test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, 19);
- test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, 19);
- test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, 7);
- test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- test2<S>();
- test3<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_last_not_of( "", 0, 0) == SV::npos, "" );
- static_assert (sv1.find_last_not_of( "irkhs", 0, 5) == SV::npos, "" );
- static_assert (sv2.find_last_not_of( "", 0, 0) == 0, "" );
- static_assert (sv2.find_last_not_of( "gfsrt", 5, 0) == 4, "" );
- static_assert (sv2.find_last_not_of( "lecar", 5, 0) == 4, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
deleted file mode 100644
index 40c867d6b46c..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// size_type find_last_not_of(const basic_string& str, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
-{
- assert(s.find_last_not_of(str, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type x)
-{
- assert(s.find_last_not_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), S(""), 0, S::npos);
- test(S(""), S("laenf"), 0, S::npos);
- test(S(""), S("pqlnkmbdjo"), 0, S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
- test(S(""), S(""), 1, S::npos);
- test(S(""), S("bjaht"), 1, S::npos);
- test(S(""), S("hjlcmgpket"), 1, S::npos);
- test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
- test(S("fodgq"), S(""), 0, 0);
- test(S("qanej"), S("dfkap"), 0, 0);
- test(S("clbao"), S("ihqrfebgad"), 0, 0);
- test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, S::npos);
- test(S("srdfq"), S(""), 1, 1);
- test(S("oemth"), S("ikcrq"), 1, 1);
- test(S("cdaih"), S("dmajblfhsg"), 1, 0);
- test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, S::npos);
- test(S("cshmd"), S(""), 2, 2);
- test(S("lhcdo"), S("oebqi"), 2, 2);
- test(S("qnsoh"), S("kojhpmbsfe"), 2, 1);
- test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, S::npos);
- test(S("fmtsp"), S(""), 4, 4);
- test(S("khbpm"), S("aobjd"), 4, 4);
- test(S("pbsji"), S("pcbahntsje"), 4, 4);
- test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, S::npos);
- test(S("eqmpa"), S(""), 5, 4);
- test(S("omigs"), S("kocgb"), 5, 4);
- test(S("onmje"), S("fbslrjiqkm"), 5, 4);
- test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos);
- test(S("schfa"), S(""), 6, 4);
- test(S("igdsc"), S("qngpd"), 6, 4);
- test(S("brqgo"), S("rodhqklgmb"), 6, S::npos);
- test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos);
- test(S("hcjitbfapl"), S(""), 0, 0);
- test(S("daiprenocl"), S("ashjd"), 0, S::npos);
- test(S("litpcfdghe"), S("mgojkldsqh"), 0, S::npos);
- test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, S::npos);
- test(S("qpghtfbaji"), S(""), 1, 1);
- test(S("gfshlcmdjr"), S("nadkh"), 1, 1);
- test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 0);
- test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, S::npos);
- test(S("crnklpmegd"), S(""), 5, 5);
- test(S("jsbtafedoc"), S("prqgn"), 5, 5);
- test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 4);
- test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, S::npos);
- test(S("lmofqdhpki"), S(""), 9, 9);
- test(S("hnefkqimca"), S("rtjpa"), 9, 8);
- test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 9);
- test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, S::npos);
- test(S("elgofjmbrq"), S(""), 10, 9);
- test(S("mjqdgalkpc"), S("dplqa"), 10, 9);
- test(S("kthqnfcerm"), S("dkacjoptns"), 10, 9);
- test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos);
- test(S("eqsgalomhb"), S(""), 11, 9);
- test(S("akiteljmoh"), S("lofbc"), 11, 9);
- test(S("hlbdfreqjo"), S("astoegbfpn"), 11, 8);
- test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos);
- test(S("snafbdlghrjkpqtoceim"), S(""), 0, 0);
- test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 0);
- test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, S::npos);
- test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, S::npos);
- test(S("jlnkraeodhcspfgbqitm"), S(""), 1, 1);
- test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 1);
- test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 0);
- test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, S::npos);
- test(S("hdpkobnsalmcfijregtq"), S(""), 10, 10);
- test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 9);
- test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 9);
- test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, S::npos);
- test(S("niptglfbosehkamrdqcj"), S(""), 19, 19);
- test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 19);
- test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 16);
- test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, S::npos);
- test(S("eaintpchlqsbdgrkjofm"), S(""), 20, 19);
- test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, 18);
- test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, 19);
- test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos);
- test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, 19);
- test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, 19);
- test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, 19);
- test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), S(""), S::npos);
- test(S(""), S("laenf"), S::npos);
- test(S(""), S("pqlnkmbdjo"), S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
- test(S("nhmko"), S(""), 4);
- test(S("lahfb"), S("irkhs"), 4);
- test(S("gmfhd"), S("kantesmpgj"), 4);
- test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), S::npos);
- test(S("eolhfgpjqk"), S(""), 9);
- test(S("nbatdlmekr"), S("bnrpe"), 8);
- test(S("jdmciepkaq"), S("jtdaefblso"), 9);
- test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), S::npos);
- test(S("gprdcokbnjhlsfmtieqa"), S(""), 19);
- test(S("qjghlnftcaismkropdeb"), S("bjaht"), 18);
- test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 17);
- test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp
deleted file mode 100644
index b949eec1b3c3..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_last_of(charT c, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_last_of(c, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type x)
-{
- assert(s.find_last_of(c) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), 'm', 0, S::npos);
- test(S(""), 'm', 1, S::npos);
- test(S("kitcj"), 'm', 0, S::npos);
- test(S("qkamf"), 'm', 1, S::npos);
- test(S("nhmko"), 'm', 2, 2);
- test(S("tpsaf"), 'm', 4, S::npos);
- test(S("lahfb"), 'm', 5, S::npos);
- test(S("irkhs"), 'm', 6, S::npos);
- test(S("gmfhdaipsr"), 'm', 0, S::npos);
- test(S("kantesmpgj"), 'm', 1, S::npos);
- test(S("odaftiegpm"), 'm', 5, S::npos);
- test(S("oknlrstdpi"), 'm', 9, S::npos);
- test(S("eolhfgpjqk"), 'm', 10, S::npos);
- test(S("pcdrofikas"), 'm', 11, S::npos);
- test(S("nbatdlmekrgcfqsophij"), 'm', 0, S::npos);
- test(S("bnrpehidofmqtcksjgla"), 'm', 1, S::npos);
- test(S("jdmciepkaqgotsrfnhlb"), 'm', 10, 2);
- test(S("jtdaefblsokrmhpgcnqi"), 'm', 19, 12);
- test(S("hkbgspofltajcnedqmri"), 'm', 20, 17);
- test(S("oselktgbcapndfjihrmq"), 'm', 21, 18);
-
- test(S(""), 'm', S::npos);
- test(S("csope"), 'm', S::npos);
- test(S("gfsmthlkon"), 'm', 3);
- test(S("laenfsbridchgotmkqpj"), 'm', 15);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_last_of( 'i', 0 ) == SV::npos, "" );
- static_assert (sv1.find_last_of( 'i', 1 ) == SV::npos, "" );
- static_assert (sv2.find_last_of( 'a', 0 ) == 0, "" );
- static_assert (sv2.find_last_of( 'a', 1 ) == 0, "" );
- static_assert (sv2.find_last_of( 'e', 5 ) == 4, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
deleted file mode 100644
index 3755b2653d19..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find_last_of(str, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type x)
-{
- assert(s.find_last_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, S::npos);
- test(S(""), "laenf", 0, S::npos);
- test(S(""), "pqlnkmbdjo", 0, S::npos);
- test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
- test(S(""), "", 1, S::npos);
- test(S(""), "bjaht", 1, S::npos);
- test(S(""), "hjlcmgpket", 1, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
- test(S("fodgq"), "", 0, S::npos);
- test(S("qanej"), "dfkap", 0, S::npos);
- test(S("clbao"), "ihqrfebgad", 0, S::npos);
- test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, 0);
- test(S("srdfq"), "", 1, S::npos);
- test(S("oemth"), "ikcrq", 1, S::npos);
- test(S("cdaih"), "dmajblfhsg", 1, 1);
- test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, 1);
- test(S("cshmd"), "", 2, S::npos);
- test(S("lhcdo"), "oebqi", 2, S::npos);
- test(S("qnsoh"), "kojhpmbsfe", 2, 2);
- test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, 2);
- test(S("fmtsp"), "", 4, S::npos);
- test(S("khbpm"), "aobjd", 4, 2);
- test(S("pbsji"), "pcbahntsje", 4, 3);
- test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, 4);
- test(S("eqmpa"), "", 5, S::npos);
- test(S("omigs"), "kocgb", 5, 3);
- test(S("onmje"), "fbslrjiqkm", 5, 3);
- test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, 4);
- test(S("schfa"), "", 6, S::npos);
- test(S("igdsc"), "qngpd", 6, 2);
- test(S("brqgo"), "rodhqklgmb", 6, 4);
- test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, 4);
- test(S("hcjitbfapl"), "", 0, S::npos);
- test(S("daiprenocl"), "ashjd", 0, 0);
- test(S("litpcfdghe"), "mgojkldsqh", 0, 0);
- test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, 0);
- test(S("qpghtfbaji"), "", 1, S::npos);
- test(S("gfshlcmdjr"), "nadkh", 1, S::npos);
- test(S("nkodajteqp"), "ofdrqmkebl", 1, 1);
- test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, 1);
- test(S("crnklpmegd"), "", 5, S::npos);
- test(S("jsbtafedoc"), "prqgn", 5, S::npos);
- test(S("qnmodrtkeb"), "pejafmnokr", 5, 5);
- test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, 5);
- test(S("lmofqdhpki"), "", 9, S::npos);
- test(S("hnefkqimca"), "rtjpa", 9, 9);
- test(S("drtasbgmfp"), "ktsrmnqagd", 9, 7);
- test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, 9);
- test(S("elgofjmbrq"), "", 10, S::npos);
- test(S("mjqdgalkpc"), "dplqa", 10, 8);
- test(S("kthqnfcerm"), "dkacjoptns", 10, 6);
- test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, 9);
- test(S("eqsgalomhb"), "", 11, S::npos);
- test(S("akiteljmoh"), "lofbc", 11, 8);
- test(S("hlbdfreqjo"), "astoegbfpn", 11, 9);
- test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, 9);
- test(S("snafbdlghrjkpqtoceim"), "", 0, S::npos);
- test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, S::npos);
- test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 0);
- test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, 0);
- test(S("jlnkraeodhcspfgbqitm"), "", 1, S::npos);
- test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, S::npos);
- test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 1);
- test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, 1);
- test(S("hdpkobnsalmcfijregtq"), "", 10, S::npos);
- test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 10);
- test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 10);
- test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, 10);
- test(S("niptglfbosehkamrdqcj"), "", 19, S::npos);
- test(S("copqdhstbingamjfkler"), "djkqc", 19, 16);
- test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 19);
- test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, 19);
- test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos);
- test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, 19);
- test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, 18);
- test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, 19);
- test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos);
- test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, 12);
- test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, 17);
- test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, 19);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), "", S::npos);
- test(S(""), "laenf", S::npos);
- test(S(""), "pqlnkmbdjo", S::npos);
- test(S(""), "qkamfogpnljdcshbreti", S::npos);
- test(S("nhmko"), "", S::npos);
- test(S("lahfb"), "irkhs", 2);
- test(S("gmfhd"), "kantesmpgj", 1);
- test(S("odaft"), "oknlrstdpiqmjbaghcfe", 4);
- test(S("eolhfgpjqk"), "", S::npos);
- test(S("nbatdlmekr"), "bnrpe", 9);
- test(S("jdmciepkaq"), "jtdaefblso", 8);
- test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", 9);
- test(S("gprdcokbnjhlsfmtieqa"), "", S::npos);
- test(S("qjghlnftcaismkropdeb"), "bjaht", 19);
- test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 19);
- test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", 19);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_last_of( "", 0) == SV::npos, "" );
- static_assert (sv1.find_last_of( "irkhs", 5) == SV::npos, "" );
- static_assert (sv2.find_last_of( "", 0) == SV::npos, "" );
- static_assert (sv2.find_last_of( "gfsrt", 5) == SV::npos, "" );
- static_assert (sv2.find_last_of( "lecar", 5) == 4, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
deleted file mode 100644
index 64b29ec7da6f..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type n, typename S::size_type x)
-{
- assert(s.find_last_of(str, pos, n) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0, S::npos);
- test(S(""), "irkhs", 0, 0, S::npos);
- test(S(""), "kante", 0, 1, S::npos);
- test(S(""), "oknlr", 0, 2, S::npos);
- test(S(""), "pcdro", 0, 4, S::npos);
- test(S(""), "bnrpe", 0, 5, S::npos);
- test(S(""), "jtdaefblso", 0, 0, S::npos);
- test(S(""), "oselktgbca", 0, 1, S::npos);
- test(S(""), "eqgaplhckj", 0, 5, S::npos);
- test(S(""), "bjahtcmnlp", 0, 9, S::npos);
- test(S(""), "hjlcmgpket", 0, 10, S::npos);
- test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
- test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
- test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
- test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
- test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
- test(S(""), "", 1, 0, S::npos);
- test(S(""), "lbtqd", 1, 0, S::npos);
- test(S(""), "tboim", 1, 1, S::npos);
- test(S(""), "slcer", 1, 2, S::npos);
- test(S(""), "cbjfs", 1, 4, S::npos);
- test(S(""), "aqibs", 1, 5, S::npos);
- test(S(""), "gtfblmqinc", 1, 0, S::npos);
- test(S(""), "mkqpbtdalg", 1, 1, S::npos);
- test(S(""), "kphatlimcd", 1, 5, S::npos);
- test(S(""), "pblasqogic", 1, 9, S::npos);
- test(S(""), "arosdhcfme", 1, 10, S::npos);
- test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
- test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
- test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
- test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
- test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
- test(S("eaint"), "", 0, 0, S::npos);
- test(S("binja"), "gfsrt", 0, 0, S::npos);
- test(S("latkm"), "pfsoc", 0, 1, S::npos);
- test(S("lecfr"), "tpflm", 0, 2, S::npos);
- test(S("eqkst"), "sgkec", 0, 4, 0);
- test(S("cdafr"), "romds", 0, 5, S::npos);
- test(S("prbhe"), "qhjistlgmr", 0, 0, S::npos);
- test(S("lbisk"), "pedfirsglo", 0, 1, S::npos);
- test(S("hrlpd"), "aqcoslgrmk", 0, 5, S::npos);
- test(S("ehmja"), "dabckmepqj", 0, 9, 0);
- test(S("mhqgd"), "pqscrjthli", 0, 10, S::npos);
- test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, S::npos);
- test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, S::npos);
- test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, S::npos);
- test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, 0);
- test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, 0);
- test(S("clrgb"), "", 1, 0, S::npos);
- test(S("tjmek"), "osmia", 1, 0, S::npos);
- test(S("bgstp"), "ckonl", 1, 1, S::npos);
- test(S("hstrk"), "ilcaj", 1, 2, S::npos);
- test(S("kmspj"), "lasiq", 1, 4, S::npos);
- test(S("tjboh"), "kfqmr", 1, 5, S::npos);
- test(S("ilbcj"), "klnitfaobg", 1, 0, S::npos);
- test(S("jkngf"), "gjhmdlqikp", 1, 1, S::npos);
- test(S("gfcql"), "skbgtahqej", 1, 5, 0);
- test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 0);
- test(S("bthpg"), "bjgfmnlkio", 1, 10, 0);
- test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, S::npos);
- test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, S::npos);
- test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 1);
- test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, 1);
- test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, 1);
- test(S("ndrhl"), "", 2, 0, S::npos);
- test(S("mrecp"), "otkgb", 2, 0, S::npos);
- test(S("qlasf"), "cqsjl", 2, 1, S::npos);
- test(S("smaqd"), "dpifl", 2, 2, S::npos);
- test(S("hjeni"), "oapht", 2, 4, 0);
- test(S("ocmfj"), "cifts", 2, 5, 1);
- test(S("hmftq"), "nmsckbgalo", 2, 0, S::npos);
- test(S("fklad"), "tpksqhamle", 2, 1, S::npos);
- test(S("dirnm"), "tpdrchmkji", 2, 5, 2);
- test(S("hrgdc"), "ijagfkblst", 2, 9, 2);
- test(S("ifakg"), "kpocsignjb", 2, 10, 0);
- test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, S::npos);
- test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, S::npos);
- test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 1);
- test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, 2);
- test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, 2);
- test(S("cjgao"), "", 4, 0, S::npos);
- test(S("kjplq"), "mabns", 4, 0, S::npos);
- test(S("herni"), "bdnrp", 4, 1, S::npos);
- test(S("tadrb"), "scidp", 4, 2, S::npos);
- test(S("pkfeo"), "agbjl", 4, 4, S::npos);
- test(S("hoser"), "jfmpr", 4, 5, 4);
- test(S("kgrsp"), "rbpefghsmj", 4, 0, S::npos);
- test(S("pgejb"), "apsfntdoqc", 4, 1, S::npos);
- test(S("thlnq"), "ndkjeisgcl", 4, 5, 3);
- test(S("nbmit"), "rnfpqatdeo", 4, 9, 4);
- test(S("jgmib"), "bntjlqrfik", 4, 10, 4);
- test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, S::npos);
- test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, S::npos);
- test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 4);
- test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 4);
- test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, 4);
- test(S("klopi"), "", 5, 0, S::npos);
- test(S("dajhn"), "psthd", 5, 0, S::npos);
- test(S("jbgno"), "rpmjd", 5, 1, S::npos);
- test(S("hkjae"), "dfsmk", 5, 2, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S("gbhqo"), "skqne", 5, 4, 3);
- test(S("ktdor"), "kipnf", 5, 5, 0);
- test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos);
- test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos);
- test(S("armql"), "pcdgltbrfj", 5, 5, 4);
- test(S("cdhjo"), "aekfctpirg", 5, 9, 0);
- test(S("jcons"), "ledihrsgpf", 5, 10, 4);
- test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos);
- test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos);
- test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, 4);
- test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, 4);
- test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, 4);
- test(S("gajqn"), "", 6, 0, S::npos);
- test(S("stedk"), "hrnat", 6, 0, S::npos);
- test(S("tjkaf"), "gsqdt", 6, 1, S::npos);
- test(S("dthpe"), "bspkd", 6, 2, S::npos);
- test(S("klhde"), "ohcmb", 6, 4, 2);
- test(S("bhlki"), "heatr", 6, 5, 1);
- test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos);
- test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos);
- test(S("dpqbr"), "lmbtdehjrn", 6, 5, 3);
- test(S("kdhmo"), "teqmcrlgib", 6, 9, 3);
- test(S("jblqp"), "njolbmspac", 6, 10, 4);
- test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos);
- test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos);
- test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, 4);
- test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, 4);
- test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, 4);
- test(S("jnkrfhotgl"), "", 0, 0, S::npos);
- test(S("dltjfngbko"), "rqegt", 0, 0, S::npos);
- test(S("bmjlpkiqde"), "dashm", 0, 1, S::npos);
- test(S("skrflobnqm"), "jqirk", 0, 2, S::npos);
- test(S("jkpldtshrm"), "rckeg", 0, 4, S::npos);
- test(S("ghasdbnjqo"), "jscie", 0, 5, S::npos);
- test(S("igrkhpbqjt"), "efsphndliq", 0, 0, S::npos);
- test(S("ikthdgcamf"), "gdicosleja", 0, 1, S::npos);
- test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 0);
- test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 0);
- test(S("itphbqsker"), "dtablcrseo", 0, 10, S::npos);
- test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, S::npos);
- test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, S::npos);
- test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, S::npos);
- test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 0);
- test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, 0);
- test(S("shbcqnmoar"), "", 1, 0, S::npos);
- test(S("bdoshlmfin"), "ontrs", 1, 0, S::npos);
- test(S("khfrebnsgq"), "pfkna", 1, 1, S::npos);
- test(S("getcrsaoji"), "ekosa", 1, 2, 1);
- test(S("fjiknedcpq"), "anqhk", 1, 4, S::npos);
- test(S("tkejgnafrm"), "jekca", 1, 5, 1);
- test(S("jnakolqrde"), "ikemsjgacf", 1, 0, S::npos);
- test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, S::npos);
- test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 1);
- test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 0);
- test(S("cigfqkated"), "sqcflrgtim", 1, 10, 1);
- test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, S::npos);
- test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, S::npos);
- test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 1);
- test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 1);
- test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, 1);
- test(S("ectnhskflp"), "", 5, 0, S::npos);
- test(S("fgtianblpq"), "pijag", 5, 0, S::npos);
- test(S("mfeqklirnh"), "jrckd", 5, 1, S::npos);
- test(S("astedncjhk"), "qcloh", 5, 2, S::npos);
- test(S("fhlqgcajbr"), "thlmp", 5, 4, 2);
- test(S("epfhocmdng"), "qidmo", 5, 5, 4);
- test(S("apcnsibger"), "lnegpsjqrd", 5, 0, S::npos);
- test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 5);
- test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, S::npos);
- test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 5);
- test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 4);
- test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, S::npos);
- test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, S::npos);
- test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 5);
- test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 5);
- test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, 5);
- test(S("shoiedtcjb"), "", 9, 0, S::npos);
- test(S("ebcinjgads"), "tqbnh", 9, 0, S::npos);
- test(S("dqmregkcfl"), "akmle", 9, 1, S::npos);
- test(S("ngcrieqajf"), "iqfkm", 9, 2, 6);
- test(S("qosmilgnjb"), "tqjsr", 9, 4, 8);
- test(S("ikabsjtdfl"), "jplqg", 9, 5, 9);
- test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, S::npos);
- test(S("fdnplotmgh"), "morkglpesn", 9, 1, 7);
- test(S("fdbicojerm"), "dmicerngat", 9, 5, 9);
- test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 6);
- test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 5);
- test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, S::npos);
- test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 6);
- test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 7);
- test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 9);
- test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, 9);
- test(S("ncjpmaekbs"), "", 10, 0, S::npos);
- test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos);
- test(S("pqfhsgilen"), "qnpor", 10, 1, 1);
- test(S("gqtjsbdckh"), "otdma", 10, 2, 2);
- test(S("cfkqpjlegi"), "efhjg", 10, 4, 7);
- test(S("beanrfodgj"), "odpte", 10, 5, 7);
- test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos);
- test(S("iomkfthagj"), "oaklidrbqg", 10, 1, 1);
-}
-
-template <class S>
-void test2()
-{
- test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, 9);
- test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, 8);
- test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, 9);
- test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos);
- test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, 8);
- test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, 9);
- test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, 9);
- test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, 9);
- test(S("cqjohampgd"), "", 11, 0, S::npos);
- test(S("hobitmpsan"), "aocjb", 11, 0, S::npos);
- test(S("tjehkpsalm"), "jbrnk", 11, 1, 1);
- test(S("ngfbojitcl"), "tqedg", 11, 2, 7);
- test(S("rcfkdbhgjo"), "nqskp", 11, 4, 3);
- test(S("qghptonrea"), "eaqkl", 11, 5, 9);
- test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos);
- test(S("hlmgabenti"), "lsftgajqpm", 11, 1, 1);
- test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, 7);
- test(S("jqedtkornm"), "shkncmiaqj", 11, 9, 9);
- test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, 9);
- test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos);
- test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos);
- test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, 9);
- test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, 9);
- test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, 9);
- test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, S::npos);
- test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, S::npos);
- test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, S::npos);
- test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, S::npos);
- test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, S::npos);
- test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, S::npos);
- test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, S::npos);
- test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, S::npos);
- test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, S::npos);
- test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, S::npos);
- test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, S::npos);
- test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, S::npos);
- test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, S::npos);
- test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, S::npos);
- test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 0);
- test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, 0);
- test(S("febhmqtjanokscdirpgl"), "", 1, 0, S::npos);
- test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, S::npos);
- test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, S::npos);
- test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 1);
- test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 1);
- test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, S::npos);
- test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, S::npos);
- test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, S::npos);
- test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, S::npos);
- test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 1);
- test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 1);
- test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, S::npos);
- test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, S::npos);
- test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 1);
- test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 1);
- test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, 1);
- test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, S::npos);
- test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, S::npos);
- test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, S::npos);
- test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 7);
- test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 10);
- test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 6);
- test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, S::npos);
- test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 9);
- test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 5);
- test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 10);
- test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 9);
- test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, S::npos);
- test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, S::npos);
- test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 10);
- test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 10);
- test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, 10);
- test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, S::npos);
- test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, S::npos);
- test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 16);
- test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 7);
- test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 16);
- test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 19);
- test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, S::npos);
- test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 15);
- test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 17);
- test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 16);
- test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 16);
- test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, S::npos);
- test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 10);
- test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 19);
- test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 19);
- test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, 19);
- test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos);
- test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos);
- test(S("grkpahljcftesdmonqib"), "odife", 20, 1, 15);
- test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, 12);
- test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, 19);
- test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, 19);
- test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos);
- test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, 3);
- test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, 19);
- test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, 19);
- test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, 19);
- test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos);
-}
-
-template <class S>
-void test3()
-{
- test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, 4);
- test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, 17);
- test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, 19);
- test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, 19);
- test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos);
- test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos);
- test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, 6);
- test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, 13);
- test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, 10);
- test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, 17);
- test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos);
- test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, 14);
- test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, 19);
- test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, 14);
- test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, 16);
- test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos);
- test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, 17);
- test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, 17);
- test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, 19);
- test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, 19);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- test2<S>();
- test3<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find_last_of( "", 0, 0) == SV::npos, "" );
- static_assert (sv1.find_last_of( "irkhs", 0, 5) == SV::npos, "" );
- static_assert (sv2.find_last_of( "", 0, 0) == SV::npos, "" );
- static_assert (sv2.find_last_of( "gfsrt", 5, 5) == SV::npos, "" );
- static_assert (sv2.find_last_of( "lecar", 5, 5) == 4, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
deleted file mode 100644
index 6fd3772fcc7d..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// size_type find_last_of(const basic_string& str, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
-{
- assert(s.find_last_of(str, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x < s.size());
-}
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type x)
-{
- assert(s.find_last_of(str) == x);
- if (x != S::npos)
- assert(x < s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), S(""), 0, S::npos);
- test(S(""), S("laenf"), 0, S::npos);
- test(S(""), S("pqlnkmbdjo"), 0, S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
- test(S(""), S(""), 1, S::npos);
- test(S(""), S("bjaht"), 1, S::npos);
- test(S(""), S("hjlcmgpket"), 1, S::npos);
- test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
- test(S("fodgq"), S(""), 0, S::npos);
- test(S("qanej"), S("dfkap"), 0, S::npos);
- test(S("clbao"), S("ihqrfebgad"), 0, S::npos);
- test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, 0);
- test(S("srdfq"), S(""), 1, S::npos);
- test(S("oemth"), S("ikcrq"), 1, S::npos);
- test(S("cdaih"), S("dmajblfhsg"), 1, 1);
- test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, 1);
- test(S("cshmd"), S(""), 2, S::npos);
- test(S("lhcdo"), S("oebqi"), 2, S::npos);
- test(S("qnsoh"), S("kojhpmbsfe"), 2, 2);
- test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, 2);
- test(S("fmtsp"), S(""), 4, S::npos);
- test(S("khbpm"), S("aobjd"), 4, 2);
- test(S("pbsji"), S("pcbahntsje"), 4, 3);
- test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, 4);
- test(S("eqmpa"), S(""), 5, S::npos);
- test(S("omigs"), S("kocgb"), 5, 3);
- test(S("onmje"), S("fbslrjiqkm"), 5, 3);
- test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, 4);
- test(S("schfa"), S(""), 6, S::npos);
- test(S("igdsc"), S("qngpd"), 6, 2);
- test(S("brqgo"), S("rodhqklgmb"), 6, 4);
- test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, 4);
- test(S("hcjitbfapl"), S(""), 0, S::npos);
- test(S("daiprenocl"), S("ashjd"), 0, 0);
- test(S("litpcfdghe"), S("mgojkldsqh"), 0, 0);
- test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, 0);
- test(S("qpghtfbaji"), S(""), 1, S::npos);
- test(S("gfshlcmdjr"), S("nadkh"), 1, S::npos);
- test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 1);
- test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, 1);
- test(S("crnklpmegd"), S(""), 5, S::npos);
- test(S("jsbtafedoc"), S("prqgn"), 5, S::npos);
- test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 5);
- test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, 5);
- test(S("lmofqdhpki"), S(""), 9, S::npos);
- test(S("hnefkqimca"), S("rtjpa"), 9, 9);
- test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 7);
- test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, 9);
- test(S("elgofjmbrq"), S(""), 10, S::npos);
- test(S("mjqdgalkpc"), S("dplqa"), 10, 8);
- test(S("kthqnfcerm"), S("dkacjoptns"), 10, 6);
- test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, 9);
- test(S("eqsgalomhb"), S(""), 11, S::npos);
- test(S("akiteljmoh"), S("lofbc"), 11, 8);
- test(S("hlbdfreqjo"), S("astoegbfpn"), 11, 9);
- test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, 9);
- test(S("snafbdlghrjkpqtoceim"), S(""), 0, S::npos);
- test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, S::npos);
- test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 0);
- test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, 0);
- test(S("jlnkraeodhcspfgbqitm"), S(""), 1, S::npos);
- test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, S::npos);
- test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 1);
- test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, 1);
- test(S("hdpkobnsalmcfijregtq"), S(""), 10, S::npos);
- test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 10);
- test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 10);
- test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, 10);
- test(S("niptglfbosehkamrdqcj"), S(""), 19, S::npos);
- test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 16);
- test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 19);
- test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, 19);
- test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos);
- test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, 19);
- test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, 18);
- test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, 19);
- test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos);
- test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, 12);
- test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, 17);
- test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, 19);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), S(""), S::npos);
- test(S(""), S("laenf"), S::npos);
- test(S(""), S("pqlnkmbdjo"), S::npos);
- test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
- test(S("nhmko"), S(""), S::npos);
- test(S("lahfb"), S("irkhs"), 2);
- test(S("gmfhd"), S("kantesmpgj"), 1);
- test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), 4);
- test(S("eolhfgpjqk"), S(""), S::npos);
- test(S("nbatdlmekr"), S("bnrpe"), 9);
- test(S("jdmciepkaq"), S("jtdaefblso"), 8);
- test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), 9);
- test(S("gprdcokbnjhlsfmtieqa"), S(""), S::npos);
- test(S("qjghlnftcaismkropdeb"), S("bjaht"), 19);
- test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 19);
- test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 19);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp
deleted file mode 100644
index bdccb2f22645..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// constexpr size_type find(const charT* s, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.find(str, pos) == x);
- if (x != S::npos)
- {
- typename S::size_type n = S::traits_type::length(str);
- assert(pos <= x && x + n <= s.size());
- }
-}
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type x)
-{
- assert(s.find(str) == x);
- if (x != S::npos)
- {
- typename S::size_type n = S::traits_type::length(str);
- assert(0 <= x && x + n <= s.size());
- }
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0);
- test(S(""), "abcde", 0, S::npos);
- test(S(""), "abcdeabcde", 0, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, S::npos);
- test(S(""), "", 1, S::npos);
- test(S(""), "abcde", 1, S::npos);
- test(S(""), "abcdeabcde", 1, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcde"), "", 0, 0);
- test(S("abcde"), "abcde", 0, 0);
- test(S("abcde"), "abcdeabcde", 0, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
- test(S("abcde"), "", 1, 1);
- test(S("abcde"), "abcde", 1, S::npos);
- test(S("abcde"), "abcdeabcde", 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcde"), "", 2, 2);
- test(S("abcde"), "abcde", 2, S::npos);
- test(S("abcde"), "abcdeabcde", 2, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, S::npos);
- test(S("abcde"), "", 4, 4);
- test(S("abcde"), "abcde", 4, S::npos);
- test(S("abcde"), "abcdeabcde", 4, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, S::npos);
- test(S("abcde"), "", 5, 5);
- test(S("abcde"), "abcde", 5, S::npos);
- test(S("abcde"), "abcdeabcde", 5, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
- test(S("abcde"), "", 6, S::npos);
- test(S("abcde"), "abcde", 6, S::npos);
- test(S("abcde"), "abcdeabcde", 6, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, S::npos);
- test(S("abcdeabcde"), "", 0, 0);
- test(S("abcdeabcde"), "abcde", 0, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
- test(S("abcdeabcde"), "", 1, 1);
- test(S("abcdeabcde"), "abcde", 1, 5);
- test(S("abcdeabcde"), "abcdeabcde", 1, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcdeabcde"), "", 5, 5);
- test(S("abcdeabcde"), "abcde", 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
- test(S("abcdeabcde"), "", 9, 9);
- test(S("abcdeabcde"), "abcde", 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, S::npos);
- test(S("abcdeabcde"), "", 10, 10);
- test(S("abcdeabcde"), "abcde", 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos);
- test(S("abcdeabcde"), "", 11, S::npos);
- test(S("abcdeabcde"), "abcde", 11, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 11, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 1, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 19, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 20, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 21, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), "", 0);
- test(S(""), "abcde", S::npos);
- test(S(""), "abcdeabcde", S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", S::npos);
- test(S("abcde"), "", 0);
- test(S("abcde"), "abcde", 0);
- test(S("abcde"), "abcdeabcde", S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", S::npos);
- test(S("abcdeabcde"), "", 0);
- test(S("abcdeabcde"), "abcde", 0);
- test(S("abcdeabcde"), "abcdeabcde", 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find( "") == 0, "" );
- static_assert (sv1.find( "abcde") == SV::npos, "" );
- static_assert (sv2.find( "") == 0, "" );
- static_assert (sv2.find( "abcde") == 0, "" );
- static_assert (sv2.find( "abcde", 1) == SV::npos, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp
deleted file mode 100644
index 856dc4a3a072..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp
+++ /dev/null
@@ -1,394 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find(const charT* s, size_type pos, size_type n) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type n, typename S::size_type x)
-{
- assert(s.find(str, pos, n) == x);
- if (x != S::npos)
- assert(pos <= x && x + n <= s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0, 0);
- test(S(""), "abcde", 0, 0, 0);
- test(S(""), "abcde", 0, 1, S::npos);
- test(S(""), "abcde", 0, 2, S::npos);
- test(S(""), "abcde", 0, 4, S::npos);
- test(S(""), "abcde", 0, 5, S::npos);
- test(S(""), "abcdeabcde", 0, 0, 0);
- test(S(""), "abcdeabcde", 0, 1, S::npos);
- test(S(""), "abcdeabcde", 0, 5, S::npos);
- test(S(""), "abcdeabcde", 0, 9, S::npos);
- test(S(""), "abcdeabcde", 0, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 1, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
- test(S(""), "", 1, 0, S::npos);
- test(S(""), "abcde", 1, 0, S::npos);
- test(S(""), "abcde", 1, 1, S::npos);
- test(S(""), "abcde", 1, 2, S::npos);
- test(S(""), "abcde", 1, 4, S::npos);
- test(S(""), "abcde", 1, 5, S::npos);
- test(S(""), "abcdeabcde", 1, 0, S::npos);
- test(S(""), "abcdeabcde", 1, 1, S::npos);
- test(S(""), "abcdeabcde", 1, 5, S::npos);
- test(S(""), "abcdeabcde", 1, 9, S::npos);
- test(S(""), "abcdeabcde", 1, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 0, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 1, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcde"), "", 0, 0, 0);
- test(S("abcde"), "abcde", 0, 0, 0);
- test(S("abcde"), "abcde", 0, 1, 0);
- test(S("abcde"), "abcde", 0, 2, 0);
- test(S("abcde"), "abcde", 0, 4, 0);
- test(S("abcde"), "abcde", 0, 5, 0);
- test(S("abcde"), "abcdeabcde", 0, 0, 0);
- test(S("abcde"), "abcdeabcde", 0, 1, 0);
- test(S("abcde"), "abcdeabcde", 0, 5, 0);
- test(S("abcde"), "abcdeabcde", 0, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 0, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
- test(S("abcde"), "", 1, 0, 1);
- test(S("abcde"), "abcde", 1, 0, 1);
- test(S("abcde"), "abcde", 1, 1, S::npos);
- test(S("abcde"), "abcde", 1, 2, S::npos);
- test(S("abcde"), "abcde", 1, 4, S::npos);
- test(S("abcde"), "abcde", 1, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 1, 0, 1);
- test(S("abcde"), "abcdeabcde", 1, 1, S::npos);
- test(S("abcde"), "abcdeabcde", 1, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 1, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 1, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcde"), "", 2, 0, 2);
- test(S("abcde"), "abcde", 2, 0, 2);
- test(S("abcde"), "abcde", 2, 1, S::npos);
- test(S("abcde"), "abcde", 2, 2, S::npos);
- test(S("abcde"), "abcde", 2, 4, S::npos);
- test(S("abcde"), "abcde", 2, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 2, 0, 2);
- test(S("abcde"), "abcdeabcde", 2, 1, S::npos);
- test(S("abcde"), "abcdeabcde", 2, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 2, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 2, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 0, 2);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 20, S::npos);
- test(S("abcde"), "", 4, 0, 4);
- test(S("abcde"), "abcde", 4, 0, 4);
- test(S("abcde"), "abcde", 4, 1, S::npos);
- test(S("abcde"), "abcde", 4, 2, S::npos);
- test(S("abcde"), "abcde", 4, 4, S::npos);
- test(S("abcde"), "abcde", 4, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 4, 0, 4);
- test(S("abcde"), "abcdeabcde", 4, 1, S::npos);
- test(S("abcde"), "abcdeabcde", 4, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 4, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 4, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 0, 4);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 20, S::npos);
- test(S("abcde"), "", 5, 0, 5);
- test(S("abcde"), "abcde", 5, 0, 5);
- test(S("abcde"), "abcde", 5, 1, S::npos);
- test(S("abcde"), "abcde", 5, 2, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S("abcde"), "abcde", 5, 4, S::npos);
- test(S("abcde"), "abcde", 5, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 5, 0, 5);
- test(S("abcde"), "abcdeabcde", 5, 1, S::npos);
- test(S("abcde"), "abcdeabcde", 5, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 5, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 5, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
- test(S("abcde"), "", 6, 0, S::npos);
- test(S("abcde"), "abcde", 6, 0, S::npos);
- test(S("abcde"), "abcde", 6, 1, S::npos);
- test(S("abcde"), "abcde", 6, 2, S::npos);
- test(S("abcde"), "abcde", 6, 4, S::npos);
- test(S("abcde"), "abcde", 6, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 6, 0, S::npos);
- test(S("abcde"), "abcdeabcde", 6, 1, S::npos);
- test(S("abcde"), "abcdeabcde", 6, 5, S::npos);
- test(S("abcde"), "abcdeabcde", 6, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 6, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 0, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 20, S::npos);
- test(S("abcdeabcde"), "", 0, 0, 0);
- test(S("abcdeabcde"), "abcde", 0, 0, 0);
- test(S("abcdeabcde"), "abcde", 0, 1, 0);
- test(S("abcdeabcde"), "abcde", 0, 2, 0);
- test(S("abcdeabcde"), "abcde", 0, 4, 0);
- test(S("abcdeabcde"), "abcde", 0, 5, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 0, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 1, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 5, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
- test(S("abcdeabcde"), "", 1, 0, 1);
- test(S("abcdeabcde"), "abcde", 1, 0, 1);
- test(S("abcdeabcde"), "abcde", 1, 1, 5);
- test(S("abcdeabcde"), "abcde", 1, 2, 5);
- test(S("abcdeabcde"), "abcde", 1, 4, 5);
- test(S("abcdeabcde"), "abcde", 1, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 1, 0, 1);
- test(S("abcdeabcde"), "abcdeabcde", 1, 1, 5);
- test(S("abcdeabcde"), "abcdeabcde", 1, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 1, 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 1, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcdeabcde"), "", 5, 0, 5);
- test(S("abcdeabcde"), "abcde", 5, 0, 5);
- test(S("abcdeabcde"), "abcde", 5, 1, 5);
- test(S("abcdeabcde"), "abcde", 5, 2, 5);
- test(S("abcdeabcde"), "abcde", 5, 4, 5);
- test(S("abcdeabcde"), "abcde", 5, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 0, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 1, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 5, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 1, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
- test(S("abcdeabcde"), "", 9, 0, 9);
- test(S("abcdeabcde"), "abcde", 9, 0, 9);
- test(S("abcdeabcde"), "abcde", 9, 1, S::npos);
- test(S("abcdeabcde"), "abcde", 9, 2, S::npos);
- test(S("abcdeabcde"), "abcde", 9, 4, S::npos);
- test(S("abcdeabcde"), "abcde", 9, 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 9, 0, 9);
- test(S("abcdeabcde"), "abcdeabcde", 9, 1, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 9, 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 9, 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 9, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 0, 9);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 1, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 20, S::npos);
- test(S("abcdeabcde"), "", 10, 0, 10);
- test(S("abcdeabcde"), "abcde", 10, 0, 10);
- test(S("abcdeabcde"), "abcde", 10, 1, S::npos);
- test(S("abcdeabcde"), "abcde", 10, 2, S::npos);
- test(S("abcdeabcde"), "abcde", 10, 4, S::npos);
- test(S("abcdeabcde"), "abcde", 10, 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 10, 0, 10);
- test(S("abcdeabcde"), "abcdeabcde", 10, 1, S::npos);
-}
-
-template <class S>
-void test2()
-{
- test(S("abcdeabcde"), "abcdeabcde", 10, 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 10, 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 10, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos);
- test(S("abcdeabcde"), "", 11, 0, S::npos);
- test(S("abcdeabcde"), "abcde", 11, 0, S::npos);
- test(S("abcdeabcde"), "abcde", 11, 1, S::npos);
- test(S("abcdeabcde"), "abcde", 11, 2, S::npos);
- test(S("abcdeabcde"), "abcde", 11, 4, S::npos);
- test(S("abcdeabcde"), "abcde", 11, 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 11, 0, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 11, 1, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 11, 5, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 11, 9, S::npos);
- test(S("abcdeabcde"), "abcdeabcde", 11, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 0, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 1, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 10, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 2, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 4, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 5, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 5, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 9, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 1, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 2, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 4, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 1, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 9, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 10, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 5);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 1, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 2, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 4, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 5, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 1, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 5, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 9, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 2, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 4, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 5, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 5, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 9, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 20, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 2, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 4, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 5, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 5, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 9, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0, 20);
-}
-
-template <class S>
-void test3()
-{
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 21, 0, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 0, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 2, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 4, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 5, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 0, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 5, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 9, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 20, S::npos);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- test2<S>();
- test3<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find( "", 0, 0 ) == 0, "" );
- static_assert (sv1.find( "abcde", 0, 0 ) == 0, "" );
- static_assert (sv1.find( "abcde", 0, 1 ) == SV::npos, "" );
- static_assert (sv2.find( "", 0, 0 ) == 0, "" );
- static_assert (sv2.find( "abcde", 0, 0 ) == 0, "" );
- static_assert (sv2.find( "abcde", 0, 1 ) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp
deleted file mode 100644
index f25efdd02072..000000000000
--- a/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type find(const basic_string_view& str, size_type pos = 0) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
-{
- assert(s.find(str, pos) == x);
- if (x != S::npos)
- assert(pos <= x && x + str.size() <= s.size());
-}
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type x)
-{
- assert(s.find(str) == x);
- if (x != S::npos)
- assert(0 <= x && x + str.size() <= s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), S(""), 0, 0);
- test(S(""), S("abcde"), 0, S::npos);
- test(S(""), S("abcdeabcde"), 0, S::npos);
- test(S(""), S("abcdeabcdeabcdeabcde"), 0, S::npos);
- test(S(""), S(""), 1, S::npos);
- test(S(""), S("abcde"), 1, S::npos);
- test(S(""), S("abcdeabcde"), 1, S::npos);
- test(S(""), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcde"), S(""), 0, 0);
- test(S("abcde"), S("abcde"), 0, 0);
- test(S("abcde"), S("abcdeabcde"), 0, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
- test(S("abcde"), S(""), 1, 1);
- test(S("abcde"), S("abcde"), 1, S::npos);
- test(S("abcde"), S("abcdeabcde"), 1, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcde"), S(""), 2, 2);
- test(S("abcde"), S("abcde"), 2, S::npos);
- test(S("abcde"), S("abcdeabcde"), 2, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 2, S::npos);
- test(S("abcde"), S(""), 4, 4);
- test(S("abcde"), S("abcde"), 4, S::npos);
- test(S("abcde"), S("abcdeabcde"), 4, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 4, S::npos);
- test(S("abcde"), S(""), 5, 5);
- test(S("abcde"), S("abcde"), 5, S::npos);
- test(S("abcde"), S("abcdeabcde"), 5, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
- test(S("abcde"), S(""), 6, S::npos);
- test(S("abcde"), S("abcde"), 6, S::npos);
- test(S("abcde"), S("abcdeabcde"), 6, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 6, S::npos);
- test(S("abcdeabcde"), S(""), 0, 0);
- test(S("abcdeabcde"), S("abcde"), 0, 0);
- test(S("abcdeabcde"), S("abcdeabcde"), 0, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
- test(S("abcdeabcde"), S(""), 1, 1);
- test(S("abcdeabcde"), S("abcde"), 1, 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 1, S::npos);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcdeabcde"), S(""), 5, 5);
- test(S("abcdeabcde"), S("abcde"), 5, 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 5, S::npos);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
- test(S("abcdeabcde"), S(""), 9, 9);
- test(S("abcdeabcde"), S("abcde"), 9, S::npos);
- test(S("abcdeabcde"), S("abcdeabcde"), 9, S::npos);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 9, S::npos);
- test(S("abcdeabcde"), S(""), 10, 10);
- test(S("abcdeabcde"), S("abcde"), 10, S::npos);
- test(S("abcdeabcde"), S("abcdeabcde"), 10, S::npos);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos);
- test(S("abcdeabcde"), S(""), 11, S::npos);
- test(S("abcdeabcde"), S("abcde"), 11, S::npos);
- test(S("abcdeabcde"), S("abcdeabcde"), 11, S::npos);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 11, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S(""), 1, 1);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 1, 5);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 1, 5);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 10, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 10, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 19, 19);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 19, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 20, 20);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 21, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 21, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 21, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 21, S::npos);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), S(""), 0);
- test(S(""), S("abcde"), S::npos);
- test(S(""), S("abcdeabcde"), S::npos);
- test(S(""), S("abcdeabcdeabcdeabcde"), S::npos);
- test(S("abcde"), S(""), 0);
- test(S("abcde"), S("abcde"), 0);
- test(S("abcde"), S("abcdeabcde"), S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), S::npos);
- test(S("abcdeabcde"), S(""), 0);
- test(S("abcdeabcde"), S("abcde"), 0);
- test(S("abcdeabcde"), S("abcdeabcde"), 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.find(sv1) == 0, "" );
- static_assert (sv1.find(sv2) == SV::npos, "" );
- static_assert (sv2.find(sv1) == 0, "" );
- static_assert (sv2.find(sv2) == 0, "" );
- static_assert (sv2.find(sv2, 1 ) == SV::npos, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp
deleted file mode 100644
index f07071101c77..000000000000
--- a/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-// constexpr size_type rfind(charT c, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.rfind(c, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x + 1 <= s.size());
-}
-
-template <class S>
-void
-test(const S& s, typename S::value_type c, typename S::size_type x)
-{
- assert(s.rfind(c) == x);
- if (x != S::npos)
- assert(x + 1 <= s.size());
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test(S(""), 'b', 0, S::npos);
- test(S(""), 'b', 1, S::npos);
- test(S("abcde"), 'b', 0, S::npos);
- test(S("abcde"), 'b', 1, 1);
- test(S("abcde"), 'b', 2, 1);
- test(S("abcde"), 'b', 4, 1);
- test(S("abcde"), 'b', 5, 1);
- test(S("abcde"), 'b', 6, 1);
- test(S("abcdeabcde"), 'b', 0, S::npos);
- test(S("abcdeabcde"), 'b', 1, 1);
- test(S("abcdeabcde"), 'b', 5, 1);
- test(S("abcdeabcde"), 'b', 9, 6);
- test(S("abcdeabcde"), 'b', 10, 6);
- test(S("abcdeabcde"), 'b', 11, 6);
- test(S("abcdeabcdeabcdeabcde"), 'b', 0, S::npos);
- test(S("abcdeabcdeabcdeabcde"), 'b', 1, 1);
- test(S("abcdeabcdeabcdeabcde"), 'b', 10, 6);
- test(S("abcdeabcdeabcdeabcde"), 'b', 19, 16);
- test(S("abcdeabcdeabcdeabcde"), 'b', 20, 16);
- test(S("abcdeabcdeabcdeabcde"), 'b', 21, 16);
-
- test(S(""), 'b', S::npos);
- test(S("abcde"), 'b', 1);
- test(S("abcdeabcde"), 'b', 6);
- test(S("abcdeabcdeabcdeabcde"), 'b', 16);
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.rfind( 'b', 0 ) == SV::npos, "" );
- static_assert (sv1.rfind( 'b', 1 ) == SV::npos, "" );
- static_assert (sv2.rfind( 'b', 0 ) == SV::npos, "" );
- static_assert (sv2.rfind( 'b', 1 ) == 1, "" );
- static_assert (sv2.rfind( 'b', 2 ) == 1, "" );
- static_assert (sv2.rfind( 'b', 3 ) == 1, "" );
- static_assert (sv2.rfind( 'b', 4 ) == 1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp
deleted file mode 100644
index 7a8795be0816..000000000000
--- a/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-// constexpr size_type rfind(const charT* s, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type x)
-{
- assert(s.rfind(str, pos) == x);
- if (x != S::npos)
- {
- typename S::size_type n = S::traits_type::length(str);
- assert(x <= pos && x + n <= s.size());
- }
-}
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type x)
-{
- assert(s.rfind(str) == x);
- if (x != S::npos)
- {
- typename S::size_type pos = s.size();
- typename S::size_type n = S::traits_type::length(str);
- assert(x <= pos && x + n <= s.size());
- }
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0);
- test(S(""), "abcde", 0, S::npos);
- test(S(""), "abcdeabcde", 0, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, S::npos);
- test(S(""), "", 1, 0);
- test(S(""), "abcde", 1, S::npos);
- test(S(""), "abcdeabcde", 1, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcde"), "", 0, 0);
- test(S("abcde"), "abcde", 0, 0);
- test(S("abcde"), "abcdeabcde", 0, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
- test(S("abcde"), "", 1, 1);
- test(S("abcde"), "abcde", 1, 0);
- test(S("abcde"), "abcdeabcde", 1, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcde"), "", 2, 2);
- test(S("abcde"), "abcde", 2, 0);
- test(S("abcde"), "abcdeabcde", 2, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, S::npos);
- test(S("abcde"), "", 4, 4);
- test(S("abcde"), "abcde", 4, 0);
- test(S("abcde"), "abcdeabcde", 4, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, S::npos);
- test(S("abcde"), "", 5, 5);
- test(S("abcde"), "abcde", 5, 0);
- test(S("abcde"), "abcdeabcde", 5, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
- test(S("abcde"), "", 6, 5);
- test(S("abcde"), "abcde", 6, 0);
- test(S("abcde"), "abcdeabcde", 6, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, S::npos);
- test(S("abcdeabcde"), "", 0, 0);
- test(S("abcdeabcde"), "abcde", 0, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
- test(S("abcdeabcde"), "", 1, 1);
- test(S("abcdeabcde"), "abcde", 1, 0);
- test(S("abcdeabcde"), "abcdeabcde", 1, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
- test(S("abcdeabcde"), "", 5, 5);
- test(S("abcdeabcde"), "abcde", 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
- test(S("abcdeabcde"), "", 9, 9);
- test(S("abcdeabcde"), "abcde", 9, 5);
- test(S("abcdeabcde"), "abcdeabcde", 9, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, S::npos);
- test(S("abcdeabcde"), "", 10, 10);
- test(S("abcdeabcde"), "abcde", 10, 5);
- test(S("abcdeabcde"), "abcdeabcde", 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos);
- test(S("abcdeabcde"), "", 11, 10);
- test(S("abcdeabcde"), "abcde", 11, 5);
- test(S("abcdeabcde"), "abcdeabcde", 11, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 1, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 19, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 20, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 21, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), "", 0);
- test(S(""), "abcde", S::npos);
- test(S(""), "abcdeabcde", S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", S::npos);
- test(S("abcde"), "", 5);
- test(S("abcde"), "abcde", 0);
- test(S("abcde"), "abcdeabcde", S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", S::npos);
- test(S("abcdeabcde"), "", 10);
- test(S("abcdeabcde"), "abcde", 5);
- test(S("abcdeabcde"), "abcdeabcde", 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.rfind( "") == 0, "" );
- static_assert (sv1.rfind( "abcde") == SV::npos, "" );
- static_assert (sv2.rfind( "") == 5, "" );
- static_assert (sv2.rfind( "abcde") == 0, "" );
- static_assert (sv2.rfind( "abcde", 1) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
deleted file mode 100644
index 2755d2c567b6..000000000000
--- a/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-// constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const typename S::value_type* str, typename S::size_type pos,
- typename S::size_type n, typename S::size_type x)
-{
- assert(s.rfind(str, pos, n) == x);
- if (x != S::npos)
- assert(x <= pos && x + n <= s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), "", 0, 0, 0);
- test(S(""), "abcde", 0, 0, 0);
- test(S(""), "abcde", 0, 1, S::npos);
- test(S(""), "abcde", 0, 2, S::npos);
- test(S(""), "abcde", 0, 4, S::npos);
- test(S(""), "abcde", 0, 5, S::npos);
- test(S(""), "abcdeabcde", 0, 0, 0);
- test(S(""), "abcdeabcde", 0, 1, S::npos);
- test(S(""), "abcdeabcde", 0, 5, S::npos);
- test(S(""), "abcdeabcde", 0, 9, S::npos);
- test(S(""), "abcdeabcde", 0, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 1, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
- test(S(""), "", 1, 0, 0);
- test(S(""), "abcde", 1, 0, 0);
- test(S(""), "abcde", 1, 1, S::npos);
- test(S(""), "abcde", 1, 2, S::npos);
- test(S(""), "abcde", 1, 4, S::npos);
- test(S(""), "abcde", 1, 5, S::npos);
- test(S(""), "abcdeabcde", 1, 0, 0);
- test(S(""), "abcdeabcde", 1, 1, S::npos);
- test(S(""), "abcdeabcde", 1, 5, S::npos);
- test(S(""), "abcdeabcde", 1, 9, S::npos);
- test(S(""), "abcdeabcde", 1, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 0, 0);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 1, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S(""), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcde"), "", 0, 0, 0);
- test(S("abcde"), "abcde", 0, 0, 0);
- test(S("abcde"), "abcde", 0, 1, 0);
- test(S("abcde"), "abcde", 0, 2, 0);
- test(S("abcde"), "abcde", 0, 4, 0);
- test(S("abcde"), "abcde", 0, 5, 0);
- test(S("abcde"), "abcdeabcde", 0, 0, 0);
- test(S("abcde"), "abcdeabcde", 0, 1, 0);
- test(S("abcde"), "abcdeabcde", 0, 5, 0);
- test(S("abcde"), "abcdeabcde", 0, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 0, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
- test(S("abcde"), "", 1, 0, 1);
- test(S("abcde"), "abcde", 1, 0, 1);
- test(S("abcde"), "abcde", 1, 1, 0);
- test(S("abcde"), "abcde", 1, 2, 0);
- test(S("abcde"), "abcde", 1, 4, 0);
- test(S("abcde"), "abcde", 1, 5, 0);
- test(S("abcde"), "abcdeabcde", 1, 0, 1);
- test(S("abcde"), "abcdeabcde", 1, 1, 0);
- test(S("abcde"), "abcdeabcde", 1, 5, 0);
- test(S("abcde"), "abcdeabcde", 1, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 1, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcde"), "", 2, 0, 2);
- test(S("abcde"), "abcde", 2, 0, 2);
- test(S("abcde"), "abcde", 2, 1, 0);
- test(S("abcde"), "abcde", 2, 2, 0);
- test(S("abcde"), "abcde", 2, 4, 0);
- test(S("abcde"), "abcde", 2, 5, 0);
- test(S("abcde"), "abcdeabcde", 2, 0, 2);
- test(S("abcde"), "abcdeabcde", 2, 1, 0);
- test(S("abcde"), "abcdeabcde", 2, 5, 0);
- test(S("abcde"), "abcdeabcde", 2, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 2, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 0, 2);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 20, S::npos);
- test(S("abcde"), "", 4, 0, 4);
- test(S("abcde"), "abcde", 4, 0, 4);
- test(S("abcde"), "abcde", 4, 1, 0);
- test(S("abcde"), "abcde", 4, 2, 0);
- test(S("abcde"), "abcde", 4, 4, 0);
- test(S("abcde"), "abcde", 4, 5, 0);
- test(S("abcde"), "abcdeabcde", 4, 0, 4);
- test(S("abcde"), "abcdeabcde", 4, 1, 0);
- test(S("abcde"), "abcdeabcde", 4, 5, 0);
- test(S("abcde"), "abcdeabcde", 4, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 4, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 0, 4);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 20, S::npos);
- test(S("abcde"), "", 5, 0, 5);
- test(S("abcde"), "abcde", 5, 0, 5);
- test(S("abcde"), "abcde", 5, 1, 0);
- test(S("abcde"), "abcde", 5, 2, 0);
-}
-
-template <class S>
-void test1()
-{
- test(S("abcde"), "abcde", 5, 4, 0);
- test(S("abcde"), "abcde", 5, 5, 0);
- test(S("abcde"), "abcdeabcde", 5, 0, 5);
- test(S("abcde"), "abcdeabcde", 5, 1, 0);
- test(S("abcde"), "abcdeabcde", 5, 5, 0);
- test(S("abcde"), "abcdeabcde", 5, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 5, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
- test(S("abcde"), "", 6, 0, 5);
- test(S("abcde"), "abcde", 6, 0, 5);
- test(S("abcde"), "abcde", 6, 1, 0);
- test(S("abcde"), "abcde", 6, 2, 0);
- test(S("abcde"), "abcde", 6, 4, 0);
- test(S("abcde"), "abcde", 6, 5, 0);
- test(S("abcde"), "abcdeabcde", 6, 0, 5);
- test(S("abcde"), "abcdeabcde", 6, 1, 0);
- test(S("abcde"), "abcdeabcde", 6, 5, 0);
- test(S("abcde"), "abcdeabcde", 6, 9, S::npos);
- test(S("abcde"), "abcdeabcde", 6, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 0, 5);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 1, 0);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 10, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 19, S::npos);
- test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 20, S::npos);
- test(S("abcdeabcde"), "", 0, 0, 0);
- test(S("abcdeabcde"), "abcde", 0, 0, 0);
- test(S("abcdeabcde"), "abcde", 0, 1, 0);
- test(S("abcdeabcde"), "abcde", 0, 2, 0);
- test(S("abcdeabcde"), "abcde", 0, 4, 0);
- test(S("abcdeabcde"), "abcde", 0, 5, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 0, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 1, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 5, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 0, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
- test(S("abcdeabcde"), "", 1, 0, 1);
- test(S("abcdeabcde"), "abcde", 1, 0, 1);
- test(S("abcdeabcde"), "abcde", 1, 1, 0);
- test(S("abcdeabcde"), "abcde", 1, 2, 0);
- test(S("abcdeabcde"), "abcde", 1, 4, 0);
- test(S("abcdeabcde"), "abcde", 1, 5, 0);
- test(S("abcdeabcde"), "abcdeabcde", 1, 0, 1);
- test(S("abcdeabcde"), "abcdeabcde", 1, 1, 0);
- test(S("abcdeabcde"), "abcdeabcde", 1, 5, 0);
- test(S("abcdeabcde"), "abcdeabcde", 1, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 1, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
- test(S("abcdeabcde"), "", 5, 0, 5);
- test(S("abcdeabcde"), "abcde", 5, 0, 5);
- test(S("abcdeabcde"), "abcde", 5, 1, 5);
- test(S("abcdeabcde"), "abcde", 5, 2, 5);
- test(S("abcdeabcde"), "abcde", 5, 4, 5);
- test(S("abcdeabcde"), "abcde", 5, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 0, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 1, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 5, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 5, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 1, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
- test(S("abcdeabcde"), "", 9, 0, 9);
- test(S("abcdeabcde"), "abcde", 9, 0, 9);
- test(S("abcdeabcde"), "abcde", 9, 1, 5);
- test(S("abcdeabcde"), "abcde", 9, 2, 5);
- test(S("abcdeabcde"), "abcde", 9, 4, 5);
- test(S("abcdeabcde"), "abcde", 9, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 9, 0, 9);
- test(S("abcdeabcde"), "abcdeabcde", 9, 1, 5);
- test(S("abcdeabcde"), "abcdeabcde", 9, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 9, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 9, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 0, 9);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 1, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 20, S::npos);
- test(S("abcdeabcde"), "", 10, 0, 10);
- test(S("abcdeabcde"), "abcde", 10, 0, 10);
- test(S("abcdeabcde"), "abcde", 10, 1, 5);
- test(S("abcdeabcde"), "abcde", 10, 2, 5);
- test(S("abcdeabcde"), "abcde", 10, 4, 5);
- test(S("abcdeabcde"), "abcde", 10, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 10, 0, 10);
- test(S("abcdeabcde"), "abcdeabcde", 10, 1, 5);
-}
-
-template <class S>
-void test2()
-{
- test(S("abcdeabcde"), "abcdeabcde", 10, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 10, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 10, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos);
- test(S("abcdeabcde"), "", 11, 0, 10);
- test(S("abcdeabcde"), "abcde", 11, 0, 10);
- test(S("abcdeabcde"), "abcde", 11, 1, 5);
- test(S("abcdeabcde"), "abcde", 11, 2, 5);
- test(S("abcdeabcde"), "abcde", 11, 4, 5);
- test(S("abcdeabcde"), "abcde", 11, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 11, 0, 10);
- test(S("abcdeabcde"), "abcdeabcde", 11, 1, 5);
- test(S("abcdeabcde"), "abcdeabcde", 11, 5, 5);
- test(S("abcdeabcde"), "abcdeabcde", 11, 9, 0);
- test(S("abcdeabcde"), "abcdeabcde", 11, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 0, 10);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 1, 5);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 10, 0);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 19, S::npos);
- test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 20, S::npos);
- test(S("abcdeabcdeabcdeabcde"), "", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 2, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 4, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 5, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 5, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 9, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 2, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 4, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 9, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 1, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 2, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 4, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 5, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 1, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 5, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 9, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 2, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 4, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 5, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 5, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 9, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0, 19);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 20, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 2, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 4, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 5, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 5, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 9, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0, 20);
-}
-
-template <class S>
-void test3()
-{
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 20, 0);
- test(S("abcdeabcdeabcdeabcde"), "", 21, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 2, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 4, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 5, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 5, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 9, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0, 20);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 1, 15);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 10, 10);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 19, 0);
- test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 20, 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- test2<S>();
- test3<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.rfind( "", 0, 0 ) == 0, "" );
- static_assert (sv1.rfind( "abcde", 0, 0 ) == 0, "" );
- static_assert (sv1.rfind( "abcde", 0, 1 ) == SV::npos, "" );
- static_assert (sv2.rfind( "", 0, 0 ) == 0, "" );
- static_assert (sv2.rfind( "abcde", 0, 0 ) == 0, "" );
- static_assert (sv2.rfind( "abcde", 0, 1 ) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp
deleted file mode 100644
index e77d668d79ba..000000000000
--- a/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr size_type rfind(const basic_string& str, size_type pos = npos) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
-{
- assert(s.rfind(str, pos) == x);
- if (x != S::npos)
- assert(x <= pos && x + str.size() <= s.size());
-}
-
-template <class S>
-void
-test(const S& s, const S& str, typename S::size_type x)
-{
- assert(s.rfind(str) == x);
- if (x != S::npos)
- assert(0 <= x && x + str.size() <= s.size());
-}
-
-template <class S>
-void test0()
-{
- test(S(""), S(""), 0, 0);
- test(S(""), S("abcde"), 0, S::npos);
- test(S(""), S("abcdeabcde"), 0, S::npos);
- test(S(""), S("abcdeabcdeabcdeabcde"), 0, S::npos);
- test(S(""), S(""), 1, 0);
- test(S(""), S("abcde"), 1, S::npos);
- test(S(""), S("abcdeabcde"), 1, S::npos);
- test(S(""), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcde"), S(""), 0, 0);
- test(S("abcde"), S("abcde"), 0, 0);
- test(S("abcde"), S("abcdeabcde"), 0, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
- test(S("abcde"), S(""), 1, 1);
- test(S("abcde"), S("abcde"), 1, 0);
- test(S("abcde"), S("abcdeabcde"), 1, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcde"), S(""), 2, 2);
- test(S("abcde"), S("abcde"), 2, 0);
- test(S("abcde"), S("abcdeabcde"), 2, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 2, S::npos);
- test(S("abcde"), S(""), 4, 4);
- test(S("abcde"), S("abcde"), 4, 0);
- test(S("abcde"), S("abcdeabcde"), 4, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 4, S::npos);
- test(S("abcde"), S(""), 5, 5);
- test(S("abcde"), S("abcde"), 5, 0);
- test(S("abcde"), S("abcdeabcde"), 5, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
- test(S("abcde"), S(""), 6, 5);
- test(S("abcde"), S("abcde"), 6, 0);
- test(S("abcde"), S("abcdeabcde"), 6, S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), 6, S::npos);
- test(S("abcdeabcde"), S(""), 0, 0);
- test(S("abcdeabcde"), S("abcde"), 0, 0);
- test(S("abcdeabcde"), S("abcdeabcde"), 0, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
- test(S("abcdeabcde"), S(""), 1, 1);
- test(S("abcdeabcde"), S("abcde"), 1, 0);
- test(S("abcdeabcde"), S("abcdeabcde"), 1, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
- test(S("abcdeabcde"), S(""), 5, 5);
- test(S("abcdeabcde"), S("abcde"), 5, 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 5, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
- test(S("abcdeabcde"), S(""), 9, 9);
- test(S("abcdeabcde"), S("abcde"), 9, 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 9, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 9, S::npos);
- test(S("abcdeabcde"), S(""), 10, 10);
- test(S("abcdeabcde"), S("abcde"), 10, 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 10, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos);
- test(S("abcdeabcde"), S(""), 11, 10);
- test(S("abcdeabcde"), S("abcde"), 11, 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 11, 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 11, S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, 0);
- test(S("abcdeabcdeabcdeabcde"), S(""), 1, 1);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 1, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 1, 0);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, 0);
- test(S("abcdeabcdeabcdeabcde"), S(""), 10, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 10, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, 0);
- test(S("abcdeabcdeabcdeabcde"), S(""), 19, 19);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 19, 15);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 19, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 19, 0);
- test(S("abcdeabcdeabcdeabcde"), S(""), 20, 20);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 20, 15);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 20, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 20, 0);
- test(S("abcdeabcdeabcdeabcde"), S(""), 21, 20);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 21, 15);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 21, 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 21, 0);
-}
-
-template <class S>
-void test1()
-{
- test(S(""), S(""), 0);
- test(S(""), S("abcde"), S::npos);
- test(S(""), S("abcdeabcde"), S::npos);
- test(S(""), S("abcdeabcdeabcdeabcde"), S::npos);
- test(S("abcde"), S(""), 5);
- test(S("abcde"), S("abcde"), 0);
- test(S("abcde"), S("abcdeabcde"), S::npos);
- test(S("abcde"), S("abcdeabcdeabcdeabcde"), S::npos);
- test(S("abcdeabcde"), S(""), 10);
- test(S("abcdeabcde"), S("abcde"), 5);
- test(S("abcdeabcde"), S("abcdeabcde"), 0);
- test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), S::npos);
- test(S("abcdeabcdeabcdeabcde"), S(""), 20);
- test(S("abcdeabcdeabcdeabcde"), S("abcde"), 15);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10);
- test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0);
-}
-
-int main()
-{
- {
- typedef std::experimental::string_view S;
- test0<S>();
- test1<S>();
- }
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
-
- static_assert (sv1.rfind(sv1) == 0, "" );
- static_assert (sv1.rfind(sv2) == SV::npos, "" );
- static_assert (sv2.rfind(sv1) == 5, "" );
- static_assert (sv2.rfind(sv2) == 0, "" );
- static_assert (sv2.rfind(sv2, 1) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.hash/string_view.pass.cpp b/test/std/experimental/string.view/string.view.hash/string_view.pass.cpp
deleted file mode 100644
index 6b16971bfeb2..000000000000
--- a/test/std/experimental/string.view/string.view.hash/string_view.pass.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template <class T>
-// struct hash
-// : public unary_function<T, size_t>
-// {
-// size_t operator()(T val) const;
-// };
-
-// Not very portable
-
-#include <experimental/string_view>
-#include <cassert>
-#include <type_traits>
-
-using std::experimental::string_view;
-
-template <class T>
-void
-test()
-{
- typedef std::hash<T> H;
- static_assert((std::is_same<typename H::argument_type, T>::value), "" );
- static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
- H h;
-// std::string g1 = "1234567890";
-// std::string g2 = "1234567891";
- typedef typename T::value_type char_type;
- char_type g1 [ 10 ];
- char_type g2 [ 10 ];
- for ( int i = 0; i < 10; ++i )
- g1[i] = g2[9-i] = '0' + i;
- T s1(g1, 10);
- T s2(g2, 10);
- assert(h(s1) != h(s2));
-}
-
-int main()
-{
- test<std::experimental::string_view>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<std::experimental::u16string_view>();
- test<std::experimental::u32string_view>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<std::experimental::wstring_view>();
-}
diff --git a/test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp b/test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp
deleted file mode 100644
index 4f3f962a3111..000000000000
--- a/test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// template<class charT, class traits, class Allocator>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os,
-// const basic_string_view<charT,traits> str);
-
-#include <experimental/string_view>
-#include <sstream>
-#include <cassert>
-
-using std::experimental::string_view;
-using std::experimental::wstring_view;
-
-int main()
-{
- {
- std::ostringstream out;
- string_view sv("some text");
- out << sv;
- assert(out.good());
- assert(sv == out.str());
- }
- {
- std::ostringstream out;
- std::string s("some text");
- string_view sv(s);
- out.width(12);
- out << sv;
- assert(out.good());
- assert(" " + s == out.str());
- }
- {
- std::wostringstream out;
- wstring_view sv(L"some text");
- out << sv;
- assert(out.good());
- assert(sv == out.str());
- }
- {
- std::wostringstream out;
- std::wstring s(L"some text");
- wstring_view sv(s);
- out.width(12);
- out << sv;
- assert(out.good());
- assert(L" " + s == out.str());
- }
-}
diff --git a/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp b/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp
deleted file mode 100644
index 5f28f63f8275..000000000000
--- a/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr const_iterator begin() const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <class S>
-void
-test(S s)
-{
- const S& cs = s;
- typename S::iterator b = s.begin();
- typename S::const_iterator cb1 = cs.begin();
- typename S::const_iterator cb2 = s.cbegin();
- if (!s.empty())
- {
- assert( *b == s[0]);
- assert( &*b == &s[0]);
- assert( *cb1 == s[0]);
- assert(&*cb1 == &s[0]);
- assert( *cb2 == s[0]);
- assert(&*cb2 == &s[0]);
-
- }
- assert( b == cb1);
- assert( b == cb2);
- assert(cb1 == cb2);
-}
-
-
-int main()
-{
- typedef std::experimental::string_view string_view;
- typedef std::experimental::u16string_view u16string_view;
- typedef std::experimental::u32string_view u32string_view;
- typedef std::experimental::wstring_view wstring_view;
-
- test(string_view ());
- test(u16string_view());
- test(u32string_view());
- test(wstring_view ());
- test(string_view ( "123"));
- test(wstring_view (L"123"));
-#if TEST_STD_VER >= 11
- test(u16string_view{u"123"});
- test(u32string_view{U"123"});
-#endif
-
-#if TEST_STD_VER > 11
- {
- constexpr string_view sv { "123", 3 };
- constexpr u16string_view u16sv {u"123", 3 };
- constexpr u32string_view u32sv {U"123", 3 };
- constexpr wstring_view wsv {L"123", 3 };
-
- static_assert ( *sv.begin() == sv[0], "" );
- static_assert ( *u16sv.begin() == u16sv[0], "" );
- static_assert ( *u32sv.begin() == u32sv[0], "" );
- static_assert ( *wsv.begin() == wsv[0], "" );
-
- static_assert ( *sv.cbegin() == sv[0], "" );
- static_assert ( *u16sv.cbegin() == u16sv[0], "" );
- static_assert ( *u32sv.cbegin() == u32sv[0], "" );
- static_assert ( *wsv.cbegin() == wsv[0], "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.iterators/end.pass.cpp b/test/std/experimental/string.view/string.view.iterators/end.pass.cpp
deleted file mode 100644
index 1f22b3fbe4ba..000000000000
--- a/test/std/experimental/string.view/string.view.iterators/end.pass.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr const_iterator end() const;
-
-#include <experimental/string_view>
-#include <cstddef>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <class S>
-void
-test(S s)
-{
- const S& cs = s;
- typename S::iterator e = s.end();
- typename S::const_iterator ce1 = cs.end();
- typename S::const_iterator ce2 = s.cend();
-
- if (s.empty())
- {
- assert( e == s.begin());
- assert(ce1 == cs.begin());
- assert(ce2 == s.begin());
- }
- else
- {
- assert( e != s.begin());
- assert(ce1 != cs.begin());
- assert(ce2 != s.begin());
- }
-
- assert( e - s.begin() == static_cast<std::ptrdiff_t>(s.size()));
- assert(ce1 - cs.begin() == static_cast<std::ptrdiff_t>(cs.size()));
- assert(ce2 - s.cbegin() == static_cast<std::ptrdiff_t>(s.size()));
-
- assert( e == ce1);
- assert( e == ce2);
- assert(ce1 == ce2);
-}
-
-
-int main()
-{
- typedef std::experimental::string_view string_view;
- typedef std::experimental::u16string_view u16string_view;
- typedef std::experimental::u32string_view u32string_view;
- typedef std::experimental::wstring_view wstring_view;
-
- test(string_view ());
- test(u16string_view());
- test(u32string_view());
- test(wstring_view ());
- test(string_view ( "123"));
- test(wstring_view (L"123"));
-#if TEST_STD_VER >= 11
- test(u16string_view{u"123"});
- test(u32string_view{U"123"});
-#endif
-
-#if TEST_STD_VER > 11
- {
- constexpr string_view sv { "123", 3 };
- constexpr u16string_view u16sv {u"123", 3 };
- constexpr u32string_view u32sv {U"123", 3 };
- constexpr wstring_view wsv {L"123", 3 };
-
- static_assert ( sv.begin() != sv.end(), "" );
- static_assert ( u16sv.begin() != u16sv.end(), "" );
- static_assert ( u32sv.begin() != u32sv.end(), "" );
- static_assert ( wsv.begin() != wsv.end(), "" );
-
- static_assert ( sv.begin() != sv.cend(), "" );
- static_assert ( u16sv.begin() != u16sv.cend(), "" );
- static_assert ( u32sv.begin() != u32sv.cend(), "" );
- static_assert ( wsv.begin() != wsv.cend(), "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp b/test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp
deleted file mode 100644
index 068557e39863..000000000000
--- a/test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// const_iterator rbegin() const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <class S>
-void
-test(S s)
-{
- const S& cs = s;
- typename S::reverse_iterator b = s.rbegin();
- typename S::const_reverse_iterator cb1 = cs.rbegin();
- typename S::const_reverse_iterator cb2 = s.crbegin();
- if (!s.empty())
- {
- const size_t last = s.size() - 1;
- assert( *b == s[last]);
- assert( &*b == &s[last]);
- assert( *cb1 == s[last]);
- assert(&*cb1 == &s[last]);
- assert( *cb2 == s[last]);
- assert(&*cb2 == &s[last]);
-
- }
- assert( b == cb1);
- assert( b == cb2);
- assert(cb1 == cb2);
-}
-
-
-int main()
-{
- typedef std::experimental::string_view string_view;
- typedef std::experimental::u16string_view u16string_view;
- typedef std::experimental::u32string_view u32string_view;
- typedef std::experimental::wstring_view wstring_view;
-
- test(string_view ());
- test(u16string_view());
- test(u32string_view());
- test(wstring_view ());
- test(string_view ( "123"));
- test(wstring_view (L"123"));
-#if TEST_STD_VER >= 11
- test(u16string_view{u"123"});
- test(u32string_view{U"123"});
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp b/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp
deleted file mode 100644
index bd24c327e090..000000000000
--- a/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr const_iterator rend() const;
-
-#include <experimental/string_view>
-#include <cstddef>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <class S>
-void
-test(S s)
-{
- const S& cs = s;
- typename S::reverse_iterator e = s.rend();
- typename S::const_reverse_iterator ce1 = cs.rend();
- typename S::const_reverse_iterator ce2 = s.crend();
-
- if (s.empty())
- {
- assert( e == s.rbegin());
- assert(ce1 == cs.rbegin());
- assert(ce2 == s.rbegin());
- }
- else
- {
- assert( e != s.rbegin());
- assert(ce1 != cs.rbegin());
- assert(ce2 != s.rbegin());
- }
-
- assert( e - s.rbegin() == static_cast<std::ptrdiff_t>(s.size()));
- assert(ce1 - cs.rbegin() == static_cast<std::ptrdiff_t>(cs.size()));
- assert(ce2 - s.crbegin() == static_cast<std::ptrdiff_t>(s.size()));
-
- assert( e == ce1);
- assert( e == ce2);
- assert(ce1 == ce2);
-}
-
-
-int main()
-{
- typedef std::experimental::string_view string_view;
- typedef std::experimental::u16string_view u16string_view;
- typedef std::experimental::u32string_view u32string_view;
- typedef std::experimental::wstring_view wstring_view;
-
- test(string_view ());
- test(u16string_view());
- test(u32string_view());
- test(wstring_view ());
- test(string_view ( "123"));
- test(wstring_view (L"123"));
-#if TEST_STD_VER >= 11
- test(u16string_view{u"123"});
- test(u32string_view{U"123"});
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp
deleted file mode 100644
index 00b0661d85f5..000000000000
--- a/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// void clear() noexcept
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test ( const CharT *s, size_t len ) {
- typedef std::experimental::basic_string_view<CharT> SV;
- {
- SV sv1 ( s );
- assert ( sv1.size() == len );
- assert ( sv1.data() == s );
-
- sv1.clear ();
- assert ( sv1.data() == nullptr );
- assert ( sv1.size() == 0 );
- assert ( sv1 == SV());
- }
-}
-
-#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n ) {
- typedef std::experimental::basic_string_view<char> SV;
- SV sv1{ "ABCDEFGHIJKL", n };
- sv1.clear();
- return sv1.size();
-}
-#endif
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
- test ( "", 0 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
- test ( L"", 0 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
- test ( u"", 0 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
- test ( U"", 0 );
-#endif
-
-#if TEST_STD_VER > 11
- static_assert ( test_ce (5) == 0, "" );
-#endif
-
-}
diff --git a/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp
deleted file mode 100644
index 03484a0b5ebb..000000000000
--- a/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// void remove_prefix(size_type _n)
-
-#include <experimental/string_view>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test ( const CharT *s, size_t len ) {
- typedef std::experimental::basic_string_view<CharT> SV;
- {
- SV sv1 ( s );
- assert ( sv1.size() == len );
- assert ( sv1.data() == s );
-
- if ( len > 0 ) {
- sv1.remove_prefix ( 1 );
- assert ( sv1.size() == (len - 1));
- assert ( sv1.data() == (s + 1));
- sv1.remove_prefix ( len - 1 );
- }
-
- assert ( sv1.size() == 0 );
- sv1.remove_prefix ( 0 );
- assert ( sv1.size() == 0 );
- }
-}
-
-#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
- typedef std::experimental::basic_string_view<char> SV;
- SV sv1{ "ABCDEFGHIJKL", n };
- sv1.remove_prefix ( k );
- return sv1.size();
-}
-#endif
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
- test ( "", 0 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
- test ( L"", 0 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
- test ( u"", 0 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
- test ( U"", 0 );
-#endif
-
-#if TEST_STD_VER > 11
- {
- static_assert ( test_ce ( 5, 0 ) == 5, "" );
- static_assert ( test_ce ( 5, 1 ) == 4, "" );
- static_assert ( test_ce ( 5, 5 ) == 0, "" );
- static_assert ( test_ce ( 9, 3 ) == 6, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp
deleted file mode 100644
index 6b632d0efad8..000000000000
--- a/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// void remove_suffix(size_type _n)
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test ( const CharT *s, size_t len ) {
- typedef std::experimental::basic_string_view<CharT> SV;
- {
- SV sv1 ( s );
- assert ( sv1.size() == len );
- assert ( sv1.data() == s );
-
- if ( len > 0 ) {
- sv1.remove_suffix ( 1 );
- assert ( sv1.size() == (len - 1));
- assert ( sv1.data() == s);
- sv1.remove_suffix ( len - 1 );
- }
-
- assert ( sv1.size() == 0 );
- sv1.remove_suffix ( 0 );
- assert ( sv1.size() == 0 );
- }
-
-}
-
-#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
- typedef std::experimental::basic_string_view<char> SV;
- SV sv1{ "ABCDEFGHIJKL", n };
- sv1.remove_suffix ( k );
- return sv1.size();
-}
-#endif
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
- test ( "", 0 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
- test ( L"", 0 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
- test ( u"", 0 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
- test ( U"", 0 );
-#endif
-
-#if TEST_STD_VER > 11
- {
- static_assert ( test_ce ( 5, 0 ) == 5, "" );
- static_assert ( test_ce ( 5, 1 ) == 4, "" );
- static_assert ( test_ce ( 5, 5 ) == 0, "" );
- static_assert ( test_ce ( 9, 3 ) == 6, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp
deleted file mode 100644
index 2912fd8b9150..000000000000
--- a/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// void swap(basic_string_view& _other) noexcept
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test ( const CharT *s, size_t len ) {
- typedef std::experimental::basic_string_view<CharT> SV;
- {
- SV sv1(s);
- SV sv2;
-
- assert ( sv1.size() == len );
- assert ( sv1.data() == s );
- assert ( sv2.size() == 0 );
-
- sv1.swap ( sv2 );
- assert ( sv1.size() == 0 );
- assert ( sv2.size() == len );
- assert ( sv2.data() == s );
- }
-
-}
-
-#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
- typedef std::experimental::basic_string_view<char> SV;
- SV sv1{ "ABCDEFGHIJKL", n };
- SV sv2 { sv1.data(), k };
- sv1.swap ( sv2 );
- return sv1.size();
-}
-#endif
-
-
-int main () {
- test ( "ABCDE", 5 );
- test ( "a", 1 );
- test ( "", 0 );
-
- test ( L"ABCDE", 5 );
- test ( L"a", 1 );
- test ( L"", 0 );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDE", 5 );
- test ( u"a", 1 );
- test ( u"", 0 );
-
- test ( U"ABCDE", 5 );
- test ( U"a", 1 );
- test ( U"", 0 );
-#endif
-
-#if TEST_STD_VER > 11
- {
- static_assert ( test_ce (2, 3) == 3, "" );
- static_assert ( test_ce (5, 3) == 3, "" );
- static_assert ( test_ce (0, 1) == 1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp b/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp
deleted file mode 100644
index 202e9ced451f..000000000000
--- a/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <iomanip>
-
-// quoted
-
-#include <iomanip>
-#include <sstream>
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-#if TEST_STD_VER > 11
-// quoted is C++14 only
-
-bool is_skipws ( const std::istream *is ) {
- return ( is->flags() & std::ios_base::skipws ) != 0;
- }
-
-
-bool is_skipws ( const std::wistream *is ) {
- return ( is->flags() & std::ios_base::skipws ) != 0;
- }
-
-void round_trip ( const char *p ) {
- std::stringstream ss;
- bool skippingws = is_skipws ( &ss );
- std::experimental::string_view sv {p};
-
- ss << std::quoted(sv);
- std::string s;
- ss >> std::quoted(s);
- assert ( s == sv );
- assert ( skippingws == is_skipws ( &ss ));
- }
-
-void round_trip_ws ( const char *p ) {
- std::stringstream ss;
- std::noskipws ( ss );
- bool skippingws = is_skipws ( &ss );
- std::experimental::string_view sv {p};
-
- ss << std::quoted(sv);
- std::string s;
- ss >> std::quoted(s);
- assert ( s == sv );
- assert ( skippingws == is_skipws ( &ss ));
- }
-
-void round_trip_d ( const char *p, char delim ) {
- std::stringstream ss;
- std::experimental::string_view sv {p};
-
- ss << std::quoted(sv, delim);
- std::string s;
- ss >> std::quoted(s, delim);
- assert ( s == sv );
- }
-
-void round_trip_e ( const char *p, char escape ) {
- std::stringstream ss;
- std::experimental::string_view sv {p};
-
- ss << std::quoted(sv, '"', escape );
- std::string s;
- ss >> std::quoted(s, '"', escape );
- assert ( s == sv );
- }
-
-
-
-std::string quote ( const char *p, char delim='"', char escape='\\' ) {
- std::stringstream ss;
- ss << std::quoted(p, delim, escape);
- std::string s;
- ss >> s; // no quote
- return s;
-}
-
-std::string unquote ( const char *p, char delim='"', char escape='\\' ) {
- std::stringstream ss;
- ss << p;
- std::string s;
- ss >> std::quoted(s, delim, escape);
- return s;
-}
-
-
-void round_trip ( const wchar_t *p ) {
- std::wstringstream ss;
- bool skippingws = is_skipws ( &ss );
- std::experimental::wstring_view sv {p};
-
- ss << std::quoted(sv);
- std::wstring s;
- ss >> std::quoted(s);
- assert ( s == sv );
- assert ( skippingws == is_skipws ( &ss ));
- }
-
-
-void round_trip_ws ( const wchar_t *p ) {
- std::wstringstream ss;
- std::noskipws ( ss );
- bool skippingws = is_skipws ( &ss );
- std::experimental::wstring_view sv {p};
-
- ss << std::quoted(sv);
- std::wstring s;
- ss >> std::quoted(s);
- assert ( s == sv );
- assert ( skippingws == is_skipws ( &ss ));
- }
-
-void round_trip_d ( const wchar_t *p, wchar_t delim ) {
- std::wstringstream ss;
- std::experimental::wstring_view sv {p};
-
- ss << std::quoted(sv, delim);
- std::wstring s;
- ss >> std::quoted(s, delim);
- assert ( s == sv );
- }
-
-void round_trip_e ( const wchar_t *p, wchar_t escape ) {
- std::wstringstream ss;
- std::experimental::wstring_view sv {p};
-
- ss << std::quoted(sv, wchar_t('"'), escape );
- std::wstring s;
- ss >> std::quoted(s, wchar_t('"'), escape );
- assert ( s == sv );
- }
-
-
-std::wstring quote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\' ) {
- std::wstringstream ss;
- std::experimental::wstring_view sv {p};
-
- ss << std::quoted(sv, delim, escape);
- std::wstring s;
- ss >> s; // no quote
- return s;
-}
-
-std::wstring unquote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\' ) {
- std::wstringstream ss;
- std::experimental::wstring_view sv {p};
-
- ss << sv;
- std::wstring s;
- ss >> std::quoted(s, delim, escape);
- return s;
-}
-
-int main()
-{
- round_trip ( "" );
- round_trip_ws ( "" );
- round_trip_d ( "", 'q' );
- round_trip_e ( "", 'q' );
-
- round_trip ( L"" );
- round_trip_ws ( L"" );
- round_trip_d ( L"", 'q' );
- round_trip_e ( L"", 'q' );
-
- round_trip ( "Hi" );
- round_trip_ws ( "Hi" );
- round_trip_d ( "Hi", '!' );
- round_trip_e ( "Hi", '!' );
- assert ( quote ( "Hi", '!' ) == "!Hi!" );
- assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" );
-
- round_trip ( L"Hi" );
- round_trip_ws ( L"Hi" );
- round_trip_d ( L"Hi", '!' );
- round_trip_e ( L"Hi", '!' );
- assert ( quote ( L"Hi", '!' ) == L"!Hi!" );
- assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" );
-
- round_trip ( "Hi Mom" );
- round_trip_ws ( "Hi Mom" );
- round_trip ( L"Hi Mom" );
- round_trip_ws ( L"Hi Mom" );
-
- assert ( quote ( "" ) == "\"\"" );
- assert ( quote ( L"" ) == L"\"\"" );
- assert ( quote ( "a" ) == "\"a\"" );
- assert ( quote ( L"a" ) == L"\"a\"" );
-
-// missing end quote - must not hang
- assert ( unquote ( "\"abc" ) == "abc" );
- assert ( unquote ( L"\"abc" ) == L"abc" );
-
- assert ( unquote ( "abc" ) == "abc" ); // no delimiter
- assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter
- assert ( unquote ( "abc def" ) == "abc" ); // no delimiter
- assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter
-
- assert ( unquote ( "" ) == "" ); // nothing there
- assert ( unquote ( L"" ) == L"" ); // nothing there
- }
-#else
-int main() {}
-#endif
diff --git a/test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp b/test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp
deleted file mode 100644
index a29bb15f5ac9..000000000000
--- a/test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// template<class _Allocator>
-// explicit operator basic_string<_CharT, _Traits, _Allocator>() const
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test ( const CharT *s ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
- typedef std::basic_string<CharT> string_t;
-
- {
- string_view_t sv1 ( s );
- string_t str = (string_t) sv1;
-
- assert ( sv1.size() == str.size ());
- assert ( std::char_traits<CharT>::compare ( sv1.data(), str.data(), sv1.size()) == 0 );
- }
-
- {
- string_view_t sv1;
- string_t str = (string_t) sv1;
-
- assert ( sv1.size() == 0);
- assert ( sv1.size() == str.size ());
- }
-}
-
-int main () {
- test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( "ABCDE");
- test ( "a" );
- test ( "" );
-
- test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( L"ABCDE" );
- test ( L"a" );
- test ( L"" );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( u"ABCDE" );
- test ( u"a" );
- test ( u"" );
-
- test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( U"ABCDE" );
- test ( U"a" );
- test ( U"" );
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp
deleted file mode 100644
index 93014ea119f9..000000000000
--- a/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr int compare(const charT* s) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv1, const CharT *s, int expected ) {
- assert ( sign( sv1.compare(s)) == sign(expected));
-}
-
-template<typename CharT>
-void
-test( const CharT *s1, const CharT *s2, int expected)
-{
- typedef std::experimental::basic_string_view<CharT> string_view_t;
- string_view_t sv1 ( s1 );
- test1 ( sv1, s2, expected );
-}
-
-int main()
-{
- {
- test("", "", 0);
- test("", "abcde", -5);
- test("", "abcdefghij", -10);
- test("", "abcdefghijklmnopqrst", -20);
- test("abcde", "", 5);
- test("abcde", "abcde", 0);
- test("abcde", "abcdefghij", -5);
- test("abcde", "abcdefghijklmnopqrst", -15);
- test("abcdefghij", "", 10);
- test("abcdefghij", "abcde", 5);
- test("abcdefghij", "abcdefghij", 0);
- test("abcdefghij", "abcdefghijklmnopqrst", -10);
- test("abcdefghijklmnopqrst", "", 20);
- test("abcdefghijklmnopqrst", "abcde", 15);
- test("abcdefghijklmnopqrst", "abcdefghij", 10);
- test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0);
- }
-
- {
- test(L"", L"", 0);
- test(L"", L"abcde", -5);
- test(L"", L"abcdefghij", -10);
- test(L"", L"abcdefghijklmnopqrst", -20);
- test(L"abcde", L"", 5);
- test(L"abcde", L"abcde", 0);
- test(L"abcde", L"abcdefghij", -5);
- test(L"abcde", L"abcdefghijklmnopqrst", -15);
- test(L"abcdefghij", L"", 10);
- test(L"abcdefghij", L"abcde", 5);
- test(L"abcdefghij", L"abcdefghij", 0);
- test(L"abcdefghij", L"abcdefghijklmnopqrst", -10);
- test(L"abcdefghijklmnopqrst", L"", 20);
- test(L"abcdefghijklmnopqrst", L"abcde", 15);
- test(L"abcdefghijklmnopqrst", L"abcdefghij", 10);
- test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0);
- }
-
-#if TEST_STD_VER >= 11
- {
- test(U"", U"", 0);
- test(U"", U"abcde", -5);
- test(U"", U"abcdefghij", -10);
- test(U"", U"abcdefghijklmnopqrst", -20);
- test(U"abcde", U"", 5);
- test(U"abcde", U"abcde", 0);
- test(U"abcde", U"abcdefghij", -5);
- test(U"abcde", U"abcdefghijklmnopqrst", -15);
- test(U"abcdefghij", U"", 10);
- test(U"abcdefghij", U"abcde", 5);
- test(U"abcdefghij", U"abcdefghij", 0);
- test(U"abcdefghij", U"abcdefghijklmnopqrst", -10);
- test(U"abcdefghijklmnopqrst", U"", 20);
- test(U"abcdefghijklmnopqrst", U"abcde", 15);
- test(U"abcdefghijklmnopqrst", U"abcdefghij", 10);
- test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
- }
-
- {
- test(u"", u"", 0);
- test(u"", u"abcde", -5);
- test(u"", u"abcdefghij", -10);
- test(u"", u"abcdefghijklmnopqrst", -20);
- test(u"abcde", u"", 5);
- test(u"abcde", u"abcde", 0);
- test(u"abcde", u"abcdefghij", -5);
- test(u"abcde", u"abcdefghijklmnopqrst", -15);
- test(u"abcdefghij", u"", 10);
- test(u"abcdefghij", u"abcde", 5);
- test(u"abcdefghij", u"abcdefghij", 0);
- test(u"abcdefghij", u"abcdefghijklmnopqrst", -10);
- test(u"abcdefghijklmnopqrst", u"", 20);
- test(u"abcdefghijklmnopqrst", u"abcde", 15);
- test(u"abcdefghijklmnopqrst", u"abcdefghij", 10);
- test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0);
- }
-#endif
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
- static_assert ( sv1.compare("") == 0, "" );
- static_assert ( sv1.compare("abcde") == -1, "" );
- static_assert ( sv2.compare("") == 1, "" );
- static_assert ( sv2.compare("abcde") == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp
deleted file mode 100644
index cfe35fcb4719..000000000000
--- a/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp
+++ /dev/null
@@ -1,453 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv1,
- size_t pos1, size_t n1, const CharT *s, int expected ) {
- if (pos1 > sv1.size()) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- sv1.compare(pos1, n1, s);
- assert(false);
- } catch (const std::out_of_range&) {
- } catch (...) {
- assert(false);
- }
-#endif
- } else {
- assert(sign(sv1.compare(pos1, n1, s)) == sign(expected));
- }
-}
-
-template<typename CharT>
-void
-test( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected)
-{
- typedef std::experimental::basic_string_view<CharT> string_view_t;
- string_view_t sv1 ( s1 );
- test1 ( sv1, pos1, n1, s2, expected );
-}
-
-void test0()
-{
- test("", 0, 0, "", 0);
- test("", 0, 0, "abcde", -5);
- test("", 0, 0, "abcdefghij", -10);
- test("", 0, 0, "abcdefghijklmnopqrst", -20);
- test("", 0, 1, "", 0);
- test("", 0, 1, "abcde", -5);
- test("", 0, 1, "abcdefghij", -10);
- test("", 0, 1, "abcdefghijklmnopqrst", -20);
- test("", 1, 0, "", 0);
- test("", 1, 0, "abcde", 0);
- test("", 1, 0, "abcdefghij", 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0);
- test("abcde", 0, 0, "", 0);
- test("abcde", 0, 0, "abcde", -5);
- test("abcde", 0, 0, "abcdefghij", -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 0, 1, "", 1);
- test("abcde", 0, 1, "abcde", -4);
- test("abcde", 0, 1, "abcdefghij", -9);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", -19);
- test("abcde", 0, 2, "", 2);
- test("abcde", 0, 2, "abcde", -3);
- test("abcde", 0, 2, "abcdefghij", -8);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", -18);
- test("abcde", 0, 4, "", 4);
- test("abcde", 0, 4, "abcde", -1);
- test("abcde", 0, 4, "abcdefghij", -6);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", -16);
- test("abcde", 0, 5, "", 5);
- test("abcde", 0, 5, "abcde", 0);
- test("abcde", 0, 5, "abcdefghij", -5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", -15);
- test("abcde", 0, 6, "", 5);
- test("abcde", 0, 6, "abcde", 0);
- test("abcde", 0, 6, "abcdefghij", -5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", -15);
- test("abcde", 1, 0, "", 0);
- test("abcde", 1, 0, "abcde", -5);
- test("abcde", 1, 0, "abcdefghij", -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 1, 1, "", 1);
- test("abcde", 1, 1, "abcde", 1);
- test("abcde", 1, 1, "abcdefghij", 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 2, "", 2);
- test("abcde", 1, 2, "abcde", 1);
- test("abcde", 1, 2, "abcdefghij", 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 3, "", 3);
- test("abcde", 1, 3, "abcde", 1);
- test("abcde", 1, 3, "abcdefghij", 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 4, "", 4);
- test("abcde", 1, 4, "abcde", 1);
- test("abcde", 1, 4, "abcdefghij", 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 5, "", 4);
- test("abcde", 1, 5, "abcde", 1);
- test("abcde", 1, 5, "abcdefghij", 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1);
- test("abcde", 2, 0, "", 0);
- test("abcde", 2, 0, "abcde", -5);
- test("abcde", 2, 0, "abcdefghij", -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 2, 1, "", 1);
- test("abcde", 2, 1, "abcde", 2);
- test("abcde", 2, 1, "abcdefghij", 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 2);
- test("abcde", 2, 2, "", 2);
- test("abcde", 2, 2, "abcde", 2);
- test("abcde", 2, 2, "abcdefghij", 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 2);
- test("abcde", 2, 3, "", 3);
- test("abcde", 2, 3, "abcde", 2);
- test("abcde", 2, 3, "abcdefghij", 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 2);
- test("abcde", 2, 4, "", 3);
- test("abcde", 2, 4, "abcde", 2);
- test("abcde", 2, 4, "abcdefghij", 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 2);
- test("abcde", 4, 0, "", 0);
- test("abcde", 4, 0, "abcde", -5);
- test("abcde", 4, 0, "abcdefghij", -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 4, 1, "", 1);
- test("abcde", 4, 1, "abcde", 4);
- test("abcde", 4, 1, "abcdefghij", 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 4);
- test("abcde", 4, 2, "", 1);
- test("abcde", 4, 2, "abcde", 4);
- test("abcde", 4, 2, "abcdefghij", 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 4);
- test("abcde", 5, 0, "", 0);
- test("abcde", 5, 0, "abcde", -5);
- test("abcde", 5, 0, "abcdefghij", -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 5, 1, "", 0);
- test("abcde", 5, 1, "abcde", -5);
- test("abcde", 5, 1, "abcdefghij", -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", -20);
-}
-
-void test1()
-{
- test("abcde", 6, 0, "", 0);
- test("abcde", 6, 0, "abcde", 0);
- test("abcde", 6, 0, "abcdefghij", 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0);
- test("abcdefghij", 0, 0, "", 0);
- test("abcdefghij", 0, 0, "abcde", -5);
- test("abcdefghij", 0, 0, "abcdefghij", -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 0, 1, "", 1);
- test("abcdefghij", 0, 1, "abcde", -4);
- test("abcdefghij", 0, 1, "abcdefghij", -9);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", -19);
- test("abcdefghij", 0, 5, "", 5);
- test("abcdefghij", 0, 5, "abcde", 0);
- test("abcdefghij", 0, 5, "abcdefghij", -5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", -15);
- test("abcdefghij", 0, 9, "", 9);
- test("abcdefghij", 0, 9, "abcde", 4);
- test("abcdefghij", 0, 9, "abcdefghij", -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", -11);
- test("abcdefghij", 0, 10, "", 10);
- test("abcdefghij", 0, 10, "abcde", 5);
- test("abcdefghij", 0, 10, "abcdefghij", 0);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", -10);
- test("abcdefghij", 0, 11, "", 10);
- test("abcdefghij", 0, 11, "abcde", 5);
- test("abcdefghij", 0, 11, "abcdefghij", 0);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", -10);
- test("abcdefghij", 1, 0, "", 0);
- test("abcdefghij", 1, 0, "abcde", -5);
- test("abcdefghij", 1, 0, "abcdefghij", -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 1, 1, "", 1);
- test("abcdefghij", 1, 1, "abcde", 1);
- test("abcdefghij", 1, 1, "abcdefghij", 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 4, "", 4);
- test("abcdefghij", 1, 4, "abcde", 1);
- test("abcdefghij", 1, 4, "abcdefghij", 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 8, "", 8);
- test("abcdefghij", 1, 8, "abcde", 1);
- test("abcdefghij", 1, 8, "abcdefghij", 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 9, "", 9);
- test("abcdefghij", 1, 9, "abcde", 1);
- test("abcdefghij", 1, 9, "abcdefghij", 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 10, "", 9);
- test("abcdefghij", 1, 10, "abcde", 1);
- test("abcdefghij", 1, 10, "abcdefghij", 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 5, 0, "", 0);
- test("abcdefghij", 5, 0, "abcde", -5);
- test("abcdefghij", 5, 0, "abcdefghij", -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 5, 1, "", 1);
- test("abcdefghij", 5, 1, "abcde", 5);
- test("abcdefghij", 5, 1, "abcdefghij", 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 2, "", 2);
- test("abcdefghij", 5, 2, "abcde", 5);
- test("abcdefghij", 5, 2, "abcdefghij", 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 4, "", 4);
- test("abcdefghij", 5, 4, "abcde", 5);
- test("abcdefghij", 5, 4, "abcdefghij", 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 5, "", 5);
- test("abcdefghij", 5, 5, "abcde", 5);
- test("abcdefghij", 5, 5, "abcdefghij", 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 6, "", 5);
- test("abcdefghij", 5, 6, "abcde", 5);
- test("abcdefghij", 5, 6, "abcdefghij", 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 9, 0, "", 0);
- test("abcdefghij", 9, 0, "abcde", -5);
- test("abcdefghij", 9, 0, "abcdefghij", -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 9, 1, "", 1);
- test("abcdefghij", 9, 1, "abcde", 9);
- test("abcdefghij", 9, 1, "abcdefghij", 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 9);
- test("abcdefghij", 9, 2, "", 1);
- test("abcdefghij", 9, 2, "abcde", 9);
- test("abcdefghij", 9, 2, "abcdefghij", 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 9);
- test("abcdefghij", 10, 0, "", 0);
- test("abcdefghij", 10, 0, "abcde", -5);
- test("abcdefghij", 10, 0, "abcdefghij", -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 10, 1, "", 0);
- test("abcdefghij", 10, 1, "abcde", -5);
- test("abcdefghij", 10, 1, "abcdefghij", -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 11, 0, "", 0);
- test("abcdefghij", 11, 0, "abcde", 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0);
-}
-
-void test2()
-{
- test("abcdefghijklmnopqrst", 0, 0, "", 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 0, 1, "", 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", -19);
- test("abcdefghijklmnopqrst", 0, 10, "", 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", -10);
- test("abcdefghijklmnopqrst", 0, 19, "", 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", -1);
- test("abcdefghijklmnopqrst", 0, 20, "", 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0);
- test("abcdefghijklmnopqrst", 0, 21, "", 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0);
- test("abcdefghijklmnopqrst", 1, 0, "", 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 1, 1, "", 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 9, "", 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 18, "", 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 19, "", 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 20, "", 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 10, 0, "", 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 10, 1, "", 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 5, "", 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 9, "", 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 10, "", 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 11, "", 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 19, 0, "", 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 19, 1, "", 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19);
- test("abcdefghijklmnopqrst", 19, 2, "", 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19);
- test("abcdefghijklmnopqrst", 20, 0, "", 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 20, 1, "", 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 21, 0, "", 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0);
-}
-
-
-int main()
-{
- test0();
- test1();
- test2();
-
- {
- test("", 0, 0, "", 0);
- test("", 0, 0, "abcde", -5);
- test("", 0, 0, "abcdefghij", -10);
- test("", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 0, 2, "", 5);
- test("abcde", 0, 6,"abcde", 0);
- test("abcde", 0, 6, "abcdefghij", -5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", -15);
- test("abcdefghij", 3, 3, "", 10);
- test("abcdefghij", 3, 3,"abcde", 5);
- test("abcdefghij", 3, 3, "def", 0);
- test("abcdefghij", 0, 4, "abcdefghijklmnopqrst", -10);
- test("abcdefghijklmnopqrst", 5, 5, "", 20);
- test("abcdefghijklmnopqrst", 0, 8, "abcde", 15);
- test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 0, -1, "abcdefghijklmnopqrst", 0);
- }
-
- {
- test(L"", 0, 0, L"", 0);
- test(L"", 0, 0, L"abcde", -5);
- test(L"", 0, 0, L"abcdefghij", -10);
- test(L"", 0, 0, L"abcdefghijklmnopqrst", -20);
- test(L"abcde", 0, 2, L"", 5);
- test(L"abcde", 0, 6, L"abcde", 0);
- test(L"abcde", 0, 6, L"abcdefghij", -5);
- test(L"abcde", 0, 6, L"abcdefghijklmnopqrst", -15);
- test(L"abcdefghij", 3, 3, L"", 10);
- test(L"abcdefghij", 3, 3, L"abcde", 5);
- test(L"abcdefghij", 3, 3, L"def", 0);
- test(L"abcdefghij", 0, 4, L"abcdefghijklmnopqrst", -10);
- test(L"abcdefghijklmnopqrst", 5, 5, L"", 20);
- test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15);
- test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
- test(L"abcdefghijklmnopqrst", 0, -1, L"abcdefghijklmnopqrst", 0);
- }
-
-#if TEST_STD_VER >= 11
- {
- test(U"", 0, 0, U"", 0);
- test(U"", 0, 0, U"abcde", -5);
- test(U"", 0, 0, U"abcdefghij", -10);
- test(U"", 0, 0, U"abcdefghijklmnopqrst", -20);
- test(U"abcde", 0, 2, U"", 5);
- test(U"abcde", 0, 6, U"abcde", 0);
- test(U"abcde", 0, 6, U"abcdefghij", -5);
- test(U"abcde", 0, 6, U"abcdefghijklmnopqrst", -15);
- test(U"abcdefghij", 3, 3, U"", 10);
- test(U"abcdefghij", 3, 3, U"abcde", 5);
- test(U"abcdefghij", 3, 3, U"def", 0);
- test(U"abcdefghij", 0, 4, U"abcdefghijklmnopqrst", -10);
- test(U"abcdefghijklmnopqrst", 5, 5, U"", 20);
- test(U"abcdefghijklmnopqrst", 0, 8, U"abcde", 15);
- test(U"abcdefghijklmnopqrst", 0, 12, U"abcdefghij", 10);
- test(U"abcdefghijklmnopqrst", 0, -1, U"abcdefghijklmnopqrst", 0);
- }
-
- {
- test(u"", 0, 0, u"", 0);
- test(u"", 0, 0, u"abcde", -5);
- test(u"", 0, 0, u"abcdefghij", -10);
- test(u"", 0, 0, u"abcdefghijklmnopqrst", -20);
- test(u"abcde", 0, 2, u"", 5);
- test(u"abcde", 0, 6, u"abcde", 0);
- test(u"abcde", 0, 6, u"abcdefghij", -5);
- test(u"abcde", 0, 6, u"abcdefghijklmnopqrst", -15);
- test(u"abcdefghij", 3, 3, u"", 10);
- test(u"abcdefghij", 3, 3, u"abcde", 5);
- test(u"abcdefghij", 3, 3, u"def", 0);
- test(u"abcdefghij", 0, 4, u"abcdefghijklmnopqrst", -10);
- test(u"abcdefghijklmnopqrst", 5, 5, u"", 20);
- test(u"abcdefghijklmnopqrst", 0, 8, u"abcde", 15);
- test(u"abcdefghijklmnopqrst", 0, 12, u"abcdefghij", 10);
- test(u"abcdefghijklmnopqrst", 0, -1, u"abcdefghijklmnopqrst", 0);
- }
-#endif
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcde", 5 };
- static_assert ( sv1.compare(0, 0, "") == 0, "" );
- static_assert ( sv1.compare(0, 0, "abcde") == -1, "" );
- static_assert ( sv2.compare(0, 2, "") == 1, "" );
- static_assert ( sv2.compare(0, 6, "abcde") == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp
deleted file mode 100644
index 2684d903405e..000000000000
--- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp
+++ /dev/null
@@ -1,403 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
- std::experimental::basic_string_view<CharT> sv2, int expected ) {
-
- if (pos1 > sv1.size()) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- sv1.compare(pos1, n1, sv2);
- assert(false);
- } catch (const std::out_of_range&) {
- } catch (...) {
- assert(false);
- }
-#endif
- } else {
- assert ( sign( sv1.compare(pos1, n1, sv2)) == sign(expected));
- }
-}
-
-
-template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
- string_view_t sv1 ( s1 );
- string_view_t sv2 ( s2 );
- test1(sv1, pos1, n1, sv2, expected);
-}
-
-void test0()
-{
- test("", 0, 0, "", 0);
- test("", 0, 0, "abcde", -5);
- test("", 0, 0, "abcdefghij", -10);
- test("", 0, 0, "abcdefghijklmnopqrst", -20);
- test("", 0, 1, "", 0);
- test("", 0, 1, "abcde", -5);
- test("", 0, 1, "abcdefghij", -10);
- test("", 0, 1, "abcdefghijklmnopqrst", -20);
- test("", 1, 0, "", 0);
- test("", 1, 0, "abcde", 0);
- test("", 1, 0, "abcdefghij", 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0);
- test("abcde", 0, 0, "", 0);
- test("abcde", 0, 0, "abcde", -5);
- test("abcde", 0, 0, "abcdefghij", -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 0, 1, "", 1);
- test("abcde", 0, 1, "abcde", -4);
- test("abcde", 0, 1, "abcdefghij", -9);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", -19);
- test("abcde", 0, 2, "", 2);
- test("abcde", 0, 2, "abcde", -3);
- test("abcde", 0, 2, "abcdefghij", -8);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", -18);
- test("abcde", 0, 4, "", 4);
- test("abcde", 0, 4, "abcde", -1);
- test("abcde", 0, 4, "abcdefghij", -6);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", -16);
- test("abcde", 0, 5, "", 5);
- test("abcde", 0, 5, "abcde", 0);
- test("abcde", 0, 5, "abcdefghij", -5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", -15);
- test("abcde", 0, 6, "", 5);
- test("abcde", 0, 6, "abcde", 0);
- test("abcde", 0, 6, "abcdefghij", -5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", -15);
- test("abcde", 1, 0, "", 0);
- test("abcde", 1, 0, "abcde", -5);
- test("abcde", 1, 0, "abcdefghij", -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 1, 1, "", 1);
- test("abcde", 1, 1, "abcde", 1);
- test("abcde", 1, 1, "abcdefghij", 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 2, "", 2);
- test("abcde", 1, 2, "abcde", 1);
- test("abcde", 1, 2, "abcdefghij", 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 3, "", 3);
- test("abcde", 1, 3, "abcde", 1);
- test("abcde", 1, 3, "abcdefghij", 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 4, "", 4);
- test("abcde", 1, 4, "abcde", 1);
- test("abcde", 1, 4, "abcdefghij", 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1);
- test("abcde", 1, 5, "", 4);
- test("abcde", 1, 5, "abcde", 1);
- test("abcde", 1, 5, "abcdefghij", 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1);
- test("abcde", 2, 0, "", 0);
- test("abcde", 2, 0, "abcde", -5);
- test("abcde", 2, 0, "abcdefghij", -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 2, 1, "", 1);
- test("abcde", 2, 1, "abcde", 2);
- test("abcde", 2, 1, "abcdefghij", 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 2);
- test("abcde", 2, 2, "", 2);
- test("abcde", 2, 2, "abcde", 2);
- test("abcde", 2, 2, "abcdefghij", 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 2);
- test("abcde", 2, 3, "", 3);
- test("abcde", 2, 3, "abcde", 2);
- test("abcde", 2, 3, "abcdefghij", 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 2);
- test("abcde", 2, 4, "", 3);
- test("abcde", 2, 4, "abcde", 2);
- test("abcde", 2, 4, "abcdefghij", 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 2);
- test("abcde", 4, 0, "", 0);
- test("abcde", 4, 0, "abcde", -5);
- test("abcde", 4, 0, "abcdefghij", -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 4, 1, "", 1);
- test("abcde", 4, 1, "abcde", 4);
- test("abcde", 4, 1, "abcdefghij", 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 4);
- test("abcde", 4, 2, "", 1);
- test("abcde", 4, 2, "abcde", 4);
- test("abcde", 4, 2, "abcdefghij", 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 4);
- test("abcde", 5, 0, "", 0);
- test("abcde", 5, 0, "abcde", -5);
- test("abcde", 5, 0, "abcdefghij", -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", -20);
- test("abcde", 5, 1, "", 0);
- test("abcde", 5, 1, "abcde", -5);
- test("abcde", 5, 1, "abcdefghij", -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", -20);
-}
-
-void test1()
-{
- test("abcde", 6, 0, "", 0);
- test("abcde", 6, 0, "abcde", 0);
- test("abcde", 6, 0, "abcdefghij", 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0);
- test("abcdefghij", 0, 0, "", 0);
- test("abcdefghij", 0, 0, "abcde", -5);
- test("abcdefghij", 0, 0, "abcdefghij", -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 0, 1, "", 1);
- test("abcdefghij", 0, 1, "abcde", -4);
- test("abcdefghij", 0, 1, "abcdefghij", -9);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", -19);
- test("abcdefghij", 0, 5, "", 5);
- test("abcdefghij", 0, 5, "abcde", 0);
- test("abcdefghij", 0, 5, "abcdefghij", -5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", -15);
- test("abcdefghij", 0, 9, "", 9);
- test("abcdefghij", 0, 9, "abcde", 4);
- test("abcdefghij", 0, 9, "abcdefghij", -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", -11);
- test("abcdefghij", 0, 10, "", 10);
- test("abcdefghij", 0, 10, "abcde", 5);
- test("abcdefghij", 0, 10, "abcdefghij", 0);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", -10);
- test("abcdefghij", 0, 11, "", 10);
- test("abcdefghij", 0, 11, "abcde", 5);
- test("abcdefghij", 0, 11, "abcdefghij", 0);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", -10);
- test("abcdefghij", 1, 0, "", 0);
- test("abcdefghij", 1, 0, "abcde", -5);
- test("abcdefghij", 1, 0, "abcdefghij", -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 1, 1, "", 1);
- test("abcdefghij", 1, 1, "abcde", 1);
- test("abcdefghij", 1, 1, "abcdefghij", 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 4, "", 4);
- test("abcdefghij", 1, 4, "abcde", 1);
- test("abcdefghij", 1, 4, "abcdefghij", 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 8, "", 8);
- test("abcdefghij", 1, 8, "abcde", 1);
- test("abcdefghij", 1, 8, "abcdefghij", 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 9, "", 9);
- test("abcdefghij", 1, 9, "abcde", 1);
- test("abcdefghij", 1, 9, "abcdefghij", 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 1, 10, "", 9);
- test("abcdefghij", 1, 10, "abcde", 1);
- test("abcdefghij", 1, 10, "abcdefghij", 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1);
- test("abcdefghij", 5, 0, "", 0);
- test("abcdefghij", 5, 0, "abcde", -5);
- test("abcdefghij", 5, 0, "abcdefghij", -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 5, 1, "", 1);
- test("abcdefghij", 5, 1, "abcde", 5);
- test("abcdefghij", 5, 1, "abcdefghij", 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 2, "", 2);
- test("abcdefghij", 5, 2, "abcde", 5);
- test("abcdefghij", 5, 2, "abcdefghij", 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 4, "", 4);
- test("abcdefghij", 5, 4, "abcde", 5);
- test("abcdefghij", 5, 4, "abcdefghij", 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 5, "", 5);
- test("abcdefghij", 5, 5, "abcde", 5);
- test("abcdefghij", 5, 5, "abcdefghij", 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 5, 6, "", 5);
- test("abcdefghij", 5, 6, "abcde", 5);
- test("abcdefghij", 5, 6, "abcdefghij", 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 5);
- test("abcdefghij", 9, 0, "", 0);
- test("abcdefghij", 9, 0, "abcde", -5);
- test("abcdefghij", 9, 0, "abcdefghij", -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 9, 1, "", 1);
- test("abcdefghij", 9, 1, "abcde", 9);
- test("abcdefghij", 9, 1, "abcdefghij", 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 9);
- test("abcdefghij", 9, 2, "", 1);
- test("abcdefghij", 9, 2, "abcde", 9);
- test("abcdefghij", 9, 2, "abcdefghij", 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 9);
- test("abcdefghij", 10, 0, "", 0);
- test("abcdefghij", 10, 0, "abcde", -5);
- test("abcdefghij", 10, 0, "abcdefghij", -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 10, 1, "", 0);
- test("abcdefghij", 10, 1, "abcde", -5);
- test("abcdefghij", 10, 1, "abcdefghij", -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", -20);
- test("abcdefghij", 11, 0, "", 0);
- test("abcdefghij", 11, 0, "abcde", 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0);
-}
-
-void test2()
-{
- test("abcdefghijklmnopqrst", 0, 0, "", 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 0, 1, "", 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", -19);
- test("abcdefghijklmnopqrst", 0, 10, "", 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", -10);
- test("abcdefghijklmnopqrst", 0, 19, "", 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", -1);
- test("abcdefghijklmnopqrst", 0, 20, "", 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0);
- test("abcdefghijklmnopqrst", 0, 21, "", 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0);
- test("abcdefghijklmnopqrst", 1, 0, "", 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 1, 1, "", 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 9, "", 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 18, "", 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 19, "", 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 1, 20, "", 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1);
- test("abcdefghijklmnopqrst", 10, 0, "", 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 10, 1, "", 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 5, "", 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 9, "", 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 10, "", 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 10, 11, "", 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10);
- test("abcdefghijklmnopqrst", 19, 0, "", 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 19, 1, "", 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19);
- test("abcdefghijklmnopqrst", 19, 2, "", 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19);
- test("abcdefghijklmnopqrst", 20, 0, "", 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 20, 1, "", 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", -20);
- test("abcdefghijklmnopqrst", 21, 0, "", 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0);
-}
-
-
-int main () {
- test0();
- test1();
- test2();
-
- {
- test("abcde", 5, 1, "", 0);
- test("abcde", 2, 4, "", 3);
- test("abcde", 2, 4, "abcde", 2);
- test("ABCde", 2, 4, "abcde", -1);
- }
-
- {
- test(L"abcde", 5, 1, L"", 0);
- test(L"abcde", 2, 4, L"", 3);
- test(L"abcde", 2, 4, L"abcde", 2);
- test(L"ABCde", 2, 4, L"abcde", -1);
- }
-
-#if TEST_STD_VER >= 11
- {
- test(u"abcde", 5, 1, u"", 0);
- test(u"abcde", 2, 4, u"", 3);
- test(u"abcde", 2, 4, u"abcde", 2);
- test(u"ABCde", 2, 4, u"abcde", -1);
- }
-
- {
- test(U"abcde", 5, 1, U"", 0);
- test(U"abcde", 2, 4, U"", 3);
- test(U"abcde", 2, 4, U"abcde", 2);
- test(U"ABCde", 2, 4, U"abcde", -1);
- }
-#endif
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1 { "abcde", 5 };
- constexpr SV sv2 { "abcde", 0 };
- static_assert ( sv1.compare(5, 1, sv2) == 0, "" );
- static_assert ( sv1.compare(2, 4, sv2) == 1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
deleted file mode 100644
index 69de6335fb5c..000000000000
--- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
+++ /dev/null
@@ -1,1356 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr int compare(size_type pos1, size_type n1,
-// const charT* s, size_type n2) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
- const CharT *s2, size_t n2,
- int expected ) {
- if (pos1 > sv1.size()) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- sv1.compare(pos1, n1, s2, n2);
- assert(false);
- } catch (const std::out_of_range&) {
- return;
- } catch (...) {
- assert(false);
- }
-#endif
- } else {
- assert(sign(sv1.compare(pos1, n1, s2, n2)) == sign(expected));
- }
-
-}
-
-
-template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1,
- const CharT *s2, size_t n2,
- int expected ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
- string_view_t sv1 ( s1 );
- test1 (sv1, pos1, n1, s2, n2, expected);
-}
-
-
-void test0()
-{
- test("", 0, 0, "", 0, 0);
- test("", 0, 0, "abcde", 0, 0);
- test("", 0, 0, "abcde", 1, -1);
- test("", 0, 0, "abcde", 2, -2);
- test("", 0, 0, "abcde", 4, -4);
- test("", 0, 0, "abcde", 5, -5);
- test("", 0, 0, "abcdefghij", 0, 0);
- test("", 0, 0, "abcdefghij", 1, -1);
- test("", 0, 0, "abcdefghij", 5, -5);
- test("", 0, 0, "abcdefghij", 9, -9);
- test("", 0, 0, "abcdefghij", 10, -10);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, -1);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, -10);
- test("", 0, 0, "abcdefghijklmnopqrst", 19, -19);
- test("", 0, 0, "abcdefghijklmnopqrst", 20, -20);
- test("", 0, 1, "", 0, 0);
- test("", 0, 1, "abcde", 0, 0);
- test("", 0, 1, "abcde", 1, -1);
- test("", 0, 1, "abcde", 2, -2);
- test("", 0, 1, "abcde", 4, -4);
- test("", 0, 1, "abcde", 5, -5);
- test("", 0, 1, "abcdefghij", 0, 0);
- test("", 0, 1, "abcdefghij", 1, -1);
- test("", 0, 1, "abcdefghij", 5, -5);
- test("", 0, 1, "abcdefghij", 9, -9);
- test("", 0, 1, "abcdefghij", 10, -10);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, -1);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, -10);
- test("", 0, 1, "abcdefghijklmnopqrst", 19, -19);
- test("", 0, 1, "abcdefghijklmnopqrst", 20, -20);
- test("", 1, 0, "", 0, 0);
- test("", 1, 0, "abcde", 0, 0);
- test("", 1, 0, "abcde", 1, 0);
- test("", 1, 0, "abcde", 2, 0);
- test("", 1, 0, "abcde", 4, 0);
- test("", 1, 0, "abcde", 5, 0);
- test("", 1, 0, "abcdefghij", 0, 0);
- test("", 1, 0, "abcdefghij", 1, 0);
- test("", 1, 0, "abcdefghij", 5, 0);
- test("", 1, 0, "abcdefghij", 9, 0);
- test("", 1, 0, "abcdefghij", 10, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 19, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 20, 0);
- test("abcde", 0, 0, "", 0, 0);
- test("abcde", 0, 0, "abcde", 0, 0);
- test("abcde", 0, 0, "abcde", 1, -1);
- test("abcde", 0, 0, "abcde", 2, -2);
- test("abcde", 0, 0, "abcde", 4, -4);
- test("abcde", 0, 0, "abcde", 5, -5);
- test("abcde", 0, 0, "abcdefghij", 0, 0);
- test("abcde", 0, 0, "abcdefghij", 1, -1);
- test("abcde", 0, 0, "abcdefghij", 5, -5);
- test("abcde", 0, 0, "abcdefghij", 9, -9);
- test("abcde", 0, 0, "abcdefghij", 10, -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcde", 0, 1, "", 0, 1);
- test("abcde", 0, 1, "abcde", 0, 1);
- test("abcde", 0, 1, "abcde", 1, 0);
- test("abcde", 0, 1, "abcde", 2, -1);
- test("abcde", 0, 1, "abcde", 4, -3);
- test("abcde", 0, 1, "abcde", 5, -4);
- test("abcde", 0, 1, "abcdefghij", 0, 1);
- test("abcde", 0, 1, "abcdefghij", 1, 0);
- test("abcde", 0, 1, "abcdefghij", 5, -4);
- test("abcde", 0, 1, "abcdefghij", 9, -8);
- test("abcde", 0, 1, "abcdefghij", 10, -9);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 0);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, -9);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, -18);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, -19);
- test("abcde", 0, 2, "", 0, 2);
- test("abcde", 0, 2, "abcde", 0, 2);
- test("abcde", 0, 2, "abcde", 1, 1);
- test("abcde", 0, 2, "abcde", 2, 0);
- test("abcde", 0, 2, "abcde", 4, -2);
- test("abcde", 0, 2, "abcde", 5, -3);
- test("abcde", 0, 2, "abcdefghij", 0, 2);
- test("abcde", 0, 2, "abcdefghij", 1, 1);
- test("abcde", 0, 2, "abcdefghij", 5, -3);
- test("abcde", 0, 2, "abcdefghij", 9, -7);
- test("abcde", 0, 2, "abcdefghij", 10, -8);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, -8);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, -17);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, -18);
- test("abcde", 0, 4, "", 0, 4);
- test("abcde", 0, 4, "abcde", 0, 4);
- test("abcde", 0, 4, "abcde", 1, 3);
- test("abcde", 0, 4, "abcde", 2, 2);
-}
-
-
-void test1()
-{
- test("abcde", 0, 4, "abcde", 4, 0);
- test("abcde", 0, 4, "abcde", 5, -1);
- test("abcde", 0, 4, "abcdefghij", 0, 4);
- test("abcde", 0, 4, "abcdefghij", 1, 3);
- test("abcde", 0, 4, "abcdefghij", 5, -1);
- test("abcde", 0, 4, "abcdefghij", 9, -5);
- test("abcde", 0, 4, "abcdefghij", 10, -6);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 3);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, -6);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, -15);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, -16);
- test("abcde", 0, 5, "", 0, 5);
- test("abcde", 0, 5, "abcde", 0, 5);
- test("abcde", 0, 5, "abcde", 1, 4);
- test("abcde", 0, 5, "abcde", 2, 3);
- test("abcde", 0, 5, "abcde", 4, 1);
- test("abcde", 0, 5, "abcde", 5, 0);
- test("abcde", 0, 5, "abcdefghij", 0, 5);
- test("abcde", 0, 5, "abcdefghij", 1, 4);
- test("abcde", 0, 5, "abcdefghij", 5, 0);
- test("abcde", 0, 5, "abcdefghij", 9, -4);
- test("abcde", 0, 5, "abcdefghij", 10, -5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 4);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, -5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, -14);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, -15);
- test("abcde", 0, 6, "", 0, 5);
- test("abcde", 0, 6, "abcde", 0, 5);
- test("abcde", 0, 6, "abcde", 1, 4);
- test("abcde", 0, 6, "abcde", 2, 3);
- test("abcde", 0, 6, "abcde", 4, 1);
- test("abcde", 0, 6, "abcde", 5, 0);
- test("abcde", 0, 6, "abcdefghij", 0, 5);
- test("abcde", 0, 6, "abcdefghij", 1, 4);
- test("abcde", 0, 6, "abcdefghij", 5, 0);
- test("abcde", 0, 6, "abcdefghij", 9, -4);
- test("abcde", 0, 6, "abcdefghij", 10, -5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 4);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, -5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, -14);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, -15);
- test("abcde", 1, 0, "", 0, 0);
- test("abcde", 1, 0, "abcde", 0, 0);
- test("abcde", 1, 0, "abcde", 1, -1);
- test("abcde", 1, 0, "abcde", 2, -2);
- test("abcde", 1, 0, "abcde", 4, -4);
- test("abcde", 1, 0, "abcde", 5, -5);
- test("abcde", 1, 0, "abcdefghij", 0, 0);
- test("abcde", 1, 0, "abcdefghij", 1, -1);
- test("abcde", 1, 0, "abcdefghij", 5, -5);
- test("abcde", 1, 0, "abcdefghij", 9, -9);
- test("abcde", 1, 0, "abcdefghij", 10, -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcde", 1, 1, "", 0, 1);
- test("abcde", 1, 1, "abcde", 0, 1);
- test("abcde", 1, 1, "abcde", 1, 1);
- test("abcde", 1, 1, "abcde", 2, 1);
- test("abcde", 1, 1, "abcde", 4, 1);
- test("abcde", 1, 1, "abcde", 5, 1);
- test("abcde", 1, 1, "abcdefghij", 0, 1);
- test("abcde", 1, 1, "abcdefghij", 1, 1);
- test("abcde", 1, 1, "abcdefghij", 5, 1);
- test("abcde", 1, 1, "abcdefghij", 9, 1);
- test("abcde", 1, 1, "abcdefghij", 10, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 1);
- test("abcde", 1, 2, "", 0, 2);
- test("abcde", 1, 2, "abcde", 0, 2);
- test("abcde", 1, 2, "abcde", 1, 1);
- test("abcde", 1, 2, "abcde", 2, 1);
- test("abcde", 1, 2, "abcde", 4, 1);
- test("abcde", 1, 2, "abcde", 5, 1);
- test("abcde", 1, 2, "abcdefghij", 0, 2);
- test("abcde", 1, 2, "abcdefghij", 1, 1);
- test("abcde", 1, 2, "abcdefghij", 5, 1);
- test("abcde", 1, 2, "abcdefghij", 9, 1);
- test("abcde", 1, 2, "abcdefghij", 10, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 1);
- test("abcde", 1, 3, "", 0, 3);
- test("abcde", 1, 3, "abcde", 0, 3);
- test("abcde", 1, 3, "abcde", 1, 1);
- test("abcde", 1, 3, "abcde", 2, 1);
- test("abcde", 1, 3, "abcde", 4, 1);
- test("abcde", 1, 3, "abcde", 5, 1);
- test("abcde", 1, 3, "abcdefghij", 0, 3);
- test("abcde", 1, 3, "abcdefghij", 1, 1);
-}
-
-
-void test2()
-{
- test("abcde", 1, 3, "abcdefghij", 5, 1);
- test("abcde", 1, 3, "abcdefghij", 9, 1);
- test("abcde", 1, 3, "abcdefghij", 10, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 1);
- test("abcde", 1, 4, "", 0, 4);
- test("abcde", 1, 4, "abcde", 0, 4);
- test("abcde", 1, 4, "abcde", 1, 1);
- test("abcde", 1, 4, "abcde", 2, 1);
- test("abcde", 1, 4, "abcde", 4, 1);
- test("abcde", 1, 4, "abcde", 5, 1);
- test("abcde", 1, 4, "abcdefghij", 0, 4);
- test("abcde", 1, 4, "abcdefghij", 1, 1);
- test("abcde", 1, 4, "abcdefghij", 5, 1);
- test("abcde", 1, 4, "abcdefghij", 9, 1);
- test("abcde", 1, 4, "abcdefghij", 10, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 1);
- test("abcde", 1, 5, "", 0, 4);
- test("abcde", 1, 5, "abcde", 0, 4);
- test("abcde", 1, 5, "abcde", 1, 1);
- test("abcde", 1, 5, "abcde", 2, 1);
- test("abcde", 1, 5, "abcde", 4, 1);
- test("abcde", 1, 5, "abcde", 5, 1);
- test("abcde", 1, 5, "abcdefghij", 0, 4);
- test("abcde", 1, 5, "abcdefghij", 1, 1);
- test("abcde", 1, 5, "abcdefghij", 5, 1);
- test("abcde", 1, 5, "abcdefghij", 9, 1);
- test("abcde", 1, 5, "abcdefghij", 10, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 1);
- test("abcde", 2, 0, "", 0, 0);
- test("abcde", 2, 0, "abcde", 0, 0);
- test("abcde", 2, 0, "abcde", 1, -1);
- test("abcde", 2, 0, "abcde", 2, -2);
- test("abcde", 2, 0, "abcde", 4, -4);
- test("abcde", 2, 0, "abcde", 5, -5);
- test("abcde", 2, 0, "abcdefghij", 0, 0);
- test("abcde", 2, 0, "abcdefghij", 1, -1);
- test("abcde", 2, 0, "abcdefghij", 5, -5);
- test("abcde", 2, 0, "abcdefghij", 9, -9);
- test("abcde", 2, 0, "abcdefghij", 10, -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcde", 2, 1, "", 0, 1);
- test("abcde", 2, 1, "abcde", 0, 1);
- test("abcde", 2, 1, "abcde", 1, 2);
- test("abcde", 2, 1, "abcde", 2, 2);
- test("abcde", 2, 1, "abcde", 4, 2);
- test("abcde", 2, 1, "abcde", 5, 2);
- test("abcde", 2, 1, "abcdefghij", 0, 1);
- test("abcde", 2, 1, "abcdefghij", 1, 2);
- test("abcde", 2, 1, "abcdefghij", 5, 2);
- test("abcde", 2, 1, "abcdefghij", 9, 2);
- test("abcde", 2, 1, "abcdefghij", 10, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 2);
- test("abcde", 2, 2, "", 0, 2);
- test("abcde", 2, 2, "abcde", 0, 2);
- test("abcde", 2, 2, "abcde", 1, 2);
- test("abcde", 2, 2, "abcde", 2, 2);
- test("abcde", 2, 2, "abcde", 4, 2);
- test("abcde", 2, 2, "abcde", 5, 2);
- test("abcde", 2, 2, "abcdefghij", 0, 2);
- test("abcde", 2, 2, "abcdefghij", 1, 2);
- test("abcde", 2, 2, "abcdefghij", 5, 2);
- test("abcde", 2, 2, "abcdefghij", 9, 2);
- test("abcde", 2, 2, "abcdefghij", 10, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 2);
- test("abcde", 2, 3, "", 0, 3);
- test("abcde", 2, 3, "abcde", 0, 3);
- test("abcde", 2, 3, "abcde", 1, 2);
- test("abcde", 2, 3, "abcde", 2, 2);
- test("abcde", 2, 3, "abcde", 4, 2);
- test("abcde", 2, 3, "abcde", 5, 2);
- test("abcde", 2, 3, "abcdefghij", 0, 3);
- test("abcde", 2, 3, "abcdefghij", 1, 2);
- test("abcde", 2, 3, "abcdefghij", 5, 2);
- test("abcde", 2, 3, "abcdefghij", 9, 2);
- test("abcde", 2, 3, "abcdefghij", 10, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 3);
-}
-
-
-void test3()
-{
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 2);
- test("abcde", 2, 4, "", 0, 3);
- test("abcde", 2, 4, "abcde", 0, 3);
- test("abcde", 2, 4, "abcde", 1, 2);
- test("abcde", 2, 4, "abcde", 2, 2);
- test("abcde", 2, 4, "abcde", 4, 2);
- test("abcde", 2, 4, "abcde", 5, 2);
- test("abcde", 2, 4, "abcdefghij", 0, 3);
- test("abcde", 2, 4, "abcdefghij", 1, 2);
- test("abcde", 2, 4, "abcdefghij", 5, 2);
- test("abcde", 2, 4, "abcdefghij", 9, 2);
- test("abcde", 2, 4, "abcdefghij", 10, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 2);
- test("abcde", 4, 0, "", 0, 0);
- test("abcde", 4, 0, "abcde", 0, 0);
- test("abcde", 4, 0, "abcde", 1, -1);
- test("abcde", 4, 0, "abcde", 2, -2);
- test("abcde", 4, 0, "abcde", 4, -4);
- test("abcde", 4, 0, "abcde", 5, -5);
- test("abcde", 4, 0, "abcdefghij", 0, 0);
- test("abcde", 4, 0, "abcdefghij", 1, -1);
- test("abcde", 4, 0, "abcdefghij", 5, -5);
- test("abcde", 4, 0, "abcdefghij", 9, -9);
- test("abcde", 4, 0, "abcdefghij", 10, -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcde", 4, 1, "", 0, 1);
- test("abcde", 4, 1, "abcde", 0, 1);
- test("abcde", 4, 1, "abcde", 1, 4);
- test("abcde", 4, 1, "abcde", 2, 4);
- test("abcde", 4, 1, "abcde", 4, 4);
- test("abcde", 4, 1, "abcde", 5, 4);
- test("abcde", 4, 1, "abcdefghij", 0, 1);
- test("abcde", 4, 1, "abcdefghij", 1, 4);
- test("abcde", 4, 1, "abcdefghij", 5, 4);
- test("abcde", 4, 1, "abcdefghij", 9, 4);
- test("abcde", 4, 1, "abcdefghij", 10, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 4);
- test("abcde", 4, 2, "", 0, 1);
- test("abcde", 4, 2, "abcde", 0, 1);
- test("abcde", 4, 2, "abcde", 1, 4);
- test("abcde", 4, 2, "abcde", 2, 4);
- test("abcde", 4, 2, "abcde", 4, 4);
- test("abcde", 4, 2, "abcde", 5, 4);
- test("abcde", 4, 2, "abcdefghij", 0, 1);
- test("abcde", 4, 2, "abcdefghij", 1, 4);
- test("abcde", 4, 2, "abcdefghij", 5, 4);
- test("abcde", 4, 2, "abcdefghij", 9, 4);
- test("abcde", 4, 2, "abcdefghij", 10, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 1);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 4);
- test("abcde", 5, 0, "", 0, 0);
- test("abcde", 5, 0, "abcde", 0, 0);
- test("abcde", 5, 0, "abcde", 1, -1);
- test("abcde", 5, 0, "abcde", 2, -2);
- test("abcde", 5, 0, "abcde", 4, -4);
- test("abcde", 5, 0, "abcde", 5, -5);
- test("abcde", 5, 0, "abcdefghij", 0, 0);
- test("abcde", 5, 0, "abcdefghij", 1, -1);
- test("abcde", 5, 0, "abcdefghij", 5, -5);
- test("abcde", 5, 0, "abcdefghij", 9, -9);
- test("abcde", 5, 0, "abcdefghij", 10, -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcde", 5, 1, "", 0, 0);
- test("abcde", 5, 1, "abcde", 0, 0);
- test("abcde", 5, 1, "abcde", 1, -1);
- test("abcde", 5, 1, "abcde", 2, -2);
- test("abcde", 5, 1, "abcde", 4, -4);
- test("abcde", 5, 1, "abcde", 5, -5);
- test("abcde", 5, 1, "abcdefghij", 0, 0);
- test("abcde", 5, 1, "abcdefghij", 1, -1);
- test("abcde", 5, 1, "abcdefghij", 5, -5);
- test("abcde", 5, 1, "abcdefghij", 9, -9);
- test("abcde", 5, 1, "abcdefghij", 10, -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, -1);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, -19);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, -20);
-}
-
-
-void test4()
-{
- test("abcde", 6, 0, "", 0, 0);
- test("abcde", 6, 0, "abcde", 0, 0);
- test("abcde", 6, 0, "abcde", 1, 0);
- test("abcde", 6, 0, "abcde", 2, 0);
- test("abcde", 6, 0, "abcde", 4, 0);
- test("abcde", 6, 0, "abcde", 5, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 0);
- test("abcde", 6, 0, "abcdefghij", 9, 0);
- test("abcde", 6, 0, "abcdefghij", 10, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 0);
- test("abcdefghij", 0, 0, "", 0, 0);
- test("abcdefghij", 0, 0, "abcde", 0, 0);
- test("abcdefghij", 0, 0, "abcde", 1, -1);
- test("abcdefghij", 0, 0, "abcde", 2, -2);
- test("abcdefghij", 0, 0, "abcde", 4, -4);
- test("abcdefghij", 0, 0, "abcde", 5, -5);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 1, -1);
- test("abcdefghij", 0, 0, "abcdefghij", 5, -5);
- test("abcdefghij", 0, 0, "abcdefghij", 9, -9);
- test("abcdefghij", 0, 0, "abcdefghij", 10, -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghij", 0, 1, "", 0, 1);
- test("abcdefghij", 0, 1, "abcde", 0, 1);
- test("abcdefghij", 0, 1, "abcde", 1, 0);
- test("abcdefghij", 0, 1, "abcde", 2, -1);
- test("abcdefghij", 0, 1, "abcde", 4, -3);
- test("abcdefghij", 0, 1, "abcde", 5, -4);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 0);
- test("abcdefghij", 0, 1, "abcdefghij", 5, -4);
- test("abcdefghij", 0, 1, "abcdefghij", 9, -8);
- test("abcdefghij", 0, 1, "abcdefghij", 10, -9);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 0);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, -9);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, -18);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, -19);
- test("abcdefghij", 0, 5, "", 0, 5);
- test("abcdefghij", 0, 5, "abcde", 0, 5);
- test("abcdefghij", 0, 5, "abcde", 1, 4);
- test("abcdefghij", 0, 5, "abcde", 2, 3);
- test("abcdefghij", 0, 5, "abcde", 4, 1);
- test("abcdefghij", 0, 5, "abcde", 5, 0);
- test("abcdefghij", 0, 5, "abcdefghij", 0, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 4);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 0);
- test("abcdefghij", 0, 5, "abcdefghij", 9, -4);
- test("abcdefghij", 0, 5, "abcdefghij", 10, -5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 4);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, -5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, -14);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, -15);
- test("abcdefghij", 0, 9, "", 0, 9);
- test("abcdefghij", 0, 9, "abcde", 0, 9);
- test("abcdefghij", 0, 9, "abcde", 1, 8);
- test("abcdefghij", 0, 9, "abcde", 2, 7);
- test("abcdefghij", 0, 9, "abcde", 4, 5);
- test("abcdefghij", 0, 9, "abcde", 5, 4);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 8);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 4);
- test("abcdefghij", 0, 9, "abcdefghij", 9, 0);
- test("abcdefghij", 0, 9, "abcdefghij", 10, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 8);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, -10);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, -11);
- test("abcdefghij", 0, 10, "", 0, 10);
- test("abcdefghij", 0, 10, "abcde", 0, 10);
- test("abcdefghij", 0, 10, "abcde", 1, 9);
- test("abcdefghij", 0, 10, "abcde", 2, 8);
- test("abcdefghij", 0, 10, "abcde", 4, 6);
- test("abcdefghij", 0, 10, "abcde", 5, 5);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 9);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 5);
- test("abcdefghij", 0, 10, "abcdefghij", 9, 1);
- test("abcdefghij", 0, 10, "abcdefghij", 10, 0);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 9);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 0);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, -9);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, -10);
- test("abcdefghij", 0, 11, "", 0, 10);
- test("abcdefghij", 0, 11, "abcde", 0, 10);
- test("abcdefghij", 0, 11, "abcde", 1, 9);
- test("abcdefghij", 0, 11, "abcde", 2, 8);
-}
-
-
-void test5()
-{
- test("abcdefghij", 0, 11, "abcde", 4, 6);
- test("abcdefghij", 0, 11, "abcde", 5, 5);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 9);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 5);
- test("abcdefghij", 0, 11, "abcdefghij", 9, 1);
- test("abcdefghij", 0, 11, "abcdefghij", 10, 0);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 9);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 0);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, -9);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, -10);
- test("abcdefghij", 1, 0, "", 0, 0);
- test("abcdefghij", 1, 0, "abcde", 0, 0);
- test("abcdefghij", 1, 0, "abcde", 1, -1);
- test("abcdefghij", 1, 0, "abcde", 2, -2);
- test("abcdefghij", 1, 0, "abcde", 4, -4);
- test("abcdefghij", 1, 0, "abcde", 5, -5);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 1, -1);
- test("abcdefghij", 1, 0, "abcdefghij", 5, -5);
- test("abcdefghij", 1, 0, "abcdefghij", 9, -9);
- test("abcdefghij", 1, 0, "abcdefghij", 10, -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghij", 1, 1, "", 0, 1);
- test("abcdefghij", 1, 1, "abcde", 0, 1);
- test("abcdefghij", 1, 1, "abcde", 1, 1);
- test("abcdefghij", 1, 1, "abcde", 2, 1);
- test("abcdefghij", 1, 1, "abcde", 4, 1);
- test("abcdefghij", 1, 1, "abcde", 5, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 9, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 10, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghij", 1, 4, "", 0, 4);
- test("abcdefghij", 1, 4, "abcde", 0, 4);
- test("abcdefghij", 1, 4, "abcde", 1, 1);
- test("abcdefghij", 1, 4, "abcde", 2, 1);
- test("abcdefghij", 1, 4, "abcde", 4, 1);
- test("abcdefghij", 1, 4, "abcde", 5, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 9, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 10, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghij", 1, 8, "", 0, 8);
- test("abcdefghij", 1, 8, "abcde", 0, 8);
- test("abcdefghij", 1, 8, "abcde", 1, 1);
- test("abcdefghij", 1, 8, "abcde", 2, 1);
- test("abcdefghij", 1, 8, "abcde", 4, 1);
- test("abcdefghij", 1, 8, "abcde", 5, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 9, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 10, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghij", 1, 9, "", 0, 9);
- test("abcdefghij", 1, 9, "abcde", 0, 9);
- test("abcdefghij", 1, 9, "abcde", 1, 1);
- test("abcdefghij", 1, 9, "abcde", 2, 1);
- test("abcdefghij", 1, 9, "abcde", 4, 1);
- test("abcdefghij", 1, 9, "abcde", 5, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 1, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 9, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 10, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghij", 1, 10, "", 0, 9);
- test("abcdefghij", 1, 10, "abcde", 0, 9);
- test("abcdefghij", 1, 10, "abcde", 1, 1);
- test("abcdefghij", 1, 10, "abcde", 2, 1);
- test("abcdefghij", 1, 10, "abcde", 4, 1);
- test("abcdefghij", 1, 10, "abcde", 5, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 1);
-}
-
-
-void test6()
-{
- test("abcdefghij", 1, 10, "abcdefghij", 5, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 9, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 10, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghij", 5, 0, "", 0, 0);
- test("abcdefghij", 5, 0, "abcde", 0, 0);
- test("abcdefghij", 5, 0, "abcde", 1, -1);
- test("abcdefghij", 5, 0, "abcde", 2, -2);
- test("abcdefghij", 5, 0, "abcde", 4, -4);
- test("abcdefghij", 5, 0, "abcde", 5, -5);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 1, -1);
- test("abcdefghij", 5, 0, "abcdefghij", 5, -5);
- test("abcdefghij", 5, 0, "abcdefghij", 9, -9);
- test("abcdefghij", 5, 0, "abcdefghij", 10, -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghij", 5, 1, "", 0, 1);
- test("abcdefghij", 5, 1, "abcde", 0, 1);
- test("abcdefghij", 5, 1, "abcde", 1, 5);
- test("abcdefghij", 5, 1, "abcde", 2, 5);
- test("abcdefghij", 5, 1, "abcde", 4, 5);
- test("abcdefghij", 5, 1, "abcde", 5, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 9, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 10, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 5);
- test("abcdefghij", 5, 2, "", 0, 2);
- test("abcdefghij", 5, 2, "abcde", 0, 2);
- test("abcdefghij", 5, 2, "abcde", 1, 5);
- test("abcdefghij", 5, 2, "abcde", 2, 5);
- test("abcdefghij", 5, 2, "abcde", 4, 5);
- test("abcdefghij", 5, 2, "abcde", 5, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 5, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 9, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 10, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 5);
- test("abcdefghij", 5, 4, "", 0, 4);
- test("abcdefghij", 5, 4, "abcde", 0, 4);
- test("abcdefghij", 5, 4, "abcde", 1, 5);
- test("abcdefghij", 5, 4, "abcde", 2, 5);
- test("abcdefghij", 5, 4, "abcde", 4, 5);
- test("abcdefghij", 5, 4, "abcde", 5, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 9, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 10, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 5);
- test("abcdefghij", 5, 5, "", 0, 5);
- test("abcdefghij", 5, 5, "abcde", 0, 5);
- test("abcdefghij", 5, 5, "abcde", 1, 5);
- test("abcdefghij", 5, 5, "abcde", 2, 5);
- test("abcdefghij", 5, 5, "abcde", 4, 5);
- test("abcdefghij", 5, 5, "abcde", 5, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 9, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 10, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 5);
- test("abcdefghij", 5, 6, "", 0, 5);
- test("abcdefghij", 5, 6, "abcde", 0, 5);
- test("abcdefghij", 5, 6, "abcde", 1, 5);
- test("abcdefghij", 5, 6, "abcde", 2, 5);
- test("abcdefghij", 5, 6, "abcde", 4, 5);
- test("abcdefghij", 5, 6, "abcde", 5, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 9, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 10, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 5);
-}
-
-
-void test7()
-{
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 5);
- test("abcdefghij", 9, 0, "", 0, 0);
- test("abcdefghij", 9, 0, "abcde", 0, 0);
- test("abcdefghij", 9, 0, "abcde", 1, -1);
- test("abcdefghij", 9, 0, "abcde", 2, -2);
- test("abcdefghij", 9, 0, "abcde", 4, -4);
- test("abcdefghij", 9, 0, "abcde", 5, -5);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 1, -1);
- test("abcdefghij", 9, 0, "abcdefghij", 5, -5);
- test("abcdefghij", 9, 0, "abcdefghij", 9, -9);
- test("abcdefghij", 9, 0, "abcdefghij", 10, -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghij", 9, 1, "", 0, 1);
- test("abcdefghij", 9, 1, "abcde", 0, 1);
- test("abcdefghij", 9, 1, "abcde", 1, 9);
- test("abcdefghij", 9, 1, "abcde", 2, 9);
- test("abcdefghij", 9, 1, "abcde", 4, 9);
- test("abcdefghij", 9, 1, "abcde", 5, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 9, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 10, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 9);
- test("abcdefghij", 9, 2, "", 0, 1);
- test("abcdefghij", 9, 2, "abcde", 0, 1);
- test("abcdefghij", 9, 2, "abcde", 1, 9);
- test("abcdefghij", 9, 2, "abcde", 2, 9);
- test("abcdefghij", 9, 2, "abcde", 4, 9);
- test("abcdefghij", 9, 2, "abcde", 5, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 9, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 10, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 9);
- test("abcdefghij", 10, 0, "", 0, 0);
- test("abcdefghij", 10, 0, "abcde", 0, 0);
- test("abcdefghij", 10, 0, "abcde", 1, -1);
- test("abcdefghij", 10, 0, "abcde", 2, -2);
- test("abcdefghij", 10, 0, "abcde", 4, -4);
- test("abcdefghij", 10, 0, "abcde", 5, -5);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 1, -1);
- test("abcdefghij", 10, 0, "abcdefghij", 5, -5);
- test("abcdefghij", 10, 0, "abcdefghij", 9, -9);
- test("abcdefghij", 10, 0, "abcdefghij", 10, -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghij", 10, 1, "", 0, 0);
- test("abcdefghij", 10, 1, "abcde", 0, 0);
- test("abcdefghij", 10, 1, "abcde", 1, -1);
- test("abcdefghij", 10, 1, "abcde", 2, -2);
- test("abcdefghij", 10, 1, "abcde", 4, -4);
- test("abcdefghij", 10, 1, "abcde", 5, -5);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 1, -1);
- test("abcdefghij", 10, 1, "abcdefghij", 5, -5);
- test("abcdefghij", 10, 1, "abcdefghij", 9, -9);
- test("abcdefghij", 10, 1, "abcdefghij", 10, -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghij", 11, 0, "", 0, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 0);
- test("abcdefghij", 11, 0, "abcde", 2, 0);
- test("abcdefghij", 11, 0, "abcde", 4, 0);
- test("abcdefghij", 11, 0, "abcde", 5, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 9, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 10, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 0);
-}
-
-void test8()
-{
- test("abcdefghijklmnopqrst", 0, 0, "", 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, -2);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, -4);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, -9);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghijklmnopqrst", 0, 1, "", 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, -3);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, -8);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, -18);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, -19);
- test("abcdefghijklmnopqrst", 0, 10, "", 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 9);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 8);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 6);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, -9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, -10);
- test("abcdefghijklmnopqrst", 0, 19, "", 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 18);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 17);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 15);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 18);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 18);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 0);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, -1);
- test("abcdefghijklmnopqrst", 0, 20, "", 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 19);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 18);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 16);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 19);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 11);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 19);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 0);
- test("abcdefghijklmnopqrst", 0, 21, "", 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 19);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 18);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 16);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 19);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 11);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 19);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 0);
- test("abcdefghijklmnopqrst", 1, 0, "", 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, -2);
-}
-
-
-void test9()
-{
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, -4);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, -9);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghijklmnopqrst", 1, 1, "", 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghijklmnopqrst", 1, 9, "", 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghijklmnopqrst", 1, 18, "", 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghijklmnopqrst", 1, 19, "", 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghijklmnopqrst", 1, 20, "", 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 1);
- test("abcdefghijklmnopqrst", 10, 0, "", 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, -2);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, -4);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, -1);
-}
-
-
-void test10()
-{
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, -9);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghijklmnopqrst", 10, 1, "", 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 10);
- test("abcdefghijklmnopqrst", 10, 5, "", 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 10);
- test("abcdefghijklmnopqrst", 10, 9, "", 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 10);
- test("abcdefghijklmnopqrst", 10, 10, "", 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 10);
- test("abcdefghijklmnopqrst", 10, 11, "", 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 10);
- test("abcdefghijklmnopqrst", 19, 0, "", 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, -2);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, -4);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, -9);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 0);
-}
-
-
-void test11()
-{
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghijklmnopqrst", 19, 1, "", 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 19);
- test("abcdefghijklmnopqrst", 19, 2, "", 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 19);
- test("abcdefghijklmnopqrst", 20, 0, "", 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, -2);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, -4);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, -9);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghijklmnopqrst", 20, 1, "", 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, -2);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, -4);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, -9);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, -19);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, -20);
- test("abcdefghijklmnopqrst", 21, 0, "", 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 0);
- }
-
-
-int main () {
- test0();
- test1();
- test2();
- test3();
- test4();
- test5();
- test6();
- test7();
- test8();
- test9();
- test10();
- test11();
-
- {
- test("", 0, 0, "abcde", 0, 0);
- test("", 0, 0, "abcde", 1, -1);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10);
- }
-
- {
- test(L"", 0, 0, L"abcde", 0, 0);
- test(L"", 0, 0, L"abcde", 1, -1);
- test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 0, 0);
- test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 1, 0);
- test(L"abcdefghijklmnopqrst", 10, 0, L"abcdefghij", 10, -10);
- }
-
-#if TEST_STD_VER >= 11
- {
- test(U"", 0, 0, U"abcde", 0, 0);
- test(U"", 0, 0, U"abcde", 1, -1);
- test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 0, 0);
- test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 1, 0);
- test(U"abcdefghijklmnopqrst", 10, 0, U"abcdefghij", 10, -10);
- }
-
- {
- test(U"", 0, 0, U"abcde", 0, 0);
- test(U"", 0, 0, U"abcde", 1, -1);
- test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 0, 0);
- test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 1, 0);
- test(U"abcdefghijklmnopqrst", 10, 0, U"abcdefghij", 10, -10);
- }
-#endif
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1;
- constexpr SV sv2 { "abcdefghijklmnopqrst", 21 };
- static_assert ( sv1.compare(0, 0, "abcde", 0) == 0, "" );
- static_assert ( sv1.compare(0, 0, "abcde", 1) == -1, "" );
- static_assert ( sv2.compare(0, 0, "abcde", 1, 0) == 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
deleted file mode 100644
index 5d5ccc5b5d59..000000000000
--- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
+++ /dev/null
@@ -1,5849 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr int compare(size_type pos1, size_type n1, basic_string_view str,
-// size_type pos2, size_type n2) const;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
- std::experimental::basic_string_view<CharT> sv2, size_t pos2, size_t n2,
- int expected ) {
-
- if (pos1 > sv1.size() || pos2 > sv2.size()) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- sv1.compare(pos1, n1, sv2, pos2, n2);
- assert(false);
- } catch (const std::out_of_range&) {
- } catch (...) {
- assert(false);
- }
-#endif
- } else {
- assert (sign( sv1.compare(pos1, n1, sv2, pos2, n2)) == sign(expected));
- }
-}
-
-
-template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1,
- const CharT *s2, size_t pos2, size_t n2,
- int expected ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
-
- string_view_t sv1 ( s1 );
- string_view_t sv2 ( s2 );
- test1(sv1, pos1, n1, sv2, pos2, n2, expected);
-}
-
-void test0()
-{
- test("", 0, 0, "", 0, 0, 0);
- test("", 0, 0, "", 0, 1, 0);
- test("", 0, 0, "", 1, 0, 0);
- test("", 0, 0, "abcde", 0, 0, 0);
- test("", 0, 0, "abcde", 0, 1, -1);
- test("", 0, 0, "abcde", 0, 2, -2);
- test("", 0, 0, "abcde", 0, 4, -4);
- test("", 0, 0, "abcde", 0, 5, -5);
- test("", 0, 0, "abcde", 0, 6, -5);
- test("", 0, 0, "abcde", 1, 0, 0);
- test("", 0, 0, "abcde", 1, 1, -1);
- test("", 0, 0, "abcde", 1, 2, -2);
- test("", 0, 0, "abcde", 1, 3, -3);
- test("", 0, 0, "abcde", 1, 4, -4);
- test("", 0, 0, "abcde", 1, 5, -4);
- test("", 0, 0, "abcde", 2, 0, 0);
- test("", 0, 0, "abcde", 2, 1, -1);
- test("", 0, 0, "abcde", 2, 2, -2);
- test("", 0, 0, "abcde", 2, 3, -3);
- test("", 0, 0, "abcde", 2, 4, -3);
- test("", 0, 0, "abcde", 4, 0, 0);
- test("", 0, 0, "abcde", 4, 1, -1);
- test("", 0, 0, "abcde", 4, 2, -1);
- test("", 0, 0, "abcde", 5, 0, 0);
- test("", 0, 0, "abcde", 5, 1, 0);
- test("", 0, 0, "abcde", 6, 0, 0);
- test("", 0, 0, "abcdefghij", 0, 0, 0);
- test("", 0, 0, "abcdefghij", 0, 1, -1);
- test("", 0, 0, "abcdefghij", 0, 5, -5);
- test("", 0, 0, "abcdefghij", 0, 9, -9);
- test("", 0, 0, "abcdefghij", 0, 10, -10);
- test("", 0, 0, "abcdefghij", 0, 11, -10);
- test("", 0, 0, "abcdefghij", 1, 0, 0);
- test("", 0, 0, "abcdefghij", 1, 1, -1);
- test("", 0, 0, "abcdefghij", 1, 4, -4);
- test("", 0, 0, "abcdefghij", 1, 8, -8);
- test("", 0, 0, "abcdefghij", 1, 9, -9);
- test("", 0, 0, "abcdefghij", 1, 10, -9);
- test("", 0, 0, "abcdefghij", 5, 0, 0);
- test("", 0, 0, "abcdefghij", 5, 1, -1);
- test("", 0, 0, "abcdefghij", 5, 2, -2);
- test("", 0, 0, "abcdefghij", 5, 4, -4);
- test("", 0, 0, "abcdefghij", 5, 5, -5);
- test("", 0, 0, "abcdefghij", 5, 6, -5);
- test("", 0, 0, "abcdefghij", 9, 0, 0);
- test("", 0, 0, "abcdefghij", 9, 1, -1);
- test("", 0, 0, "abcdefghij", 9, 2, -1);
- test("", 0, 0, "abcdefghij", 10, 0, 0);
- test("", 0, 0, "abcdefghij", 10, 1, 0);
- test("", 0, 0, "abcdefghij", 11, 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("", 0, 1, "", 0, 0, 0);
- test("", 0, 1, "", 0, 1, 0);
- test("", 0, 1, "", 1, 0, 0);
- test("", 0, 1, "abcde", 0, 0, 0);
- test("", 0, 1, "abcde", 0, 1, -1);
- test("", 0, 1, "abcde", 0, 2, -2);
- test("", 0, 1, "abcde", 0, 4, -4);
- test("", 0, 1, "abcde", 0, 5, -5);
- test("", 0, 1, "abcde", 0, 6, -5);
- test("", 0, 1, "abcde", 1, 0, 0);
- test("", 0, 1, "abcde", 1, 1, -1);
- test("", 0, 1, "abcde", 1, 2, -2);
- test("", 0, 1, "abcde", 1, 3, -3);
- test("", 0, 1, "abcde", 1, 4, -4);
- test("", 0, 1, "abcde", 1, 5, -4);
- test("", 0, 1, "abcde", 2, 0, 0);
- test("", 0, 1, "abcde", 2, 1, -1);
- test("", 0, 1, "abcde", 2, 2, -2);
- test("", 0, 1, "abcde", 2, 3, -3);
- test("", 0, 1, "abcde", 2, 4, -3);
- test("", 0, 1, "abcde", 4, 0, 0);
- test("", 0, 1, "abcde", 4, 1, -1);
- test("", 0, 1, "abcde", 4, 2, -1);
- test("", 0, 1, "abcde", 5, 0, 0);
- test("", 0, 1, "abcde", 5, 1, 0);
- test("", 0, 1, "abcde", 6, 0, 0);
-}
-
-void test1()
-{
- test("", 0, 1, "abcdefghij", 0, 0, 0);
- test("", 0, 1, "abcdefghij", 0, 1, -1);
- test("", 0, 1, "abcdefghij", 0, 5, -5);
- test("", 0, 1, "abcdefghij", 0, 9, -9);
- test("", 0, 1, "abcdefghij", 0, 10, -10);
- test("", 0, 1, "abcdefghij", 0, 11, -10);
- test("", 0, 1, "abcdefghij", 1, 0, 0);
- test("", 0, 1, "abcdefghij", 1, 1, -1);
- test("", 0, 1, "abcdefghij", 1, 4, -4);
- test("", 0, 1, "abcdefghij", 1, 8, -8);
- test("", 0, 1, "abcdefghij", 1, 9, -9);
- test("", 0, 1, "abcdefghij", 1, 10, -9);
- test("", 0, 1, "abcdefghij", 5, 0, 0);
- test("", 0, 1, "abcdefghij", 5, 1, -1);
- test("", 0, 1, "abcdefghij", 5, 2, -2);
- test("", 0, 1, "abcdefghij", 5, 4, -4);
- test("", 0, 1, "abcdefghij", 5, 5, -5);
- test("", 0, 1, "abcdefghij", 5, 6, -5);
- test("", 0, 1, "abcdefghij", 9, 0, 0);
- test("", 0, 1, "abcdefghij", 9, 1, -1);
- test("", 0, 1, "abcdefghij", 9, 2, -1);
- test("", 0, 1, "abcdefghij", 10, 0, 0);
- test("", 0, 1, "abcdefghij", 10, 1, 0);
- test("", 0, 1, "abcdefghij", 11, 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 1, -1);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 10, -10);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 19, -19);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 20, -20);
- test("", 0, 1, "abcdefghijklmnopqrst", 0, 21, -20);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, 9, -9);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, 18, -18);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, 19, -19);
- test("", 0, 1, "abcdefghijklmnopqrst", 1, 20, -19);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, 1, -1);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, 5, -5);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("", 0, 1, "abcdefghijklmnopqrst", 19, 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 19, 1, -1);
- test("", 0, 1, "abcdefghijklmnopqrst", 19, 2, -1);
- test("", 0, 1, "abcdefghijklmnopqrst", 20, 0, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 20, 1, 0);
- test("", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("", 1, 0, "", 0, 0, 0);
- test("", 1, 0, "", 0, 1, 0);
- test("", 1, 0, "", 1, 0, 0);
- test("", 1, 0, "abcde", 0, 0, 0);
- test("", 1, 0, "abcde", 0, 1, 0);
- test("", 1, 0, "abcde", 0, 2, 0);
- test("", 1, 0, "abcde", 0, 4, 0);
- test("", 1, 0, "abcde", 0, 5, 0);
- test("", 1, 0, "abcde", 0, 6, 0);
- test("", 1, 0, "abcde", 1, 0, 0);
- test("", 1, 0, "abcde", 1, 1, 0);
- test("", 1, 0, "abcde", 1, 2, 0);
- test("", 1, 0, "abcde", 1, 3, 0);
- test("", 1, 0, "abcde", 1, 4, 0);
- test("", 1, 0, "abcde", 1, 5, 0);
- test("", 1, 0, "abcde", 2, 0, 0);
- test("", 1, 0, "abcde", 2, 1, 0);
- test("", 1, 0, "abcde", 2, 2, 0);
- test("", 1, 0, "abcde", 2, 3, 0);
- test("", 1, 0, "abcde", 2, 4, 0);
- test("", 1, 0, "abcde", 4, 0, 0);
- test("", 1, 0, "abcde", 4, 1, 0);
- test("", 1, 0, "abcde", 4, 2, 0);
- test("", 1, 0, "abcde", 5, 0, 0);
- test("", 1, 0, "abcde", 5, 1, 0);
- test("", 1, 0, "abcde", 6, 0, 0);
- test("", 1, 0, "abcdefghij", 0, 0, 0);
- test("", 1, 0, "abcdefghij", 0, 1, 0);
- test("", 1, 0, "abcdefghij", 0, 5, 0);
- test("", 1, 0, "abcdefghij", 0, 9, 0);
- test("", 1, 0, "abcdefghij", 0, 10, 0);
- test("", 1, 0, "abcdefghij", 0, 11, 0);
- test("", 1, 0, "abcdefghij", 1, 0, 0);
- test("", 1, 0, "abcdefghij", 1, 1, 0);
- test("", 1, 0, "abcdefghij", 1, 4, 0);
- test("", 1, 0, "abcdefghij", 1, 8, 0);
- test("", 1, 0, "abcdefghij", 1, 9, 0);
- test("", 1, 0, "abcdefghij", 1, 10, 0);
- test("", 1, 0, "abcdefghij", 5, 0, 0);
- test("", 1, 0, "abcdefghij", 5, 1, 0);
- test("", 1, 0, "abcdefghij", 5, 2, 0);
- test("", 1, 0, "abcdefghij", 5, 4, 0);
- test("", 1, 0, "abcdefghij", 5, 5, 0);
- test("", 1, 0, "abcdefghij", 5, 6, 0);
- test("", 1, 0, "abcdefghij", 9, 0, 0);
- test("", 1, 0, "abcdefghij", 9, 1, 0);
- test("", 1, 0, "abcdefghij", 9, 2, 0);
- test("", 1, 0, "abcdefghij", 10, 0, 0);
- test("", 1, 0, "abcdefghij", 10, 1, 0);
- test("", 1, 0, "abcdefghij", 11, 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 1, 0);
-}
-
-void test2()
-{
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 10, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 19, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 20, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 0, 21, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 1, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 9, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 18, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 19, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 1, 20, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 1, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 5, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 9, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 10, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 10, 11, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 19, 1, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 19, 2, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 0, 0, "", 0, 0, 0);
- test("abcde", 0, 0, "", 0, 1, 0);
- test("abcde", 0, 0, "", 1, 0, 0);
- test("abcde", 0, 0, "abcde", 0, 0, 0);
- test("abcde", 0, 0, "abcde", 0, 1, -1);
- test("abcde", 0, 0, "abcde", 0, 2, -2);
- test("abcde", 0, 0, "abcde", 0, 4, -4);
- test("abcde", 0, 0, "abcde", 0, 5, -5);
- test("abcde", 0, 0, "abcde", 0, 6, -5);
- test("abcde", 0, 0, "abcde", 1, 0, 0);
- test("abcde", 0, 0, "abcde", 1, 1, -1);
- test("abcde", 0, 0, "abcde", 1, 2, -2);
- test("abcde", 0, 0, "abcde", 1, 3, -3);
- test("abcde", 0, 0, "abcde", 1, 4, -4);
- test("abcde", 0, 0, "abcde", 1, 5, -4);
- test("abcde", 0, 0, "abcde", 2, 0, 0);
- test("abcde", 0, 0, "abcde", 2, 1, -1);
- test("abcde", 0, 0, "abcde", 2, 2, -2);
- test("abcde", 0, 0, "abcde", 2, 3, -3);
- test("abcde", 0, 0, "abcde", 2, 4, -3);
- test("abcde", 0, 0, "abcde", 4, 0, 0);
- test("abcde", 0, 0, "abcde", 4, 1, -1);
- test("abcde", 0, 0, "abcde", 4, 2, -1);
- test("abcde", 0, 0, "abcde", 5, 0, 0);
- test("abcde", 0, 0, "abcde", 5, 1, 0);
- test("abcde", 0, 0, "abcde", 6, 0, 0);
- test("abcde", 0, 0, "abcdefghij", 0, 0, 0);
- test("abcde", 0, 0, "abcdefghij", 0, 1, -1);
- test("abcde", 0, 0, "abcdefghij", 0, 5, -5);
- test("abcde", 0, 0, "abcdefghij", 0, 9, -9);
- test("abcde", 0, 0, "abcdefghij", 0, 10, -10);
- test("abcde", 0, 0, "abcdefghij", 0, 11, -10);
- test("abcde", 0, 0, "abcdefghij", 1, 0, 0);
- test("abcde", 0, 0, "abcdefghij", 1, 1, -1);
- test("abcde", 0, 0, "abcdefghij", 1, 4, -4);
- test("abcde", 0, 0, "abcdefghij", 1, 8, -8);
- test("abcde", 0, 0, "abcdefghij", 1, 9, -9);
- test("abcde", 0, 0, "abcdefghij", 1, 10, -9);
- test("abcde", 0, 0, "abcdefghij", 5, 0, 0);
- test("abcde", 0, 0, "abcdefghij", 5, 1, -1);
- test("abcde", 0, 0, "abcdefghij", 5, 2, -2);
- test("abcde", 0, 0, "abcdefghij", 5, 4, -4);
- test("abcde", 0, 0, "abcdefghij", 5, 5, -5);
- test("abcde", 0, 0, "abcdefghij", 5, 6, -5);
- test("abcde", 0, 0, "abcdefghij", 9, 0, 0);
- test("abcde", 0, 0, "abcdefghij", 9, 1, -1);
- test("abcde", 0, 0, "abcdefghij", 9, 2, -1);
- test("abcde", 0, 0, "abcdefghij", 10, 0, 0);
- test("abcde", 0, 0, "abcdefghij", 10, 1, 0);
- test("abcde", 0, 0, "abcdefghij", 11, 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 0, 1, "", 0, 0, 1);
- test("abcde", 0, 1, "", 0, 1, 1);
- test("abcde", 0, 1, "", 1, 0, 0);
- test("abcde", 0, 1, "abcde", 0, 0, 1);
-}
-
-void test3()
-{
- test("abcde", 0, 1, "abcde", 0, 1, 0);
- test("abcde", 0, 1, "abcde", 0, 2, -1);
- test("abcde", 0, 1, "abcde", 0, 4, -3);
- test("abcde", 0, 1, "abcde", 0, 5, -4);
- test("abcde", 0, 1, "abcde", 0, 6, -4);
- test("abcde", 0, 1, "abcde", 1, 0, 1);
- test("abcde", 0, 1, "abcde", 1, 1, -1);
- test("abcde", 0, 1, "abcde", 1, 2, -1);
- test("abcde", 0, 1, "abcde", 1, 3, -1);
- test("abcde", 0, 1, "abcde", 1, 4, -1);
- test("abcde", 0, 1, "abcde", 1, 5, -1);
- test("abcde", 0, 1, "abcde", 2, 0, 1);
- test("abcde", 0, 1, "abcde", 2, 1, -2);
- test("abcde", 0, 1, "abcde", 2, 2, -2);
- test("abcde", 0, 1, "abcde", 2, 3, -2);
- test("abcde", 0, 1, "abcde", 2, 4, -2);
- test("abcde", 0, 1, "abcde", 4, 0, 1);
- test("abcde", 0, 1, "abcde", 4, 1, -4);
- test("abcde", 0, 1, "abcde", 4, 2, -4);
- test("abcde", 0, 1, "abcde", 5, 0, 1);
- test("abcde", 0, 1, "abcde", 5, 1, 1);
- test("abcde", 0, 1, "abcde", 6, 0, 0);
- test("abcde", 0, 1, "abcdefghij", 0, 0, 1);
- test("abcde", 0, 1, "abcdefghij", 0, 1, 0);
- test("abcde", 0, 1, "abcdefghij", 0, 5, -4);
- test("abcde", 0, 1, "abcdefghij", 0, 9, -8);
- test("abcde", 0, 1, "abcdefghij", 0, 10, -9);
- test("abcde", 0, 1, "abcdefghij", 0, 11, -9);
- test("abcde", 0, 1, "abcdefghij", 1, 0, 1);
- test("abcde", 0, 1, "abcdefghij", 1, 1, -1);
- test("abcde", 0, 1, "abcdefghij", 1, 4, -1);
- test("abcde", 0, 1, "abcdefghij", 1, 8, -1);
- test("abcde", 0, 1, "abcdefghij", 1, 9, -1);
- test("abcde", 0, 1, "abcdefghij", 1, 10, -1);
- test("abcde", 0, 1, "abcdefghij", 5, 0, 1);
- test("abcde", 0, 1, "abcdefghij", 5, 1, -5);
- test("abcde", 0, 1, "abcdefghij", 5, 2, -5);
- test("abcde", 0, 1, "abcdefghij", 5, 4, -5);
- test("abcde", 0, 1, "abcdefghij", 5, 5, -5);
- test("abcde", 0, 1, "abcdefghij", 5, 6, -5);
- test("abcde", 0, 1, "abcdefghij", 9, 0, 1);
- test("abcde", 0, 1, "abcdefghij", 9, 1, -9);
- test("abcde", 0, 1, "abcdefghij", 9, 2, -9);
- test("abcde", 0, 1, "abcdefghij", 10, 0, 1);
- test("abcde", 0, 1, "abcdefghij", 10, 1, 1);
- test("abcde", 0, 1, "abcdefghij", 11, 0, 0);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcde", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 0, 2, "", 0, 0, 2);
- test("abcde", 0, 2, "", 0, 1, 2);
- test("abcde", 0, 2, "", 1, 0, 0);
- test("abcde", 0, 2, "abcde", 0, 0, 2);
- test("abcde", 0, 2, "abcde", 0, 1, 1);
- test("abcde", 0, 2, "abcde", 0, 2, 0);
- test("abcde", 0, 2, "abcde", 0, 4, -2);
- test("abcde", 0, 2, "abcde", 0, 5, -3);
- test("abcde", 0, 2, "abcde", 0, 6, -3);
- test("abcde", 0, 2, "abcde", 1, 0, 2);
- test("abcde", 0, 2, "abcde", 1, 1, -1);
- test("abcde", 0, 2, "abcde", 1, 2, -1);
- test("abcde", 0, 2, "abcde", 1, 3, -1);
- test("abcde", 0, 2, "abcde", 1, 4, -1);
- test("abcde", 0, 2, "abcde", 1, 5, -1);
- test("abcde", 0, 2, "abcde", 2, 0, 2);
- test("abcde", 0, 2, "abcde", 2, 1, -2);
- test("abcde", 0, 2, "abcde", 2, 2, -2);
- test("abcde", 0, 2, "abcde", 2, 3, -2);
- test("abcde", 0, 2, "abcde", 2, 4, -2);
- test("abcde", 0, 2, "abcde", 4, 0, 2);
- test("abcde", 0, 2, "abcde", 4, 1, -4);
- test("abcde", 0, 2, "abcde", 4, 2, -4);
- test("abcde", 0, 2, "abcde", 5, 0, 2);
- test("abcde", 0, 2, "abcde", 5, 1, 2);
- test("abcde", 0, 2, "abcde", 6, 0, 0);
- test("abcde", 0, 2, "abcdefghij", 0, 0, 2);
- test("abcde", 0, 2, "abcdefghij", 0, 1, 1);
- test("abcde", 0, 2, "abcdefghij", 0, 5, -3);
- test("abcde", 0, 2, "abcdefghij", 0, 9, -7);
-}
-
-void test4()
-{
- test("abcde", 0, 2, "abcdefghij", 0, 10, -8);
- test("abcde", 0, 2, "abcdefghij", 0, 11, -8);
- test("abcde", 0, 2, "abcdefghij", 1, 0, 2);
- test("abcde", 0, 2, "abcdefghij", 1, 1, -1);
- test("abcde", 0, 2, "abcdefghij", 1, 4, -1);
- test("abcde", 0, 2, "abcdefghij", 1, 8, -1);
- test("abcde", 0, 2, "abcdefghij", 1, 9, -1);
- test("abcde", 0, 2, "abcdefghij", 1, 10, -1);
- test("abcde", 0, 2, "abcdefghij", 5, 0, 2);
- test("abcde", 0, 2, "abcdefghij", 5, 1, -5);
- test("abcde", 0, 2, "abcdefghij", 5, 2, -5);
- test("abcde", 0, 2, "abcdefghij", 5, 4, -5);
- test("abcde", 0, 2, "abcdefghij", 5, 5, -5);
- test("abcde", 0, 2, "abcdefghij", 5, 6, -5);
- test("abcde", 0, 2, "abcdefghij", 9, 0, 2);
- test("abcde", 0, 2, "abcdefghij", 9, 1, -9);
- test("abcde", 0, 2, "abcdefghij", 9, 2, -9);
- test("abcde", 0, 2, "abcdefghij", 10, 0, 2);
- test("abcde", 0, 2, "abcdefghij", 10, 1, 2);
- test("abcde", 0, 2, "abcdefghij", 11, 0, 0);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 0, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 10, -8);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 19, -17);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 20, -18);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 21, -18);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 0, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 0, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 0, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, 0, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, 1, 2);
- test("abcde", 0, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 0, 4, "", 0, 0, 4);
- test("abcde", 0, 4, "", 0, 1, 4);
- test("abcde", 0, 4, "", 1, 0, 0);
- test("abcde", 0, 4, "abcde", 0, 0, 4);
- test("abcde", 0, 4, "abcde", 0, 1, 3);
- test("abcde", 0, 4, "abcde", 0, 2, 2);
- test("abcde", 0, 4, "abcde", 0, 4, 0);
- test("abcde", 0, 4, "abcde", 0, 5, -1);
- test("abcde", 0, 4, "abcde", 0, 6, -1);
- test("abcde", 0, 4, "abcde", 1, 0, 4);
- test("abcde", 0, 4, "abcde", 1, 1, -1);
- test("abcde", 0, 4, "abcde", 1, 2, -1);
- test("abcde", 0, 4, "abcde", 1, 3, -1);
- test("abcde", 0, 4, "abcde", 1, 4, -1);
- test("abcde", 0, 4, "abcde", 1, 5, -1);
- test("abcde", 0, 4, "abcde", 2, 0, 4);
- test("abcde", 0, 4, "abcde", 2, 1, -2);
- test("abcde", 0, 4, "abcde", 2, 2, -2);
- test("abcde", 0, 4, "abcde", 2, 3, -2);
- test("abcde", 0, 4, "abcde", 2, 4, -2);
- test("abcde", 0, 4, "abcde", 4, 0, 4);
- test("abcde", 0, 4, "abcde", 4, 1, -4);
- test("abcde", 0, 4, "abcde", 4, 2, -4);
- test("abcde", 0, 4, "abcde", 5, 0, 4);
- test("abcde", 0, 4, "abcde", 5, 1, 4);
- test("abcde", 0, 4, "abcde", 6, 0, 0);
- test("abcde", 0, 4, "abcdefghij", 0, 0, 4);
- test("abcde", 0, 4, "abcdefghij", 0, 1, 3);
- test("abcde", 0, 4, "abcdefghij", 0, 5, -1);
- test("abcde", 0, 4, "abcdefghij", 0, 9, -5);
- test("abcde", 0, 4, "abcdefghij", 0, 10, -6);
- test("abcde", 0, 4, "abcdefghij", 0, 11, -6);
- test("abcde", 0, 4, "abcdefghij", 1, 0, 4);
- test("abcde", 0, 4, "abcdefghij", 1, 1, -1);
- test("abcde", 0, 4, "abcdefghij", 1, 4, -1);
- test("abcde", 0, 4, "abcdefghij", 1, 8, -1);
- test("abcde", 0, 4, "abcdefghij", 1, 9, -1);
- test("abcde", 0, 4, "abcdefghij", 1, 10, -1);
- test("abcde", 0, 4, "abcdefghij", 5, 0, 4);
- test("abcde", 0, 4, "abcdefghij", 5, 1, -5);
- test("abcde", 0, 4, "abcdefghij", 5, 2, -5);
- test("abcde", 0, 4, "abcdefghij", 5, 4, -5);
- test("abcde", 0, 4, "abcdefghij", 5, 5, -5);
- test("abcde", 0, 4, "abcdefghij", 5, 6, -5);
- test("abcde", 0, 4, "abcdefghij", 9, 0, 4);
- test("abcde", 0, 4, "abcdefghij", 9, 1, -9);
- test("abcde", 0, 4, "abcdefghij", 9, 2, -9);
- test("abcde", 0, 4, "abcdefghij", 10, 0, 4);
- test("abcde", 0, 4, "abcdefghij", 10, 1, 4);
- test("abcde", 0, 4, "abcdefghij", 11, 0, 0);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 0, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 1, 3);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 10, -6);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 19, -15);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 20, -16);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 21, -16);
-}
-
-void test5()
-{
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 0, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 0, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 0, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, 0, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, 1, 4);
- test("abcde", 0, 4, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 0, 5, "", 0, 0, 5);
- test("abcde", 0, 5, "", 0, 1, 5);
- test("abcde", 0, 5, "", 1, 0, 0);
- test("abcde", 0, 5, "abcde", 0, 0, 5);
- test("abcde", 0, 5, "abcde", 0, 1, 4);
- test("abcde", 0, 5, "abcde", 0, 2, 3);
- test("abcde", 0, 5, "abcde", 0, 4, 1);
- test("abcde", 0, 5, "abcde", 0, 5, 0);
- test("abcde", 0, 5, "abcde", 0, 6, 0);
- test("abcde", 0, 5, "abcde", 1, 0, 5);
- test("abcde", 0, 5, "abcde", 1, 1, -1);
- test("abcde", 0, 5, "abcde", 1, 2, -1);
- test("abcde", 0, 5, "abcde", 1, 3, -1);
- test("abcde", 0, 5, "abcde", 1, 4, -1);
- test("abcde", 0, 5, "abcde", 1, 5, -1);
- test("abcde", 0, 5, "abcde", 2, 0, 5);
- test("abcde", 0, 5, "abcde", 2, 1, -2);
- test("abcde", 0, 5, "abcde", 2, 2, -2);
- test("abcde", 0, 5, "abcde", 2, 3, -2);
- test("abcde", 0, 5, "abcde", 2, 4, -2);
- test("abcde", 0, 5, "abcde", 4, 0, 5);
- test("abcde", 0, 5, "abcde", 4, 1, -4);
- test("abcde", 0, 5, "abcde", 4, 2, -4);
- test("abcde", 0, 5, "abcde", 5, 0, 5);
- test("abcde", 0, 5, "abcde", 5, 1, 5);
- test("abcde", 0, 5, "abcde", 6, 0, 0);
- test("abcde", 0, 5, "abcdefghij", 0, 0, 5);
- test("abcde", 0, 5, "abcdefghij", 0, 1, 4);
- test("abcde", 0, 5, "abcdefghij", 0, 5, 0);
- test("abcde", 0, 5, "abcdefghij", 0, 9, -4);
- test("abcde", 0, 5, "abcdefghij", 0, 10, -5);
- test("abcde", 0, 5, "abcdefghij", 0, 11, -5);
- test("abcde", 0, 5, "abcdefghij", 1, 0, 5);
- test("abcde", 0, 5, "abcdefghij", 1, 1, -1);
- test("abcde", 0, 5, "abcdefghij", 1, 4, -1);
- test("abcde", 0, 5, "abcdefghij", 1, 8, -1);
- test("abcde", 0, 5, "abcdefghij", 1, 9, -1);
- test("abcde", 0, 5, "abcdefghij", 1, 10, -1);
- test("abcde", 0, 5, "abcdefghij", 5, 0, 5);
- test("abcde", 0, 5, "abcdefghij", 5, 1, -5);
- test("abcde", 0, 5, "abcdefghij", 5, 2, -5);
- test("abcde", 0, 5, "abcdefghij", 5, 4, -5);
- test("abcde", 0, 5, "abcdefghij", 5, 5, -5);
- test("abcde", 0, 5, "abcdefghij", 5, 6, -5);
- test("abcde", 0, 5, "abcdefghij", 9, 0, 5);
- test("abcde", 0, 5, "abcdefghij", 9, 1, -9);
- test("abcde", 0, 5, "abcdefghij", 9, 2, -9);
- test("abcde", 0, 5, "abcdefghij", 10, 0, 5);
- test("abcde", 0, 5, "abcdefghij", 10, 1, 5);
- test("abcde", 0, 5, "abcdefghij", 11, 0, 0);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 0, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 1, 4);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 10, -5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 19, -14);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 20, -15);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 21, -15);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 0, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 0, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 0, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, 0, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, 1, 5);
- test("abcde", 0, 5, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 0, 6, "", 0, 0, 5);
- test("abcde", 0, 6, "", 0, 1, 5);
- test("abcde", 0, 6, "", 1, 0, 0);
- test("abcde", 0, 6, "abcde", 0, 0, 5);
- test("abcde", 0, 6, "abcde", 0, 1, 4);
- test("abcde", 0, 6, "abcde", 0, 2, 3);
- test("abcde", 0, 6, "abcde", 0, 4, 1);
- test("abcde", 0, 6, "abcde", 0, 5, 0);
-}
-
-void test6()
-{
- test("abcde", 0, 6, "abcde", 0, 6, 0);
- test("abcde", 0, 6, "abcde", 1, 0, 5);
- test("abcde", 0, 6, "abcde", 1, 1, -1);
- test("abcde", 0, 6, "abcde", 1, 2, -1);
- test("abcde", 0, 6, "abcde", 1, 3, -1);
- test("abcde", 0, 6, "abcde", 1, 4, -1);
- test("abcde", 0, 6, "abcde", 1, 5, -1);
- test("abcde", 0, 6, "abcde", 2, 0, 5);
- test("abcde", 0, 6, "abcde", 2, 1, -2);
- test("abcde", 0, 6, "abcde", 2, 2, -2);
- test("abcde", 0, 6, "abcde", 2, 3, -2);
- test("abcde", 0, 6, "abcde", 2, 4, -2);
- test("abcde", 0, 6, "abcde", 4, 0, 5);
- test("abcde", 0, 6, "abcde", 4, 1, -4);
- test("abcde", 0, 6, "abcde", 4, 2, -4);
- test("abcde", 0, 6, "abcde", 5, 0, 5);
- test("abcde", 0, 6, "abcde", 5, 1, 5);
- test("abcde", 0, 6, "abcde", 6, 0, 0);
- test("abcde", 0, 6, "abcdefghij", 0, 0, 5);
- test("abcde", 0, 6, "abcdefghij", 0, 1, 4);
- test("abcde", 0, 6, "abcdefghij", 0, 5, 0);
- test("abcde", 0, 6, "abcdefghij", 0, 9, -4);
- test("abcde", 0, 6, "abcdefghij", 0, 10, -5);
- test("abcde", 0, 6, "abcdefghij", 0, 11, -5);
- test("abcde", 0, 6, "abcdefghij", 1, 0, 5);
- test("abcde", 0, 6, "abcdefghij", 1, 1, -1);
- test("abcde", 0, 6, "abcdefghij", 1, 4, -1);
- test("abcde", 0, 6, "abcdefghij", 1, 8, -1);
- test("abcde", 0, 6, "abcdefghij", 1, 9, -1);
- test("abcde", 0, 6, "abcdefghij", 1, 10, -1);
- test("abcde", 0, 6, "abcdefghij", 5, 0, 5);
- test("abcde", 0, 6, "abcdefghij", 5, 1, -5);
- test("abcde", 0, 6, "abcdefghij", 5, 2, -5);
- test("abcde", 0, 6, "abcdefghij", 5, 4, -5);
- test("abcde", 0, 6, "abcdefghij", 5, 5, -5);
- test("abcde", 0, 6, "abcdefghij", 5, 6, -5);
- test("abcde", 0, 6, "abcdefghij", 9, 0, 5);
- test("abcde", 0, 6, "abcdefghij", 9, 1, -9);
- test("abcde", 0, 6, "abcdefghij", 9, 2, -9);
- test("abcde", 0, 6, "abcdefghij", 10, 0, 5);
- test("abcde", 0, 6, "abcdefghij", 10, 1, 5);
- test("abcde", 0, 6, "abcdefghij", 11, 0, 0);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 0, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 1, 4);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 10, -5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 19, -14);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 20, -15);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 21, -15);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 0, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 0, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 0, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, 0, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, 1, 5);
- test("abcde", 0, 6, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 1, 0, "", 0, 0, 0);
- test("abcde", 1, 0, "", 0, 1, 0);
- test("abcde", 1, 0, "", 1, 0, 0);
- test("abcde", 1, 0, "abcde", 0, 0, 0);
- test("abcde", 1, 0, "abcde", 0, 1, -1);
- test("abcde", 1, 0, "abcde", 0, 2, -2);
- test("abcde", 1, 0, "abcde", 0, 4, -4);
- test("abcde", 1, 0, "abcde", 0, 5, -5);
- test("abcde", 1, 0, "abcde", 0, 6, -5);
- test("abcde", 1, 0, "abcde", 1, 0, 0);
- test("abcde", 1, 0, "abcde", 1, 1, -1);
- test("abcde", 1, 0, "abcde", 1, 2, -2);
- test("abcde", 1, 0, "abcde", 1, 3, -3);
- test("abcde", 1, 0, "abcde", 1, 4, -4);
- test("abcde", 1, 0, "abcde", 1, 5, -4);
- test("abcde", 1, 0, "abcde", 2, 0, 0);
- test("abcde", 1, 0, "abcde", 2, 1, -1);
- test("abcde", 1, 0, "abcde", 2, 2, -2);
- test("abcde", 1, 0, "abcde", 2, 3, -3);
- test("abcde", 1, 0, "abcde", 2, 4, -3);
- test("abcde", 1, 0, "abcde", 4, 0, 0);
- test("abcde", 1, 0, "abcde", 4, 1, -1);
- test("abcde", 1, 0, "abcde", 4, 2, -1);
- test("abcde", 1, 0, "abcde", 5, 0, 0);
- test("abcde", 1, 0, "abcde", 5, 1, 0);
- test("abcde", 1, 0, "abcde", 6, 0, 0);
- test("abcde", 1, 0, "abcdefghij", 0, 0, 0);
- test("abcde", 1, 0, "abcdefghij", 0, 1, -1);
- test("abcde", 1, 0, "abcdefghij", 0, 5, -5);
- test("abcde", 1, 0, "abcdefghij", 0, 9, -9);
- test("abcde", 1, 0, "abcdefghij", 0, 10, -10);
- test("abcde", 1, 0, "abcdefghij", 0, 11, -10);
- test("abcde", 1, 0, "abcdefghij", 1, 0, 0);
- test("abcde", 1, 0, "abcdefghij", 1, 1, -1);
-}
-
-void test7()
-{
- test("abcde", 1, 0, "abcdefghij", 1, 4, -4);
- test("abcde", 1, 0, "abcdefghij", 1, 8, -8);
- test("abcde", 1, 0, "abcdefghij", 1, 9, -9);
- test("abcde", 1, 0, "abcdefghij", 1, 10, -9);
- test("abcde", 1, 0, "abcdefghij", 5, 0, 0);
- test("abcde", 1, 0, "abcdefghij", 5, 1, -1);
- test("abcde", 1, 0, "abcdefghij", 5, 2, -2);
- test("abcde", 1, 0, "abcdefghij", 5, 4, -4);
- test("abcde", 1, 0, "abcdefghij", 5, 5, -5);
- test("abcde", 1, 0, "abcdefghij", 5, 6, -5);
- test("abcde", 1, 0, "abcdefghij", 9, 0, 0);
- test("abcde", 1, 0, "abcdefghij", 9, 1, -1);
- test("abcde", 1, 0, "abcdefghij", 9, 2, -1);
- test("abcde", 1, 0, "abcdefghij", 10, 0, 0);
- test("abcde", 1, 0, "abcdefghij", 10, 1, 0);
- test("abcde", 1, 0, "abcdefghij", 11, 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 1, 1, "", 0, 0, 1);
- test("abcde", 1, 1, "", 0, 1, 1);
- test("abcde", 1, 1, "", 1, 0, 0);
- test("abcde", 1, 1, "abcde", 0, 0, 1);
- test("abcde", 1, 1, "abcde", 0, 1, 1);
- test("abcde", 1, 1, "abcde", 0, 2, 1);
- test("abcde", 1, 1, "abcde", 0, 4, 1);
- test("abcde", 1, 1, "abcde", 0, 5, 1);
- test("abcde", 1, 1, "abcde", 0, 6, 1);
- test("abcde", 1, 1, "abcde", 1, 0, 1);
- test("abcde", 1, 1, "abcde", 1, 1, 0);
- test("abcde", 1, 1, "abcde", 1, 2, -1);
- test("abcde", 1, 1, "abcde", 1, 3, -2);
- test("abcde", 1, 1, "abcde", 1, 4, -3);
- test("abcde", 1, 1, "abcde", 1, 5, -3);
- test("abcde", 1, 1, "abcde", 2, 0, 1);
- test("abcde", 1, 1, "abcde", 2, 1, -1);
- test("abcde", 1, 1, "abcde", 2, 2, -1);
- test("abcde", 1, 1, "abcde", 2, 3, -1);
- test("abcde", 1, 1, "abcde", 2, 4, -1);
- test("abcde", 1, 1, "abcde", 4, 0, 1);
- test("abcde", 1, 1, "abcde", 4, 1, -3);
- test("abcde", 1, 1, "abcde", 4, 2, -3);
- test("abcde", 1, 1, "abcde", 5, 0, 1);
- test("abcde", 1, 1, "abcde", 5, 1, 1);
- test("abcde", 1, 1, "abcde", 6, 0, 0);
- test("abcde", 1, 1, "abcdefghij", 0, 0, 1);
- test("abcde", 1, 1, "abcdefghij", 0, 1, 1);
- test("abcde", 1, 1, "abcdefghij", 0, 5, 1);
- test("abcde", 1, 1, "abcdefghij", 0, 9, 1);
- test("abcde", 1, 1, "abcdefghij", 0, 10, 1);
- test("abcde", 1, 1, "abcdefghij", 0, 11, 1);
- test("abcde", 1, 1, "abcdefghij", 1, 0, 1);
- test("abcde", 1, 1, "abcdefghij", 1, 1, 0);
- test("abcde", 1, 1, "abcdefghij", 1, 4, -3);
- test("abcde", 1, 1, "abcdefghij", 1, 8, -7);
- test("abcde", 1, 1, "abcdefghij", 1, 9, -8);
- test("abcde", 1, 1, "abcdefghij", 1, 10, -8);
- test("abcde", 1, 1, "abcdefghij", 5, 0, 1);
- test("abcde", 1, 1, "abcdefghij", 5, 1, -4);
- test("abcde", 1, 1, "abcdefghij", 5, 2, -4);
- test("abcde", 1, 1, "abcdefghij", 5, 4, -4);
- test("abcde", 1, 1, "abcdefghij", 5, 5, -4);
- test("abcde", 1, 1, "abcdefghij", 5, 6, -4);
- test("abcde", 1, 1, "abcdefghij", 9, 0, 1);
- test("abcde", 1, 1, "abcdefghij", 9, 1, -8);
- test("abcde", 1, 1, "abcdefghij", 9, 2, -8);
- test("abcde", 1, 1, "abcdefghij", 10, 0, 1);
- test("abcde", 1, 1, "abcdefghij", 10, 1, 1);
- test("abcde", 1, 1, "abcdefghij", 11, 0, 0);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17);
-}
-
-void test8()
-{
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcde", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 1, 2, "", 0, 0, 2);
- test("abcde", 1, 2, "", 0, 1, 2);
- test("abcde", 1, 2, "", 1, 0, 0);
- test("abcde", 1, 2, "abcde", 0, 0, 2);
- test("abcde", 1, 2, "abcde", 0, 1, 1);
- test("abcde", 1, 2, "abcde", 0, 2, 1);
- test("abcde", 1, 2, "abcde", 0, 4, 1);
- test("abcde", 1, 2, "abcde", 0, 5, 1);
- test("abcde", 1, 2, "abcde", 0, 6, 1);
- test("abcde", 1, 2, "abcde", 1, 0, 2);
- test("abcde", 1, 2, "abcde", 1, 1, 1);
- test("abcde", 1, 2, "abcde", 1, 2, 0);
- test("abcde", 1, 2, "abcde", 1, 3, -1);
- test("abcde", 1, 2, "abcde", 1, 4, -2);
- test("abcde", 1, 2, "abcde", 1, 5, -2);
- test("abcde", 1, 2, "abcde", 2, 0, 2);
- test("abcde", 1, 2, "abcde", 2, 1, -1);
- test("abcde", 1, 2, "abcde", 2, 2, -1);
- test("abcde", 1, 2, "abcde", 2, 3, -1);
- test("abcde", 1, 2, "abcde", 2, 4, -1);
- test("abcde", 1, 2, "abcde", 4, 0, 2);
- test("abcde", 1, 2, "abcde", 4, 1, -3);
- test("abcde", 1, 2, "abcde", 4, 2, -3);
- test("abcde", 1, 2, "abcde", 5, 0, 2);
- test("abcde", 1, 2, "abcde", 5, 1, 2);
- test("abcde", 1, 2, "abcde", 6, 0, 0);
- test("abcde", 1, 2, "abcdefghij", 0, 0, 2);
- test("abcde", 1, 2, "abcdefghij", 0, 1, 1);
- test("abcde", 1, 2, "abcdefghij", 0, 5, 1);
- test("abcde", 1, 2, "abcdefghij", 0, 9, 1);
- test("abcde", 1, 2, "abcdefghij", 0, 10, 1);
- test("abcde", 1, 2, "abcdefghij", 0, 11, 1);
- test("abcde", 1, 2, "abcdefghij", 1, 0, 2);
- test("abcde", 1, 2, "abcdefghij", 1, 1, 1);
- test("abcde", 1, 2, "abcdefghij", 1, 4, -2);
- test("abcde", 1, 2, "abcdefghij", 1, 8, -6);
- test("abcde", 1, 2, "abcdefghij", 1, 9, -7);
- test("abcde", 1, 2, "abcdefghij", 1, 10, -7);
- test("abcde", 1, 2, "abcdefghij", 5, 0, 2);
- test("abcde", 1, 2, "abcdefghij", 5, 1, -4);
- test("abcde", 1, 2, "abcdefghij", 5, 2, -4);
- test("abcde", 1, 2, "abcdefghij", 5, 4, -4);
- test("abcde", 1, 2, "abcdefghij", 5, 5, -4);
- test("abcde", 1, 2, "abcdefghij", 5, 6, -4);
- test("abcde", 1, 2, "abcdefghij", 9, 0, 2);
- test("abcde", 1, 2, "abcdefghij", 9, 1, -8);
- test("abcde", 1, 2, "abcdefghij", 9, 2, -8);
- test("abcde", 1, 2, "abcdefghij", 10, 0, 2);
- test("abcde", 1, 2, "abcdefghij", 10, 1, 2);
- test("abcde", 1, 2, "abcdefghij", 11, 0, 0);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 0, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 0, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 1, 1);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 9, -7);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 18, -16);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 19, -17);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 20, -17);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 0, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 0, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 0, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 1, 2);
- test("abcde", 1, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 1, 3, "", 0, 0, 3);
- test("abcde", 1, 3, "", 0, 1, 3);
- test("abcde", 1, 3, "", 1, 0, 0);
- test("abcde", 1, 3, "abcde", 0, 0, 3);
- test("abcde", 1, 3, "abcde", 0, 1, 1);
- test("abcde", 1, 3, "abcde", 0, 2, 1);
- test("abcde", 1, 3, "abcde", 0, 4, 1);
- test("abcde", 1, 3, "abcde", 0, 5, 1);
- test("abcde", 1, 3, "abcde", 0, 6, 1);
- test("abcde", 1, 3, "abcde", 1, 0, 3);
- test("abcde", 1, 3, "abcde", 1, 1, 2);
- test("abcde", 1, 3, "abcde", 1, 2, 1);
-}
-
-void test9()
-{
- test("abcde", 1, 3, "abcde", 1, 3, 0);
- test("abcde", 1, 3, "abcde", 1, 4, -1);
- test("abcde", 1, 3, "abcde", 1, 5, -1);
- test("abcde", 1, 3, "abcde", 2, 0, 3);
- test("abcde", 1, 3, "abcde", 2, 1, -1);
- test("abcde", 1, 3, "abcde", 2, 2, -1);
- test("abcde", 1, 3, "abcde", 2, 3, -1);
- test("abcde", 1, 3, "abcde", 2, 4, -1);
- test("abcde", 1, 3, "abcde", 4, 0, 3);
- test("abcde", 1, 3, "abcde", 4, 1, -3);
- test("abcde", 1, 3, "abcde", 4, 2, -3);
- test("abcde", 1, 3, "abcde", 5, 0, 3);
- test("abcde", 1, 3, "abcde", 5, 1, 3);
- test("abcde", 1, 3, "abcde", 6, 0, 0);
- test("abcde", 1, 3, "abcdefghij", 0, 0, 3);
- test("abcde", 1, 3, "abcdefghij", 0, 1, 1);
- test("abcde", 1, 3, "abcdefghij", 0, 5, 1);
- test("abcde", 1, 3, "abcdefghij", 0, 9, 1);
- test("abcde", 1, 3, "abcdefghij", 0, 10, 1);
- test("abcde", 1, 3, "abcdefghij", 0, 11, 1);
- test("abcde", 1, 3, "abcdefghij", 1, 0, 3);
- test("abcde", 1, 3, "abcdefghij", 1, 1, 2);
- test("abcde", 1, 3, "abcdefghij", 1, 4, -1);
- test("abcde", 1, 3, "abcdefghij", 1, 8, -5);
- test("abcde", 1, 3, "abcdefghij", 1, 9, -6);
- test("abcde", 1, 3, "abcdefghij", 1, 10, -6);
- test("abcde", 1, 3, "abcdefghij", 5, 0, 3);
- test("abcde", 1, 3, "abcdefghij", 5, 1, -4);
- test("abcde", 1, 3, "abcdefghij", 5, 2, -4);
- test("abcde", 1, 3, "abcdefghij", 5, 4, -4);
- test("abcde", 1, 3, "abcdefghij", 5, 5, -4);
- test("abcde", 1, 3, "abcdefghij", 5, 6, -4);
- test("abcde", 1, 3, "abcdefghij", 9, 0, 3);
- test("abcde", 1, 3, "abcdefghij", 9, 1, -8);
- test("abcde", 1, 3, "abcdefghij", 9, 2, -8);
- test("abcde", 1, 3, "abcdefghij", 10, 0, 3);
- test("abcde", 1, 3, "abcdefghij", 10, 1, 3);
- test("abcde", 1, 3, "abcdefghij", 11, 0, 0);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 0, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 0, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 1, 2);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 9, -6);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 18, -15);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 19, -16);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 20, -16);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 0, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 0, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 0, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 1, 3);
- test("abcde", 1, 3, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 1, 4, "", 0, 0, 4);
- test("abcde", 1, 4, "", 0, 1, 4);
- test("abcde", 1, 4, "", 1, 0, 0);
- test("abcde", 1, 4, "abcde", 0, 0, 4);
- test("abcde", 1, 4, "abcde", 0, 1, 1);
- test("abcde", 1, 4, "abcde", 0, 2, 1);
- test("abcde", 1, 4, "abcde", 0, 4, 1);
- test("abcde", 1, 4, "abcde", 0, 5, 1);
- test("abcde", 1, 4, "abcde", 0, 6, 1);
- test("abcde", 1, 4, "abcde", 1, 0, 4);
- test("abcde", 1, 4, "abcde", 1, 1, 3);
- test("abcde", 1, 4, "abcde", 1, 2, 2);
- test("abcde", 1, 4, "abcde", 1, 3, 1);
- test("abcde", 1, 4, "abcde", 1, 4, 0);
- test("abcde", 1, 4, "abcde", 1, 5, 0);
- test("abcde", 1, 4, "abcde", 2, 0, 4);
- test("abcde", 1, 4, "abcde", 2, 1, -1);
- test("abcde", 1, 4, "abcde", 2, 2, -1);
- test("abcde", 1, 4, "abcde", 2, 3, -1);
- test("abcde", 1, 4, "abcde", 2, 4, -1);
- test("abcde", 1, 4, "abcde", 4, 0, 4);
- test("abcde", 1, 4, "abcde", 4, 1, -3);
- test("abcde", 1, 4, "abcde", 4, 2, -3);
- test("abcde", 1, 4, "abcde", 5, 0, 4);
- test("abcde", 1, 4, "abcde", 5, 1, 4);
- test("abcde", 1, 4, "abcde", 6, 0, 0);
- test("abcde", 1, 4, "abcdefghij", 0, 0, 4);
- test("abcde", 1, 4, "abcdefghij", 0, 1, 1);
- test("abcde", 1, 4, "abcdefghij", 0, 5, 1);
- test("abcde", 1, 4, "abcdefghij", 0, 9, 1);
- test("abcde", 1, 4, "abcdefghij", 0, 10, 1);
- test("abcde", 1, 4, "abcdefghij", 0, 11, 1);
- test("abcde", 1, 4, "abcdefghij", 1, 0, 4);
- test("abcde", 1, 4, "abcdefghij", 1, 1, 3);
- test("abcde", 1, 4, "abcdefghij", 1, 4, 0);
- test("abcde", 1, 4, "abcdefghij", 1, 8, -4);
- test("abcde", 1, 4, "abcdefghij", 1, 9, -5);
- test("abcde", 1, 4, "abcdefghij", 1, 10, -5);
-}
-
-void test10()
-{
- test("abcde", 1, 4, "abcdefghij", 5, 0, 4);
- test("abcde", 1, 4, "abcdefghij", 5, 1, -4);
- test("abcde", 1, 4, "abcdefghij", 5, 2, -4);
- test("abcde", 1, 4, "abcdefghij", 5, 4, -4);
- test("abcde", 1, 4, "abcdefghij", 5, 5, -4);
- test("abcde", 1, 4, "abcdefghij", 5, 6, -4);
- test("abcde", 1, 4, "abcdefghij", 9, 0, 4);
- test("abcde", 1, 4, "abcdefghij", 9, 1, -8);
- test("abcde", 1, 4, "abcdefghij", 9, 2, -8);
- test("abcde", 1, 4, "abcdefghij", 10, 0, 4);
- test("abcde", 1, 4, "abcdefghij", 10, 1, 4);
- test("abcde", 1, 4, "abcdefghij", 11, 0, 0);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 0, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 0, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 1, 3);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 9, -5);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 18, -14);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 19, -15);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 20, -15);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 0, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 0, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 0, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 1, 4);
- test("abcde", 1, 4, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 1, 5, "", 0, 0, 4);
- test("abcde", 1, 5, "", 0, 1, 4);
- test("abcde", 1, 5, "", 1, 0, 0);
- test("abcde", 1, 5, "abcde", 0, 0, 4);
- test("abcde", 1, 5, "abcde", 0, 1, 1);
- test("abcde", 1, 5, "abcde", 0, 2, 1);
- test("abcde", 1, 5, "abcde", 0, 4, 1);
- test("abcde", 1, 5, "abcde", 0, 5, 1);
- test("abcde", 1, 5, "abcde", 0, 6, 1);
- test("abcde", 1, 5, "abcde", 1, 0, 4);
- test("abcde", 1, 5, "abcde", 1, 1, 3);
- test("abcde", 1, 5, "abcde", 1, 2, 2);
- test("abcde", 1, 5, "abcde", 1, 3, 1);
- test("abcde", 1, 5, "abcde", 1, 4, 0);
- test("abcde", 1, 5, "abcde", 1, 5, 0);
- test("abcde", 1, 5, "abcde", 2, 0, 4);
- test("abcde", 1, 5, "abcde", 2, 1, -1);
- test("abcde", 1, 5, "abcde", 2, 2, -1);
- test("abcde", 1, 5, "abcde", 2, 3, -1);
- test("abcde", 1, 5, "abcde", 2, 4, -1);
- test("abcde", 1, 5, "abcde", 4, 0, 4);
- test("abcde", 1, 5, "abcde", 4, 1, -3);
- test("abcde", 1, 5, "abcde", 4, 2, -3);
- test("abcde", 1, 5, "abcde", 5, 0, 4);
- test("abcde", 1, 5, "abcde", 5, 1, 4);
- test("abcde", 1, 5, "abcde", 6, 0, 0);
- test("abcde", 1, 5, "abcdefghij", 0, 0, 4);
- test("abcde", 1, 5, "abcdefghij", 0, 1, 1);
- test("abcde", 1, 5, "abcdefghij", 0, 5, 1);
- test("abcde", 1, 5, "abcdefghij", 0, 9, 1);
- test("abcde", 1, 5, "abcdefghij", 0, 10, 1);
- test("abcde", 1, 5, "abcdefghij", 0, 11, 1);
- test("abcde", 1, 5, "abcdefghij", 1, 0, 4);
- test("abcde", 1, 5, "abcdefghij", 1, 1, 3);
- test("abcde", 1, 5, "abcdefghij", 1, 4, 0);
- test("abcde", 1, 5, "abcdefghij", 1, 8, -4);
- test("abcde", 1, 5, "abcdefghij", 1, 9, -5);
- test("abcde", 1, 5, "abcdefghij", 1, 10, -5);
- test("abcde", 1, 5, "abcdefghij", 5, 0, 4);
- test("abcde", 1, 5, "abcdefghij", 5, 1, -4);
- test("abcde", 1, 5, "abcdefghij", 5, 2, -4);
- test("abcde", 1, 5, "abcdefghij", 5, 4, -4);
- test("abcde", 1, 5, "abcdefghij", 5, 5, -4);
- test("abcde", 1, 5, "abcdefghij", 5, 6, -4);
- test("abcde", 1, 5, "abcdefghij", 9, 0, 4);
- test("abcde", 1, 5, "abcdefghij", 9, 1, -8);
- test("abcde", 1, 5, "abcdefghij", 9, 2, -8);
- test("abcde", 1, 5, "abcdefghij", 10, 0, 4);
- test("abcde", 1, 5, "abcdefghij", 10, 1, 4);
- test("abcde", 1, 5, "abcdefghij", 11, 0, 0);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 0, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 0, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 1, 3);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 9, -5);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 18, -14);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 19, -15);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 20, -15);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 0, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 1, -9);
-}
-
-void test11()
-{
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 0, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 0, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 1, 4);
- test("abcde", 1, 5, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 2, 0, "", 0, 0, 0);
- test("abcde", 2, 0, "", 0, 1, 0);
- test("abcde", 2, 0, "", 1, 0, 0);
- test("abcde", 2, 0, "abcde", 0, 0, 0);
- test("abcde", 2, 0, "abcde", 0, 1, -1);
- test("abcde", 2, 0, "abcde", 0, 2, -2);
- test("abcde", 2, 0, "abcde", 0, 4, -4);
- test("abcde", 2, 0, "abcde", 0, 5, -5);
- test("abcde", 2, 0, "abcde", 0, 6, -5);
- test("abcde", 2, 0, "abcde", 1, 0, 0);
- test("abcde", 2, 0, "abcde", 1, 1, -1);
- test("abcde", 2, 0, "abcde", 1, 2, -2);
- test("abcde", 2, 0, "abcde", 1, 3, -3);
- test("abcde", 2, 0, "abcde", 1, 4, -4);
- test("abcde", 2, 0, "abcde", 1, 5, -4);
- test("abcde", 2, 0, "abcde", 2, 0, 0);
- test("abcde", 2, 0, "abcde", 2, 1, -1);
- test("abcde", 2, 0, "abcde", 2, 2, -2);
- test("abcde", 2, 0, "abcde", 2, 3, -3);
- test("abcde", 2, 0, "abcde", 2, 4, -3);
- test("abcde", 2, 0, "abcde", 4, 0, 0);
- test("abcde", 2, 0, "abcde", 4, 1, -1);
- test("abcde", 2, 0, "abcde", 4, 2, -1);
- test("abcde", 2, 0, "abcde", 5, 0, 0);
- test("abcde", 2, 0, "abcde", 5, 1, 0);
- test("abcde", 2, 0, "abcde", 6, 0, 0);
- test("abcde", 2, 0, "abcdefghij", 0, 0, 0);
- test("abcde", 2, 0, "abcdefghij", 0, 1, -1);
- test("abcde", 2, 0, "abcdefghij", 0, 5, -5);
- test("abcde", 2, 0, "abcdefghij", 0, 9, -9);
- test("abcde", 2, 0, "abcdefghij", 0, 10, -10);
- test("abcde", 2, 0, "abcdefghij", 0, 11, -10);
- test("abcde", 2, 0, "abcdefghij", 1, 0, 0);
- test("abcde", 2, 0, "abcdefghij", 1, 1, -1);
- test("abcde", 2, 0, "abcdefghij", 1, 4, -4);
- test("abcde", 2, 0, "abcdefghij", 1, 8, -8);
- test("abcde", 2, 0, "abcdefghij", 1, 9, -9);
- test("abcde", 2, 0, "abcdefghij", 1, 10, -9);
- test("abcde", 2, 0, "abcdefghij", 5, 0, 0);
- test("abcde", 2, 0, "abcdefghij", 5, 1, -1);
- test("abcde", 2, 0, "abcdefghij", 5, 2, -2);
- test("abcde", 2, 0, "abcdefghij", 5, 4, -4);
- test("abcde", 2, 0, "abcdefghij", 5, 5, -5);
- test("abcde", 2, 0, "abcdefghij", 5, 6, -5);
- test("abcde", 2, 0, "abcdefghij", 9, 0, 0);
- test("abcde", 2, 0, "abcdefghij", 9, 1, -1);
- test("abcde", 2, 0, "abcdefghij", 9, 2, -1);
- test("abcde", 2, 0, "abcdefghij", 10, 0, 0);
- test("abcde", 2, 0, "abcdefghij", 10, 1, 0);
- test("abcde", 2, 0, "abcdefghij", 11, 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 2, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 2, 1, "", 0, 0, 1);
- test("abcde", 2, 1, "", 0, 1, 1);
- test("abcde", 2, 1, "", 1, 0, 0);
- test("abcde", 2, 1, "abcde", 0, 0, 1);
- test("abcde", 2, 1, "abcde", 0, 1, 2);
- test("abcde", 2, 1, "abcde", 0, 2, 2);
- test("abcde", 2, 1, "abcde", 0, 4, 2);
- test("abcde", 2, 1, "abcde", 0, 5, 2);
- test("abcde", 2, 1, "abcde", 0, 6, 2);
- test("abcde", 2, 1, "abcde", 1, 0, 1);
- test("abcde", 2, 1, "abcde", 1, 1, 1);
- test("abcde", 2, 1, "abcde", 1, 2, 1);
- test("abcde", 2, 1, "abcde", 1, 3, 1);
- test("abcde", 2, 1, "abcde", 1, 4, 1);
- test("abcde", 2, 1, "abcde", 1, 5, 1);
- test("abcde", 2, 1, "abcde", 2, 0, 1);
-}
-
-void test12()
-{
- test("abcde", 2, 1, "abcde", 2, 1, 0);
- test("abcde", 2, 1, "abcde", 2, 2, -1);
- test("abcde", 2, 1, "abcde", 2, 3, -2);
- test("abcde", 2, 1, "abcde", 2, 4, -2);
- test("abcde", 2, 1, "abcde", 4, 0, 1);
- test("abcde", 2, 1, "abcde", 4, 1, -2);
- test("abcde", 2, 1, "abcde", 4, 2, -2);
- test("abcde", 2, 1, "abcde", 5, 0, 1);
- test("abcde", 2, 1, "abcde", 5, 1, 1);
- test("abcde", 2, 1, "abcde", 6, 0, 0);
- test("abcde", 2, 1, "abcdefghij", 0, 0, 1);
- test("abcde", 2, 1, "abcdefghij", 0, 1, 2);
- test("abcde", 2, 1, "abcdefghij", 0, 5, 2);
- test("abcde", 2, 1, "abcdefghij", 0, 9, 2);
- test("abcde", 2, 1, "abcdefghij", 0, 10, 2);
- test("abcde", 2, 1, "abcdefghij", 0, 11, 2);
- test("abcde", 2, 1, "abcdefghij", 1, 0, 1);
- test("abcde", 2, 1, "abcdefghij", 1, 1, 1);
- test("abcde", 2, 1, "abcdefghij", 1, 4, 1);
- test("abcde", 2, 1, "abcdefghij", 1, 8, 1);
- test("abcde", 2, 1, "abcdefghij", 1, 9, 1);
- test("abcde", 2, 1, "abcdefghij", 1, 10, 1);
- test("abcde", 2, 1, "abcdefghij", 5, 0, 1);
- test("abcde", 2, 1, "abcdefghij", 5, 1, -3);
- test("abcde", 2, 1, "abcdefghij", 5, 2, -3);
- test("abcde", 2, 1, "abcdefghij", 5, 4, -3);
- test("abcde", 2, 1, "abcdefghij", 5, 5, -3);
- test("abcde", 2, 1, "abcdefghij", 5, 6, -3);
- test("abcde", 2, 1, "abcdefghij", 9, 0, 1);
- test("abcde", 2, 1, "abcdefghij", 9, 1, -7);
- test("abcde", 2, 1, "abcdefghij", 9, 2, -7);
- test("abcde", 2, 1, "abcdefghij", 10, 0, 1);
- test("abcde", 2, 1, "abcdefghij", 10, 1, 1);
- test("abcde", 2, 1, "abcdefghij", 11, 0, 0);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 1, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 10, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 19, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 20, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 21, 2);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 1, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 9, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 18, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 19, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 20, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 1, -8);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 5, -8);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 9, -8);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 10, -8);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 11, -8);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 1, -17);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 2, -17);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcde", 2, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 2, 2, "", 0, 0, 2);
- test("abcde", 2, 2, "", 0, 1, 2);
- test("abcde", 2, 2, "", 1, 0, 0);
- test("abcde", 2, 2, "abcde", 0, 0, 2);
- test("abcde", 2, 2, "abcde", 0, 1, 2);
- test("abcde", 2, 2, "abcde", 0, 2, 2);
- test("abcde", 2, 2, "abcde", 0, 4, 2);
- test("abcde", 2, 2, "abcde", 0, 5, 2);
- test("abcde", 2, 2, "abcde", 0, 6, 2);
- test("abcde", 2, 2, "abcde", 1, 0, 2);
- test("abcde", 2, 2, "abcde", 1, 1, 1);
- test("abcde", 2, 2, "abcde", 1, 2, 1);
- test("abcde", 2, 2, "abcde", 1, 3, 1);
- test("abcde", 2, 2, "abcde", 1, 4, 1);
- test("abcde", 2, 2, "abcde", 1, 5, 1);
- test("abcde", 2, 2, "abcde", 2, 0, 2);
- test("abcde", 2, 2, "abcde", 2, 1, 1);
- test("abcde", 2, 2, "abcde", 2, 2, 0);
- test("abcde", 2, 2, "abcde", 2, 3, -1);
- test("abcde", 2, 2, "abcde", 2, 4, -1);
- test("abcde", 2, 2, "abcde", 4, 0, 2);
- test("abcde", 2, 2, "abcde", 4, 1, -2);
- test("abcde", 2, 2, "abcde", 4, 2, -2);
- test("abcde", 2, 2, "abcde", 5, 0, 2);
- test("abcde", 2, 2, "abcde", 5, 1, 2);
- test("abcde", 2, 2, "abcde", 6, 0, 0);
- test("abcde", 2, 2, "abcdefghij", 0, 0, 2);
- test("abcde", 2, 2, "abcdefghij", 0, 1, 2);
- test("abcde", 2, 2, "abcdefghij", 0, 5, 2);
- test("abcde", 2, 2, "abcdefghij", 0, 9, 2);
- test("abcde", 2, 2, "abcdefghij", 0, 10, 2);
- test("abcde", 2, 2, "abcdefghij", 0, 11, 2);
- test("abcde", 2, 2, "abcdefghij", 1, 0, 2);
- test("abcde", 2, 2, "abcdefghij", 1, 1, 1);
- test("abcde", 2, 2, "abcdefghij", 1, 4, 1);
- test("abcde", 2, 2, "abcdefghij", 1, 8, 1);
- test("abcde", 2, 2, "abcdefghij", 1, 9, 1);
- test("abcde", 2, 2, "abcdefghij", 1, 10, 1);
- test("abcde", 2, 2, "abcdefghij", 5, 0, 2);
- test("abcde", 2, 2, "abcdefghij", 5, 1, -3);
- test("abcde", 2, 2, "abcdefghij", 5, 2, -3);
- test("abcde", 2, 2, "abcdefghij", 5, 4, -3);
-}
-
-void test13()
-{
- test("abcde", 2, 2, "abcdefghij", 5, 5, -3);
- test("abcde", 2, 2, "abcdefghij", 5, 6, -3);
- test("abcde", 2, 2, "abcdefghij", 9, 0, 2);
- test("abcde", 2, 2, "abcdefghij", 9, 1, -7);
- test("abcde", 2, 2, "abcdefghij", 9, 2, -7);
- test("abcde", 2, 2, "abcdefghij", 10, 0, 2);
- test("abcde", 2, 2, "abcdefghij", 10, 1, 2);
- test("abcde", 2, 2, "abcdefghij", 11, 0, 0);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 0, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 1, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 10, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 19, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 20, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 21, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 0, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 1, 1);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 9, 1);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 18, 1);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 19, 1);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 20, 1);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 0, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 1, -8);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 5, -8);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 9, -8);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 10, -8);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 11, -8);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 0, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 1, -17);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 2, -17);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 0, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 1, 2);
- test("abcde", 2, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 2, 3, "", 0, 0, 3);
- test("abcde", 2, 3, "", 0, 1, 3);
- test("abcde", 2, 3, "", 1, 0, 0);
- test("abcde", 2, 3, "abcde", 0, 0, 3);
- test("abcde", 2, 3, "abcde", 0, 1, 2);
- test("abcde", 2, 3, "abcde", 0, 2, 2);
- test("abcde", 2, 3, "abcde", 0, 4, 2);
- test("abcde", 2, 3, "abcde", 0, 5, 2);
- test("abcde", 2, 3, "abcde", 0, 6, 2);
- test("abcde", 2, 3, "abcde", 1, 0, 3);
- test("abcde", 2, 3, "abcde", 1, 1, 1);
- test("abcde", 2, 3, "abcde", 1, 2, 1);
- test("abcde", 2, 3, "abcde", 1, 3, 1);
- test("abcde", 2, 3, "abcde", 1, 4, 1);
- test("abcde", 2, 3, "abcde", 1, 5, 1);
- test("abcde", 2, 3, "abcde", 2, 0, 3);
- test("abcde", 2, 3, "abcde", 2, 1, 2);
- test("abcde", 2, 3, "abcde", 2, 2, 1);
- test("abcde", 2, 3, "abcde", 2, 3, 0);
- test("abcde", 2, 3, "abcde", 2, 4, 0);
- test("abcde", 2, 3, "abcde", 4, 0, 3);
- test("abcde", 2, 3, "abcde", 4, 1, -2);
- test("abcde", 2, 3, "abcde", 4, 2, -2);
- test("abcde", 2, 3, "abcde", 5, 0, 3);
- test("abcde", 2, 3, "abcde", 5, 1, 3);
- test("abcde", 2, 3, "abcde", 6, 0, 0);
- test("abcde", 2, 3, "abcdefghij", 0, 0, 3);
- test("abcde", 2, 3, "abcdefghij", 0, 1, 2);
- test("abcde", 2, 3, "abcdefghij", 0, 5, 2);
- test("abcde", 2, 3, "abcdefghij", 0, 9, 2);
- test("abcde", 2, 3, "abcdefghij", 0, 10, 2);
- test("abcde", 2, 3, "abcdefghij", 0, 11, 2);
- test("abcde", 2, 3, "abcdefghij", 1, 0, 3);
- test("abcde", 2, 3, "abcdefghij", 1, 1, 1);
- test("abcde", 2, 3, "abcdefghij", 1, 4, 1);
- test("abcde", 2, 3, "abcdefghij", 1, 8, 1);
- test("abcde", 2, 3, "abcdefghij", 1, 9, 1);
- test("abcde", 2, 3, "abcdefghij", 1, 10, 1);
- test("abcde", 2, 3, "abcdefghij", 5, 0, 3);
- test("abcde", 2, 3, "abcdefghij", 5, 1, -3);
- test("abcde", 2, 3, "abcdefghij", 5, 2, -3);
- test("abcde", 2, 3, "abcdefghij", 5, 4, -3);
- test("abcde", 2, 3, "abcdefghij", 5, 5, -3);
- test("abcde", 2, 3, "abcdefghij", 5, 6, -3);
- test("abcde", 2, 3, "abcdefghij", 9, 0, 3);
- test("abcde", 2, 3, "abcdefghij", 9, 1, -7);
- test("abcde", 2, 3, "abcdefghij", 9, 2, -7);
- test("abcde", 2, 3, "abcdefghij", 10, 0, 3);
- test("abcde", 2, 3, "abcdefghij", 10, 1, 3);
- test("abcde", 2, 3, "abcdefghij", 11, 0, 0);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 0, 3);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 1, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 10, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 19, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 20, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 21, 2);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 0, 3);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 1, 1);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 9, 1);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 18, 1);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 19, 1);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 20, 1);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 0, 3);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 1, -8);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 5, -8);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 9, -8);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 10, -8);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 11, -8);
-}
-
-void test14()
-{
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 0, 3);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 1, -17);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 2, -17);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 0, 3);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 1, 3);
- test("abcde", 2, 3, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 2, 4, "", 0, 0, 3);
- test("abcde", 2, 4, "", 0, 1, 3);
- test("abcde", 2, 4, "", 1, 0, 0);
- test("abcde", 2, 4, "abcde", 0, 0, 3);
- test("abcde", 2, 4, "abcde", 0, 1, 2);
- test("abcde", 2, 4, "abcde", 0, 2, 2);
- test("abcde", 2, 4, "abcde", 0, 4, 2);
- test("abcde", 2, 4, "abcde", 0, 5, 2);
- test("abcde", 2, 4, "abcde", 0, 6, 2);
- test("abcde", 2, 4, "abcde", 1, 0, 3);
- test("abcde", 2, 4, "abcde", 1, 1, 1);
- test("abcde", 2, 4, "abcde", 1, 2, 1);
- test("abcde", 2, 4, "abcde", 1, 3, 1);
- test("abcde", 2, 4, "abcde", 1, 4, 1);
- test("abcde", 2, 4, "abcde", 1, 5, 1);
- test("abcde", 2, 4, "abcde", 2, 0, 3);
- test("abcde", 2, 4, "abcde", 2, 1, 2);
- test("abcde", 2, 4, "abcde", 2, 2, 1);
- test("abcde", 2, 4, "abcde", 2, 3, 0);
- test("abcde", 2, 4, "abcde", 2, 4, 0);
- test("abcde", 2, 4, "abcde", 4, 0, 3);
- test("abcde", 2, 4, "abcde", 4, 1, -2);
- test("abcde", 2, 4, "abcde", 4, 2, -2);
- test("abcde", 2, 4, "abcde", 5, 0, 3);
- test("abcde", 2, 4, "abcde", 5, 1, 3);
- test("abcde", 2, 4, "abcde", 6, 0, 0);
- test("abcde", 2, 4, "abcdefghij", 0, 0, 3);
- test("abcde", 2, 4, "abcdefghij", 0, 1, 2);
- test("abcde", 2, 4, "abcdefghij", 0, 5, 2);
- test("abcde", 2, 4, "abcdefghij", 0, 9, 2);
- test("abcde", 2, 4, "abcdefghij", 0, 10, 2);
- test("abcde", 2, 4, "abcdefghij", 0, 11, 2);
- test("abcde", 2, 4, "abcdefghij", 1, 0, 3);
- test("abcde", 2, 4, "abcdefghij", 1, 1, 1);
- test("abcde", 2, 4, "abcdefghij", 1, 4, 1);
- test("abcde", 2, 4, "abcdefghij", 1, 8, 1);
- test("abcde", 2, 4, "abcdefghij", 1, 9, 1);
- test("abcde", 2, 4, "abcdefghij", 1, 10, 1);
- test("abcde", 2, 4, "abcdefghij", 5, 0, 3);
- test("abcde", 2, 4, "abcdefghij", 5, 1, -3);
- test("abcde", 2, 4, "abcdefghij", 5, 2, -3);
- test("abcde", 2, 4, "abcdefghij", 5, 4, -3);
- test("abcde", 2, 4, "abcdefghij", 5, 5, -3);
- test("abcde", 2, 4, "abcdefghij", 5, 6, -3);
- test("abcde", 2, 4, "abcdefghij", 9, 0, 3);
- test("abcde", 2, 4, "abcdefghij", 9, 1, -7);
- test("abcde", 2, 4, "abcdefghij", 9, 2, -7);
- test("abcde", 2, 4, "abcdefghij", 10, 0, 3);
- test("abcde", 2, 4, "abcdefghij", 10, 1, 3);
- test("abcde", 2, 4, "abcdefghij", 11, 0, 0);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 0, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 1, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 10, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 19, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 20, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 21, 2);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 0, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 1, 1);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 9, 1);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 18, 1);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 19, 1);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 20, 1);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 0, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 1, -8);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 5, -8);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 9, -8);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 10, -8);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 11, -8);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 0, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 1, -17);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 2, -17);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 0, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 1, 3);
- test("abcde", 2, 4, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 4, 0, "", 0, 0, 0);
- test("abcde", 4, 0, "", 0, 1, 0);
- test("abcde", 4, 0, "", 1, 0, 0);
- test("abcde", 4, 0, "abcde", 0, 0, 0);
- test("abcde", 4, 0, "abcde", 0, 1, -1);
- test("abcde", 4, 0, "abcde", 0, 2, -2);
- test("abcde", 4, 0, "abcde", 0, 4, -4);
- test("abcde", 4, 0, "abcde", 0, 5, -5);
- test("abcde", 4, 0, "abcde", 0, 6, -5);
- test("abcde", 4, 0, "abcde", 1, 0, 0);
- test("abcde", 4, 0, "abcde", 1, 1, -1);
- test("abcde", 4, 0, "abcde", 1, 2, -2);
- test("abcde", 4, 0, "abcde", 1, 3, -3);
- test("abcde", 4, 0, "abcde", 1, 4, -4);
- test("abcde", 4, 0, "abcde", 1, 5, -4);
- test("abcde", 4, 0, "abcde", 2, 0, 0);
- test("abcde", 4, 0, "abcde", 2, 1, -1);
- test("abcde", 4, 0, "abcde", 2, 2, -2);
- test("abcde", 4, 0, "abcde", 2, 3, -3);
- test("abcde", 4, 0, "abcde", 2, 4, -3);
-}
-
-void test15()
-{
- test("abcde", 4, 0, "abcde", 4, 0, 0);
- test("abcde", 4, 0, "abcde", 4, 1, -1);
- test("abcde", 4, 0, "abcde", 4, 2, -1);
- test("abcde", 4, 0, "abcde", 5, 0, 0);
- test("abcde", 4, 0, "abcde", 5, 1, 0);
- test("abcde", 4, 0, "abcde", 6, 0, 0);
- test("abcde", 4, 0, "abcdefghij", 0, 0, 0);
- test("abcde", 4, 0, "abcdefghij", 0, 1, -1);
- test("abcde", 4, 0, "abcdefghij", 0, 5, -5);
- test("abcde", 4, 0, "abcdefghij", 0, 9, -9);
- test("abcde", 4, 0, "abcdefghij", 0, 10, -10);
- test("abcde", 4, 0, "abcdefghij", 0, 11, -10);
- test("abcde", 4, 0, "abcdefghij", 1, 0, 0);
- test("abcde", 4, 0, "abcdefghij", 1, 1, -1);
- test("abcde", 4, 0, "abcdefghij", 1, 4, -4);
- test("abcde", 4, 0, "abcdefghij", 1, 8, -8);
- test("abcde", 4, 0, "abcdefghij", 1, 9, -9);
- test("abcde", 4, 0, "abcdefghij", 1, 10, -9);
- test("abcde", 4, 0, "abcdefghij", 5, 0, 0);
- test("abcde", 4, 0, "abcdefghij", 5, 1, -1);
- test("abcde", 4, 0, "abcdefghij", 5, 2, -2);
- test("abcde", 4, 0, "abcdefghij", 5, 4, -4);
- test("abcde", 4, 0, "abcdefghij", 5, 5, -5);
- test("abcde", 4, 0, "abcdefghij", 5, 6, -5);
- test("abcde", 4, 0, "abcdefghij", 9, 0, 0);
- test("abcde", 4, 0, "abcdefghij", 9, 1, -1);
- test("abcde", 4, 0, "abcdefghij", 9, 2, -1);
- test("abcde", 4, 0, "abcdefghij", 10, 0, 0);
- test("abcde", 4, 0, "abcdefghij", 10, 1, 0);
- test("abcde", 4, 0, "abcdefghij", 11, 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 4, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 4, 1, "", 0, 0, 1);
- test("abcde", 4, 1, "", 0, 1, 1);
- test("abcde", 4, 1, "", 1, 0, 0);
- test("abcde", 4, 1, "abcde", 0, 0, 1);
- test("abcde", 4, 1, "abcde", 0, 1, 4);
- test("abcde", 4, 1, "abcde", 0, 2, 4);
- test("abcde", 4, 1, "abcde", 0, 4, 4);
- test("abcde", 4, 1, "abcde", 0, 5, 4);
- test("abcde", 4, 1, "abcde", 0, 6, 4);
- test("abcde", 4, 1, "abcde", 1, 0, 1);
- test("abcde", 4, 1, "abcde", 1, 1, 3);
- test("abcde", 4, 1, "abcde", 1, 2, 3);
- test("abcde", 4, 1, "abcde", 1, 3, 3);
- test("abcde", 4, 1, "abcde", 1, 4, 3);
- test("abcde", 4, 1, "abcde", 1, 5, 3);
- test("abcde", 4, 1, "abcde", 2, 0, 1);
- test("abcde", 4, 1, "abcde", 2, 1, 2);
- test("abcde", 4, 1, "abcde", 2, 2, 2);
- test("abcde", 4, 1, "abcde", 2, 3, 2);
- test("abcde", 4, 1, "abcde", 2, 4, 2);
- test("abcde", 4, 1, "abcde", 4, 0, 1);
- test("abcde", 4, 1, "abcde", 4, 1, 0);
- test("abcde", 4, 1, "abcde", 4, 2, 0);
- test("abcde", 4, 1, "abcde", 5, 0, 1);
- test("abcde", 4, 1, "abcde", 5, 1, 1);
- test("abcde", 4, 1, "abcde", 6, 0, 0);
- test("abcde", 4, 1, "abcdefghij", 0, 0, 1);
- test("abcde", 4, 1, "abcdefghij", 0, 1, 4);
- test("abcde", 4, 1, "abcdefghij", 0, 5, 4);
- test("abcde", 4, 1, "abcdefghij", 0, 9, 4);
- test("abcde", 4, 1, "abcdefghij", 0, 10, 4);
- test("abcde", 4, 1, "abcdefghij", 0, 11, 4);
- test("abcde", 4, 1, "abcdefghij", 1, 0, 1);
- test("abcde", 4, 1, "abcdefghij", 1, 1, 3);
- test("abcde", 4, 1, "abcdefghij", 1, 4, 3);
- test("abcde", 4, 1, "abcdefghij", 1, 8, 3);
- test("abcde", 4, 1, "abcdefghij", 1, 9, 3);
- test("abcde", 4, 1, "abcdefghij", 1, 10, 3);
- test("abcde", 4, 1, "abcdefghij", 5, 0, 1);
- test("abcde", 4, 1, "abcdefghij", 5, 1, -1);
- test("abcde", 4, 1, "abcdefghij", 5, 2, -1);
- test("abcde", 4, 1, "abcdefghij", 5, 4, -1);
- test("abcde", 4, 1, "abcdefghij", 5, 5, -1);
- test("abcde", 4, 1, "abcdefghij", 5, 6, -1);
- test("abcde", 4, 1, "abcdefghij", 9, 0, 1);
- test("abcde", 4, 1, "abcdefghij", 9, 1, -5);
-}
-
-void test16()
-{
- test("abcde", 4, 1, "abcdefghij", 9, 2, -5);
- test("abcde", 4, 1, "abcdefghij", 10, 0, 1);
- test("abcde", 4, 1, "abcdefghij", 10, 1, 1);
- test("abcde", 4, 1, "abcdefghij", 11, 0, 0);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 1, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 10, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 19, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 20, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 21, 4);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 1, 3);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 9, 3);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 18, 3);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 19, 3);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 20, 3);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 1, -6);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 5, -6);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 9, -6);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 10, -6);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 11, -6);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 1, -15);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 2, -15);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcde", 4, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 4, 2, "", 0, 0, 1);
- test("abcde", 4, 2, "", 0, 1, 1);
- test("abcde", 4, 2, "", 1, 0, 0);
- test("abcde", 4, 2, "abcde", 0, 0, 1);
- test("abcde", 4, 2, "abcde", 0, 1, 4);
- test("abcde", 4, 2, "abcde", 0, 2, 4);
- test("abcde", 4, 2, "abcde", 0, 4, 4);
- test("abcde", 4, 2, "abcde", 0, 5, 4);
- test("abcde", 4, 2, "abcde", 0, 6, 4);
- test("abcde", 4, 2, "abcde", 1, 0, 1);
- test("abcde", 4, 2, "abcde", 1, 1, 3);
- test("abcde", 4, 2, "abcde", 1, 2, 3);
- test("abcde", 4, 2, "abcde", 1, 3, 3);
- test("abcde", 4, 2, "abcde", 1, 4, 3);
- test("abcde", 4, 2, "abcde", 1, 5, 3);
- test("abcde", 4, 2, "abcde", 2, 0, 1);
- test("abcde", 4, 2, "abcde", 2, 1, 2);
- test("abcde", 4, 2, "abcde", 2, 2, 2);
- test("abcde", 4, 2, "abcde", 2, 3, 2);
- test("abcde", 4, 2, "abcde", 2, 4, 2);
- test("abcde", 4, 2, "abcde", 4, 0, 1);
- test("abcde", 4, 2, "abcde", 4, 1, 0);
- test("abcde", 4, 2, "abcde", 4, 2, 0);
- test("abcde", 4, 2, "abcde", 5, 0, 1);
- test("abcde", 4, 2, "abcde", 5, 1, 1);
- test("abcde", 4, 2, "abcde", 6, 0, 0);
- test("abcde", 4, 2, "abcdefghij", 0, 0, 1);
- test("abcde", 4, 2, "abcdefghij", 0, 1, 4);
- test("abcde", 4, 2, "abcdefghij", 0, 5, 4);
- test("abcde", 4, 2, "abcdefghij", 0, 9, 4);
- test("abcde", 4, 2, "abcdefghij", 0, 10, 4);
- test("abcde", 4, 2, "abcdefghij", 0, 11, 4);
- test("abcde", 4, 2, "abcdefghij", 1, 0, 1);
- test("abcde", 4, 2, "abcdefghij", 1, 1, 3);
- test("abcde", 4, 2, "abcdefghij", 1, 4, 3);
- test("abcde", 4, 2, "abcdefghij", 1, 8, 3);
- test("abcde", 4, 2, "abcdefghij", 1, 9, 3);
- test("abcde", 4, 2, "abcdefghij", 1, 10, 3);
- test("abcde", 4, 2, "abcdefghij", 5, 0, 1);
- test("abcde", 4, 2, "abcdefghij", 5, 1, -1);
- test("abcde", 4, 2, "abcdefghij", 5, 2, -1);
- test("abcde", 4, 2, "abcdefghij", 5, 4, -1);
- test("abcde", 4, 2, "abcdefghij", 5, 5, -1);
- test("abcde", 4, 2, "abcdefghij", 5, 6, -1);
- test("abcde", 4, 2, "abcdefghij", 9, 0, 1);
- test("abcde", 4, 2, "abcdefghij", 9, 1, -5);
- test("abcde", 4, 2, "abcdefghij", 9, 2, -5);
- test("abcde", 4, 2, "abcdefghij", 10, 0, 1);
- test("abcde", 4, 2, "abcdefghij", 10, 1, 1);
- test("abcde", 4, 2, "abcdefghij", 11, 0, 0);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 1, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 10, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 19, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 20, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 21, 4);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 1, 3);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 9, 3);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 18, 3);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 19, 3);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 20, 3);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 1, -6);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 5, -6);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 9, -6);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 10, -6);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 11, -6);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 1, -15);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 2, -15);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 0, 1);
-}
-
-void test17()
-{
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcde", 4, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 5, 0, "", 0, 0, 0);
- test("abcde", 5, 0, "", 0, 1, 0);
- test("abcde", 5, 0, "", 1, 0, 0);
- test("abcde", 5, 0, "abcde", 0, 0, 0);
- test("abcde", 5, 0, "abcde", 0, 1, -1);
- test("abcde", 5, 0, "abcde", 0, 2, -2);
- test("abcde", 5, 0, "abcde", 0, 4, -4);
- test("abcde", 5, 0, "abcde", 0, 5, -5);
- test("abcde", 5, 0, "abcde", 0, 6, -5);
- test("abcde", 5, 0, "abcde", 1, 0, 0);
- test("abcde", 5, 0, "abcde", 1, 1, -1);
- test("abcde", 5, 0, "abcde", 1, 2, -2);
- test("abcde", 5, 0, "abcde", 1, 3, -3);
- test("abcde", 5, 0, "abcde", 1, 4, -4);
- test("abcde", 5, 0, "abcde", 1, 5, -4);
- test("abcde", 5, 0, "abcde", 2, 0, 0);
- test("abcde", 5, 0, "abcde", 2, 1, -1);
- test("abcde", 5, 0, "abcde", 2, 2, -2);
- test("abcde", 5, 0, "abcde", 2, 3, -3);
- test("abcde", 5, 0, "abcde", 2, 4, -3);
- test("abcde", 5, 0, "abcde", 4, 0, 0);
- test("abcde", 5, 0, "abcde", 4, 1, -1);
- test("abcde", 5, 0, "abcde", 4, 2, -1);
- test("abcde", 5, 0, "abcde", 5, 0, 0);
- test("abcde", 5, 0, "abcde", 5, 1, 0);
- test("abcde", 5, 0, "abcde", 6, 0, 0);
- test("abcde", 5, 0, "abcdefghij", 0, 0, 0);
- test("abcde", 5, 0, "abcdefghij", 0, 1, -1);
- test("abcde", 5, 0, "abcdefghij", 0, 5, -5);
- test("abcde", 5, 0, "abcdefghij", 0, 9, -9);
- test("abcde", 5, 0, "abcdefghij", 0, 10, -10);
- test("abcde", 5, 0, "abcdefghij", 0, 11, -10);
- test("abcde", 5, 0, "abcdefghij", 1, 0, 0);
- test("abcde", 5, 0, "abcdefghij", 1, 1, -1);
- test("abcde", 5, 0, "abcdefghij", 1, 4, -4);
- test("abcde", 5, 0, "abcdefghij", 1, 8, -8);
- test("abcde", 5, 0, "abcdefghij", 1, 9, -9);
- test("abcde", 5, 0, "abcdefghij", 1, 10, -9);
- test("abcde", 5, 0, "abcdefghij", 5, 0, 0);
- test("abcde", 5, 0, "abcdefghij", 5, 1, -1);
- test("abcde", 5, 0, "abcdefghij", 5, 2, -2);
- test("abcde", 5, 0, "abcdefghij", 5, 4, -4);
- test("abcde", 5, 0, "abcdefghij", 5, 5, -5);
- test("abcde", 5, 0, "abcdefghij", 5, 6, -5);
- test("abcde", 5, 0, "abcdefghij", 9, 0, 0);
- test("abcde", 5, 0, "abcdefghij", 9, 1, -1);
- test("abcde", 5, 0, "abcdefghij", 9, 2, -1);
- test("abcde", 5, 0, "abcdefghij", 10, 0, 0);
- test("abcde", 5, 0, "abcdefghij", 10, 1, 0);
- test("abcde", 5, 0, "abcdefghij", 11, 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 5, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 5, 1, "", 0, 0, 0);
- test("abcde", 5, 1, "", 0, 1, 0);
- test("abcde", 5, 1, "", 1, 0, 0);
- test("abcde", 5, 1, "abcde", 0, 0, 0);
- test("abcde", 5, 1, "abcde", 0, 1, -1);
- test("abcde", 5, 1, "abcde", 0, 2, -2);
- test("abcde", 5, 1, "abcde", 0, 4, -4);
- test("abcde", 5, 1, "abcde", 0, 5, -5);
- test("abcde", 5, 1, "abcde", 0, 6, -5);
- test("abcde", 5, 1, "abcde", 1, 0, 0);
- test("abcde", 5, 1, "abcde", 1, 1, -1);
- test("abcde", 5, 1, "abcde", 1, 2, -2);
- test("abcde", 5, 1, "abcde", 1, 3, -3);
- test("abcde", 5, 1, "abcde", 1, 4, -4);
- test("abcde", 5, 1, "abcde", 1, 5, -4);
- test("abcde", 5, 1, "abcde", 2, 0, 0);
- test("abcde", 5, 1, "abcde", 2, 1, -1);
- test("abcde", 5, 1, "abcde", 2, 2, -2);
- test("abcde", 5, 1, "abcde", 2, 3, -3);
- test("abcde", 5, 1, "abcde", 2, 4, -3);
- test("abcde", 5, 1, "abcde", 4, 0, 0);
- test("abcde", 5, 1, "abcde", 4, 1, -1);
- test("abcde", 5, 1, "abcde", 4, 2, -1);
- test("abcde", 5, 1, "abcde", 5, 0, 0);
-}
-
-void test18()
-{
- test("abcde", 5, 1, "abcde", 5, 1, 0);
- test("abcde", 5, 1, "abcde", 6, 0, 0);
- test("abcde", 5, 1, "abcdefghij", 0, 0, 0);
- test("abcde", 5, 1, "abcdefghij", 0, 1, -1);
- test("abcde", 5, 1, "abcdefghij", 0, 5, -5);
- test("abcde", 5, 1, "abcdefghij", 0, 9, -9);
- test("abcde", 5, 1, "abcdefghij", 0, 10, -10);
- test("abcde", 5, 1, "abcdefghij", 0, 11, -10);
- test("abcde", 5, 1, "abcdefghij", 1, 0, 0);
- test("abcde", 5, 1, "abcdefghij", 1, 1, -1);
- test("abcde", 5, 1, "abcdefghij", 1, 4, -4);
- test("abcde", 5, 1, "abcdefghij", 1, 8, -8);
- test("abcde", 5, 1, "abcdefghij", 1, 9, -9);
- test("abcde", 5, 1, "abcdefghij", 1, 10, -9);
- test("abcde", 5, 1, "abcdefghij", 5, 0, 0);
- test("abcde", 5, 1, "abcdefghij", 5, 1, -1);
- test("abcde", 5, 1, "abcdefghij", 5, 2, -2);
- test("abcde", 5, 1, "abcdefghij", 5, 4, -4);
- test("abcde", 5, 1, "abcdefghij", 5, 5, -5);
- test("abcde", 5, 1, "abcdefghij", 5, 6, -5);
- test("abcde", 5, 1, "abcdefghij", 9, 0, 0);
- test("abcde", 5, 1, "abcdefghij", 9, 1, -1);
- test("abcde", 5, 1, "abcdefghij", 9, 2, -1);
- test("abcde", 5, 1, "abcdefghij", 10, 0, 0);
- test("abcde", 5, 1, "abcdefghij", 10, 1, 0);
- test("abcde", 5, 1, "abcdefghij", 11, 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 5, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcde", 6, 0, "", 0, 0, 0);
- test("abcde", 6, 0, "", 0, 1, 0);
- test("abcde", 6, 0, "", 1, 0, 0);
- test("abcde", 6, 0, "abcde", 0, 0, 0);
- test("abcde", 6, 0, "abcde", 0, 1, 0);
- test("abcde", 6, 0, "abcde", 0, 2, 0);
- test("abcde", 6, 0, "abcde", 0, 4, 0);
- test("abcde", 6, 0, "abcde", 0, 5, 0);
- test("abcde", 6, 0, "abcde", 0, 6, 0);
- test("abcde", 6, 0, "abcde", 1, 0, 0);
- test("abcde", 6, 0, "abcde", 1, 1, 0);
- test("abcde", 6, 0, "abcde", 1, 2, 0);
- test("abcde", 6, 0, "abcde", 1, 3, 0);
- test("abcde", 6, 0, "abcde", 1, 4, 0);
- test("abcde", 6, 0, "abcde", 1, 5, 0);
- test("abcde", 6, 0, "abcde", 2, 0, 0);
- test("abcde", 6, 0, "abcde", 2, 1, 0);
- test("abcde", 6, 0, "abcde", 2, 2, 0);
- test("abcde", 6, 0, "abcde", 2, 3, 0);
- test("abcde", 6, 0, "abcde", 2, 4, 0);
- test("abcde", 6, 0, "abcde", 4, 0, 0);
- test("abcde", 6, 0, "abcde", 4, 1, 0);
- test("abcde", 6, 0, "abcde", 4, 2, 0);
- test("abcde", 6, 0, "abcde", 5, 0, 0);
- test("abcde", 6, 0, "abcde", 5, 1, 0);
- test("abcde", 6, 0, "abcde", 6, 0, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 0, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 1, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 5, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 9, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 10, 0);
- test("abcde", 6, 0, "abcdefghij", 0, 11, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 0, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 1, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 4, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 8, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 9, 0);
- test("abcde", 6, 0, "abcdefghij", 1, 10, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 0, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 1, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 2, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 4, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 5, 0);
- test("abcde", 6, 0, "abcdefghij", 5, 6, 0);
- test("abcde", 6, 0, "abcdefghij", 9, 0, 0);
- test("abcde", 6, 0, "abcdefghij", 9, 1, 0);
- test("abcde", 6, 0, "abcdefghij", 9, 2, 0);
- test("abcde", 6, 0, "abcdefghij", 10, 0, 0);
- test("abcde", 6, 0, "abcdefghij", 10, 1, 0);
- test("abcde", 6, 0, "abcdefghij", 11, 0, 0);
-}
-
-void test19()
-{
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 1, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 10, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 19, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 20, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 21, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 1, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 9, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 18, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 19, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 20, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 1, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 5, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 9, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 10, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 11, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 1, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 2, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcde", 6, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 0, 0, "", 0, 0, 0);
- test("abcdefghij", 0, 0, "", 0, 1, 0);
- test("abcdefghij", 0, 0, "", 1, 0, 0);
- test("abcdefghij", 0, 0, "abcde", 0, 0, 0);
- test("abcdefghij", 0, 0, "abcde", 0, 1, -1);
- test("abcdefghij", 0, 0, "abcde", 0, 2, -2);
- test("abcdefghij", 0, 0, "abcde", 0, 4, -4);
- test("abcdefghij", 0, 0, "abcde", 0, 5, -5);
- test("abcdefghij", 0, 0, "abcde", 0, 6, -5);
- test("abcdefghij", 0, 0, "abcde", 1, 0, 0);
- test("abcdefghij", 0, 0, "abcde", 1, 1, -1);
- test("abcdefghij", 0, 0, "abcde", 1, 2, -2);
- test("abcdefghij", 0, 0, "abcde", 1, 3, -3);
- test("abcdefghij", 0, 0, "abcde", 1, 4, -4);
- test("abcdefghij", 0, 0, "abcde", 1, 5, -4);
- test("abcdefghij", 0, 0, "abcde", 2, 0, 0);
- test("abcdefghij", 0, 0, "abcde", 2, 1, -1);
- test("abcdefghij", 0, 0, "abcde", 2, 2, -2);
- test("abcdefghij", 0, 0, "abcde", 2, 3, -3);
- test("abcdefghij", 0, 0, "abcde", 2, 4, -3);
- test("abcdefghij", 0, 0, "abcde", 4, 0, 0);
- test("abcdefghij", 0, 0, "abcde", 4, 1, -1);
- test("abcdefghij", 0, 0, "abcde", 4, 2, -1);
- test("abcdefghij", 0, 0, "abcde", 5, 0, 0);
- test("abcdefghij", 0, 0, "abcde", 5, 1, 0);
- test("abcdefghij", 0, 0, "abcde", 6, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghij", 0, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghij", 0, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghij", 0, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghij", 0, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghij", 0, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghij", 0, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghij", 0, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 0, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 0, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 0, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghij", 0, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 0, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 0, 1, "", 0, 0, 1);
- test("abcdefghij", 0, 1, "", 0, 1, 1);
-}
-
-void test20()
-{
- test("abcdefghij", 0, 1, "", 1, 0, 0);
- test("abcdefghij", 0, 1, "abcde", 0, 0, 1);
- test("abcdefghij", 0, 1, "abcde", 0, 1, 0);
- test("abcdefghij", 0, 1, "abcde", 0, 2, -1);
- test("abcdefghij", 0, 1, "abcde", 0, 4, -3);
- test("abcdefghij", 0, 1, "abcde", 0, 5, -4);
- test("abcdefghij", 0, 1, "abcde", 0, 6, -4);
- test("abcdefghij", 0, 1, "abcde", 1, 0, 1);
- test("abcdefghij", 0, 1, "abcde", 1, 1, -1);
- test("abcdefghij", 0, 1, "abcde", 1, 2, -1);
- test("abcdefghij", 0, 1, "abcde", 1, 3, -1);
- test("abcdefghij", 0, 1, "abcde", 1, 4, -1);
- test("abcdefghij", 0, 1, "abcde", 1, 5, -1);
- test("abcdefghij", 0, 1, "abcde", 2, 0, 1);
- test("abcdefghij", 0, 1, "abcde", 2, 1, -2);
- test("abcdefghij", 0, 1, "abcde", 2, 2, -2);
- test("abcdefghij", 0, 1, "abcde", 2, 3, -2);
- test("abcdefghij", 0, 1, "abcde", 2, 4, -2);
- test("abcdefghij", 0, 1, "abcde", 4, 0, 1);
- test("abcdefghij", 0, 1, "abcde", 4, 1, -4);
- test("abcdefghij", 0, 1, "abcde", 4, 2, -4);
- test("abcdefghij", 0, 1, "abcde", 5, 0, 1);
- test("abcdefghij", 0, 1, "abcde", 5, 1, 1);
- test("abcdefghij", 0, 1, "abcde", 6, 0, 0);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 1, 0);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 5, -4);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 9, -8);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 10, -9);
- test("abcdefghij", 0, 1, "abcdefghij", 0, 11, -9);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 4, -1);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 8, -1);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 9, -1);
- test("abcdefghij", 0, 1, "abcdefghij", 1, 10, -1);
- test("abcdefghij", 0, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 5, 1, -5);
- test("abcdefghij", 0, 1, "abcdefghij", 5, 2, -5);
- test("abcdefghij", 0, 1, "abcdefghij", 5, 4, -5);
- test("abcdefghij", 0, 1, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 0, 1, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 0, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 9, 1, -9);
- test("abcdefghij", 0, 1, "abcdefghij", 9, 2, -9);
- test("abcdefghij", 0, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghij", 0, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 0, 5, "", 0, 0, 5);
- test("abcdefghij", 0, 5, "", 0, 1, 5);
- test("abcdefghij", 0, 5, "", 1, 0, 0);
- test("abcdefghij", 0, 5, "abcde", 0, 0, 5);
- test("abcdefghij", 0, 5, "abcde", 0, 1, 4);
- test("abcdefghij", 0, 5, "abcde", 0, 2, 3);
- test("abcdefghij", 0, 5, "abcde", 0, 4, 1);
- test("abcdefghij", 0, 5, "abcde", 0, 5, 0);
- test("abcdefghij", 0, 5, "abcde", 0, 6, 0);
- test("abcdefghij", 0, 5, "abcde", 1, 0, 5);
- test("abcdefghij", 0, 5, "abcde", 1, 1, -1);
- test("abcdefghij", 0, 5, "abcde", 1, 2, -1);
- test("abcdefghij", 0, 5, "abcde", 1, 3, -1);
- test("abcdefghij", 0, 5, "abcde", 1, 4, -1);
- test("abcdefghij", 0, 5, "abcde", 1, 5, -1);
- test("abcdefghij", 0, 5, "abcde", 2, 0, 5);
- test("abcdefghij", 0, 5, "abcde", 2, 1, -2);
- test("abcdefghij", 0, 5, "abcde", 2, 2, -2);
- test("abcdefghij", 0, 5, "abcde", 2, 3, -2);
- test("abcdefghij", 0, 5, "abcde", 2, 4, -2);
- test("abcdefghij", 0, 5, "abcde", 4, 0, 5);
- test("abcdefghij", 0, 5, "abcde", 4, 1, -4);
- test("abcdefghij", 0, 5, "abcde", 4, 2, -4);
- test("abcdefghij", 0, 5, "abcde", 5, 0, 5);
- test("abcdefghij", 0, 5, "abcde", 5, 1, 5);
- test("abcdefghij", 0, 5, "abcde", 6, 0, 0);
- test("abcdefghij", 0, 5, "abcdefghij", 0, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 0, 1, 4);
-}
-
-void test21()
-{
- test("abcdefghij", 0, 5, "abcdefghij", 0, 5, 0);
- test("abcdefghij", 0, 5, "abcdefghij", 0, 9, -4);
- test("abcdefghij", 0, 5, "abcdefghij", 0, 10, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 0, 11, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 4, -1);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 8, -1);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 9, -1);
- test("abcdefghij", 0, 5, "abcdefghij", 1, 10, -1);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 1, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 2, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 4, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 0, 5, "abcdefghij", 9, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 9, 1, -9);
- test("abcdefghij", 0, 5, "abcdefghij", 9, 2, -9);
- test("abcdefghij", 0, 5, "abcdefghij", 10, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 10, 1, 5);
- test("abcdefghij", 0, 5, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 1, 4);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 10, -5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 19, -14);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 20, -15);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 21, -15);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, 0, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, 1, 5);
- test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 0, 9, "", 0, 0, 9);
- test("abcdefghij", 0, 9, "", 0, 1, 9);
- test("abcdefghij", 0, 9, "", 1, 0, 0);
- test("abcdefghij", 0, 9, "abcde", 0, 0, 9);
- test("abcdefghij", 0, 9, "abcde", 0, 1, 8);
- test("abcdefghij", 0, 9, "abcde", 0, 2, 7);
- test("abcdefghij", 0, 9, "abcde", 0, 4, 5);
- test("abcdefghij", 0, 9, "abcde", 0, 5, 4);
- test("abcdefghij", 0, 9, "abcde", 0, 6, 4);
- test("abcdefghij", 0, 9, "abcde", 1, 0, 9);
- test("abcdefghij", 0, 9, "abcde", 1, 1, -1);
- test("abcdefghij", 0, 9, "abcde", 1, 2, -1);
- test("abcdefghij", 0, 9, "abcde", 1, 3, -1);
- test("abcdefghij", 0, 9, "abcde", 1, 4, -1);
- test("abcdefghij", 0, 9, "abcde", 1, 5, -1);
- test("abcdefghij", 0, 9, "abcde", 2, 0, 9);
- test("abcdefghij", 0, 9, "abcde", 2, 1, -2);
- test("abcdefghij", 0, 9, "abcde", 2, 2, -2);
- test("abcdefghij", 0, 9, "abcde", 2, 3, -2);
- test("abcdefghij", 0, 9, "abcde", 2, 4, -2);
- test("abcdefghij", 0, 9, "abcde", 4, 0, 9);
- test("abcdefghij", 0, 9, "abcde", 4, 1, -4);
- test("abcdefghij", 0, 9, "abcde", 4, 2, -4);
- test("abcdefghij", 0, 9, "abcde", 5, 0, 9);
- test("abcdefghij", 0, 9, "abcde", 5, 1, 9);
- test("abcdefghij", 0, 9, "abcde", 6, 0, 0);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 1, 8);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 5, 4);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 9, 0);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 10, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 0, 11, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 4, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 8, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 9, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 1, 10, -1);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 1, -5);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 2, -5);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 4, -5);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 0, 9, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 0, 9, "abcdefghij", 9, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 9, 1, -9);
- test("abcdefghij", 0, 9, "abcdefghij", 9, 2, -9);
- test("abcdefghij", 0, 9, "abcdefghij", 10, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 10, 1, 9);
- test("abcdefghij", 0, 9, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 1, 8);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 10, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 19, -10);
-}
-
-void test22()
-{
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 20, -11);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 21, -11);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, 0, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, 1, 9);
- test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 0, 10, "", 0, 0, 10);
- test("abcdefghij", 0, 10, "", 0, 1, 10);
- test("abcdefghij", 0, 10, "", 1, 0, 0);
- test("abcdefghij", 0, 10, "abcde", 0, 0, 10);
- test("abcdefghij", 0, 10, "abcde", 0, 1, 9);
- test("abcdefghij", 0, 10, "abcde", 0, 2, 8);
- test("abcdefghij", 0, 10, "abcde", 0, 4, 6);
- test("abcdefghij", 0, 10, "abcde", 0, 5, 5);
- test("abcdefghij", 0, 10, "abcde", 0, 6, 5);
- test("abcdefghij", 0, 10, "abcde", 1, 0, 10);
- test("abcdefghij", 0, 10, "abcde", 1, 1, -1);
- test("abcdefghij", 0, 10, "abcde", 1, 2, -1);
- test("abcdefghij", 0, 10, "abcde", 1, 3, -1);
- test("abcdefghij", 0, 10, "abcde", 1, 4, -1);
- test("abcdefghij", 0, 10, "abcde", 1, 5, -1);
- test("abcdefghij", 0, 10, "abcde", 2, 0, 10);
- test("abcdefghij", 0, 10, "abcde", 2, 1, -2);
- test("abcdefghij", 0, 10, "abcde", 2, 2, -2);
- test("abcdefghij", 0, 10, "abcde", 2, 3, -2);
- test("abcdefghij", 0, 10, "abcde", 2, 4, -2);
- test("abcdefghij", 0, 10, "abcde", 4, 0, 10);
- test("abcdefghij", 0, 10, "abcde", 4, 1, -4);
- test("abcdefghij", 0, 10, "abcde", 4, 2, -4);
- test("abcdefghij", 0, 10, "abcde", 5, 0, 10);
- test("abcdefghij", 0, 10, "abcde", 5, 1, 10);
- test("abcdefghij", 0, 10, "abcde", 6, 0, 0);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 1, 9);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 10, 0);
- test("abcdefghij", 0, 10, "abcdefghij", 0, 11, 0);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 4, -1);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 8, -1);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 9, -1);
- test("abcdefghij", 0, 10, "abcdefghij", 1, 10, -1);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 1, -5);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 2, -5);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 4, -5);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 0, 10, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 0, 10, "abcdefghij", 9, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 9, 1, -9);
- test("abcdefghij", 0, 10, "abcdefghij", 9, 2, -9);
- test("abcdefghij", 0, 10, "abcdefghij", 10, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 10, 1, 10);
- test("abcdefghij", 0, 10, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 1, 9);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 10, 0);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 19, -9);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 20, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 21, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, 0, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, 1, 10);
- test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 0, 11, "", 0, 0, 10);
- test("abcdefghij", 0, 11, "", 0, 1, 10);
- test("abcdefghij", 0, 11, "", 1, 0, 0);
- test("abcdefghij", 0, 11, "abcde", 0, 0, 10);
- test("abcdefghij", 0, 11, "abcde", 0, 1, 9);
- test("abcdefghij", 0, 11, "abcde", 0, 2, 8);
-}
-
-void test23()
-{
- test("abcdefghij", 0, 11, "abcde", 0, 4, 6);
- test("abcdefghij", 0, 11, "abcde", 0, 5, 5);
- test("abcdefghij", 0, 11, "abcde", 0, 6, 5);
- test("abcdefghij", 0, 11, "abcde", 1, 0, 10);
- test("abcdefghij", 0, 11, "abcde", 1, 1, -1);
- test("abcdefghij", 0, 11, "abcde", 1, 2, -1);
- test("abcdefghij", 0, 11, "abcde", 1, 3, -1);
- test("abcdefghij", 0, 11, "abcde", 1, 4, -1);
- test("abcdefghij", 0, 11, "abcde", 1, 5, -1);
- test("abcdefghij", 0, 11, "abcde", 2, 0, 10);
- test("abcdefghij", 0, 11, "abcde", 2, 1, -2);
- test("abcdefghij", 0, 11, "abcde", 2, 2, -2);
- test("abcdefghij", 0, 11, "abcde", 2, 3, -2);
- test("abcdefghij", 0, 11, "abcde", 2, 4, -2);
- test("abcdefghij", 0, 11, "abcde", 4, 0, 10);
- test("abcdefghij", 0, 11, "abcde", 4, 1, -4);
- test("abcdefghij", 0, 11, "abcde", 4, 2, -4);
- test("abcdefghij", 0, 11, "abcde", 5, 0, 10);
- test("abcdefghij", 0, 11, "abcde", 5, 1, 10);
- test("abcdefghij", 0, 11, "abcde", 6, 0, 0);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 1, 9);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 10, 0);
- test("abcdefghij", 0, 11, "abcdefghij", 0, 11, 0);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 4, -1);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 8, -1);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 9, -1);
- test("abcdefghij", 0, 11, "abcdefghij", 1, 10, -1);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 1, -5);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 2, -5);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 4, -5);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 0, 11, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 0, 11, "abcdefghij", 9, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 9, 1, -9);
- test("abcdefghij", 0, 11, "abcdefghij", 9, 2, -9);
- test("abcdefghij", 0, 11, "abcdefghij", 10, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 10, 1, 10);
- test("abcdefghij", 0, 11, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 1, 9);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 10, 0);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 19, -9);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 20, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 21, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, 0, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, 1, 10);
- test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 1, 0, "", 0, 0, 0);
- test("abcdefghij", 1, 0, "", 0, 1, 0);
- test("abcdefghij", 1, 0, "", 1, 0, 0);
- test("abcdefghij", 1, 0, "abcde", 0, 0, 0);
- test("abcdefghij", 1, 0, "abcde", 0, 1, -1);
- test("abcdefghij", 1, 0, "abcde", 0, 2, -2);
- test("abcdefghij", 1, 0, "abcde", 0, 4, -4);
- test("abcdefghij", 1, 0, "abcde", 0, 5, -5);
- test("abcdefghij", 1, 0, "abcde", 0, 6, -5);
- test("abcdefghij", 1, 0, "abcde", 1, 0, 0);
- test("abcdefghij", 1, 0, "abcde", 1, 1, -1);
- test("abcdefghij", 1, 0, "abcde", 1, 2, -2);
- test("abcdefghij", 1, 0, "abcde", 1, 3, -3);
- test("abcdefghij", 1, 0, "abcde", 1, 4, -4);
- test("abcdefghij", 1, 0, "abcde", 1, 5, -4);
- test("abcdefghij", 1, 0, "abcde", 2, 0, 0);
- test("abcdefghij", 1, 0, "abcde", 2, 1, -1);
- test("abcdefghij", 1, 0, "abcde", 2, 2, -2);
- test("abcdefghij", 1, 0, "abcde", 2, 3, -3);
- test("abcdefghij", 1, 0, "abcde", 2, 4, -3);
- test("abcdefghij", 1, 0, "abcde", 4, 0, 0);
- test("abcdefghij", 1, 0, "abcde", 4, 1, -1);
- test("abcdefghij", 1, 0, "abcde", 4, 2, -1);
- test("abcdefghij", 1, 0, "abcde", 5, 0, 0);
- test("abcdefghij", 1, 0, "abcde", 5, 1, 0);
- test("abcdefghij", 1, 0, "abcde", 6, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghij", 1, 0, "abcdefghij", 0, 11, -10);
-}
-
-void test24()
-{
- test("abcdefghij", 1, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghij", 1, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghij", 1, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghij", 1, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghij", 1, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghij", 1, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 1, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 1, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 1, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghij", 1, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 1, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 1, 1, "", 0, 0, 1);
- test("abcdefghij", 1, 1, "", 0, 1, 1);
- test("abcdefghij", 1, 1, "", 1, 0, 0);
- test("abcdefghij", 1, 1, "abcde", 0, 0, 1);
- test("abcdefghij", 1, 1, "abcde", 0, 1, 1);
- test("abcdefghij", 1, 1, "abcde", 0, 2, 1);
- test("abcdefghij", 1, 1, "abcde", 0, 4, 1);
- test("abcdefghij", 1, 1, "abcde", 0, 5, 1);
- test("abcdefghij", 1, 1, "abcde", 0, 6, 1);
- test("abcdefghij", 1, 1, "abcde", 1, 0, 1);
- test("abcdefghij", 1, 1, "abcde", 1, 1, 0);
- test("abcdefghij", 1, 1, "abcde", 1, 2, -1);
- test("abcdefghij", 1, 1, "abcde", 1, 3, -2);
- test("abcdefghij", 1, 1, "abcde", 1, 4, -3);
- test("abcdefghij", 1, 1, "abcde", 1, 5, -3);
- test("abcdefghij", 1, 1, "abcde", 2, 0, 1);
- test("abcdefghij", 1, 1, "abcde", 2, 1, -1);
- test("abcdefghij", 1, 1, "abcde", 2, 2, -1);
- test("abcdefghij", 1, 1, "abcde", 2, 3, -1);
- test("abcdefghij", 1, 1, "abcde", 2, 4, -1);
- test("abcdefghij", 1, 1, "abcde", 4, 0, 1);
- test("abcdefghij", 1, 1, "abcde", 4, 1, -3);
- test("abcdefghij", 1, 1, "abcde", 4, 2, -3);
- test("abcdefghij", 1, 1, "abcde", 5, 0, 1);
- test("abcdefghij", 1, 1, "abcde", 5, 1, 1);
- test("abcdefghij", 1, 1, "abcde", 6, 0, 0);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 1, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 5, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 10, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 0, 11, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 1, 0);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 4, -3);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 8, -7);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 9, -8);
- test("abcdefghij", 1, 1, "abcdefghij", 1, 10, -8);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 1, -4);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 2, -4);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 5, -4);
- test("abcdefghij", 1, 1, "abcdefghij", 5, 6, -4);
- test("abcdefghij", 1, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 9, 1, -8);
- test("abcdefghij", 1, 1, "abcdefghij", 9, 2, -8);
- test("abcdefghij", 1, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghij", 1, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0);
-}
-
-void test25()
-{
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 1, 4, "", 0, 0, 4);
- test("abcdefghij", 1, 4, "", 0, 1, 4);
- test("abcdefghij", 1, 4, "", 1, 0, 0);
- test("abcdefghij", 1, 4, "abcde", 0, 0, 4);
- test("abcdefghij", 1, 4, "abcde", 0, 1, 1);
- test("abcdefghij", 1, 4, "abcde", 0, 2, 1);
- test("abcdefghij", 1, 4, "abcde", 0, 4, 1);
- test("abcdefghij", 1, 4, "abcde", 0, 5, 1);
- test("abcdefghij", 1, 4, "abcde", 0, 6, 1);
- test("abcdefghij", 1, 4, "abcde", 1, 0, 4);
- test("abcdefghij", 1, 4, "abcde", 1, 1, 3);
- test("abcdefghij", 1, 4, "abcde", 1, 2, 2);
- test("abcdefghij", 1, 4, "abcde", 1, 3, 1);
- test("abcdefghij", 1, 4, "abcde", 1, 4, 0);
- test("abcdefghij", 1, 4, "abcde", 1, 5, 0);
- test("abcdefghij", 1, 4, "abcde", 2, 0, 4);
- test("abcdefghij", 1, 4, "abcde", 2, 1, -1);
- test("abcdefghij", 1, 4, "abcde", 2, 2, -1);
- test("abcdefghij", 1, 4, "abcde", 2, 3, -1);
- test("abcdefghij", 1, 4, "abcde", 2, 4, -1);
- test("abcdefghij", 1, 4, "abcde", 4, 0, 4);
- test("abcdefghij", 1, 4, "abcde", 4, 1, -3);
- test("abcdefghij", 1, 4, "abcde", 4, 2, -3);
- test("abcdefghij", 1, 4, "abcde", 5, 0, 4);
- test("abcdefghij", 1, 4, "abcde", 5, 1, 4);
- test("abcdefghij", 1, 4, "abcde", 6, 0, 0);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 1, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 5, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 10, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 0, 11, 1);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 1, 3);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 4, 0);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 8, -4);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 9, -5);
- test("abcdefghij", 1, 4, "abcdefghij", 1, 10, -5);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 1, -4);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 2, -4);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 5, -4);
- test("abcdefghij", 1, 4, "abcdefghij", 5, 6, -4);
- test("abcdefghij", 1, 4, "abcdefghij", 9, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 9, 1, -8);
- test("abcdefghij", 1, 4, "abcdefghij", 9, 2, -8);
- test("abcdefghij", 1, 4, "abcdefghij", 10, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 10, 1, 4);
- test("abcdefghij", 1, 4, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 1, 3);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 9, -5);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 18, -14);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 19, -15);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 20, -15);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 0, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 1, 4);
- test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 1, 8, "", 0, 0, 8);
- test("abcdefghij", 1, 8, "", 0, 1, 8);
- test("abcdefghij", 1, 8, "", 1, 0, 0);
- test("abcdefghij", 1, 8, "abcde", 0, 0, 8);
- test("abcdefghij", 1, 8, "abcde", 0, 1, 1);
- test("abcdefghij", 1, 8, "abcde", 0, 2, 1);
- test("abcdefghij", 1, 8, "abcde", 0, 4, 1);
- test("abcdefghij", 1, 8, "abcde", 0, 5, 1);
- test("abcdefghij", 1, 8, "abcde", 0, 6, 1);
- test("abcdefghij", 1, 8, "abcde", 1, 0, 8);
-}
-
-void test26()
-{
- test("abcdefghij", 1, 8, "abcde", 1, 1, 7);
- test("abcdefghij", 1, 8, "abcde", 1, 2, 6);
- test("abcdefghij", 1, 8, "abcde", 1, 3, 5);
- test("abcdefghij", 1, 8, "abcde", 1, 4, 4);
- test("abcdefghij", 1, 8, "abcde", 1, 5, 4);
- test("abcdefghij", 1, 8, "abcde", 2, 0, 8);
- test("abcdefghij", 1, 8, "abcde", 2, 1, -1);
- test("abcdefghij", 1, 8, "abcde", 2, 2, -1);
- test("abcdefghij", 1, 8, "abcde", 2, 3, -1);
- test("abcdefghij", 1, 8, "abcde", 2, 4, -1);
- test("abcdefghij", 1, 8, "abcde", 4, 0, 8);
- test("abcdefghij", 1, 8, "abcde", 4, 1, -3);
- test("abcdefghij", 1, 8, "abcde", 4, 2, -3);
- test("abcdefghij", 1, 8, "abcde", 5, 0, 8);
- test("abcdefghij", 1, 8, "abcde", 5, 1, 8);
- test("abcdefghij", 1, 8, "abcde", 6, 0, 0);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 1, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 5, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 10, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 0, 11, 1);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 1, 7);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 4, 4);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 8, 0);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 9, -1);
- test("abcdefghij", 1, 8, "abcdefghij", 1, 10, -1);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 1, -4);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 2, -4);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 5, -4);
- test("abcdefghij", 1, 8, "abcdefghij", 5, 6, -4);
- test("abcdefghij", 1, 8, "abcdefghij", 9, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 9, 1, -8);
- test("abcdefghij", 1, 8, "abcdefghij", 9, 2, -8);
- test("abcdefghij", 1, 8, "abcdefghij", 10, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 10, 1, 8);
- test("abcdefghij", 1, 8, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 1, 7);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 18, -10);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 19, -11);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 20, -11);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 0, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 1, 8);
- test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 1, 9, "", 0, 0, 9);
- test("abcdefghij", 1, 9, "", 0, 1, 9);
- test("abcdefghij", 1, 9, "", 1, 0, 0);
- test("abcdefghij", 1, 9, "abcde", 0, 0, 9);
- test("abcdefghij", 1, 9, "abcde", 0, 1, 1);
- test("abcdefghij", 1, 9, "abcde", 0, 2, 1);
- test("abcdefghij", 1, 9, "abcde", 0, 4, 1);
- test("abcdefghij", 1, 9, "abcde", 0, 5, 1);
- test("abcdefghij", 1, 9, "abcde", 0, 6, 1);
- test("abcdefghij", 1, 9, "abcde", 1, 0, 9);
- test("abcdefghij", 1, 9, "abcde", 1, 1, 8);
- test("abcdefghij", 1, 9, "abcde", 1, 2, 7);
- test("abcdefghij", 1, 9, "abcde", 1, 3, 6);
- test("abcdefghij", 1, 9, "abcde", 1, 4, 5);
- test("abcdefghij", 1, 9, "abcde", 1, 5, 5);
- test("abcdefghij", 1, 9, "abcde", 2, 0, 9);
- test("abcdefghij", 1, 9, "abcde", 2, 1, -1);
- test("abcdefghij", 1, 9, "abcde", 2, 2, -1);
- test("abcdefghij", 1, 9, "abcde", 2, 3, -1);
- test("abcdefghij", 1, 9, "abcde", 2, 4, -1);
- test("abcdefghij", 1, 9, "abcde", 4, 0, 9);
- test("abcdefghij", 1, 9, "abcde", 4, 1, -3);
- test("abcdefghij", 1, 9, "abcde", 4, 2, -3);
- test("abcdefghij", 1, 9, "abcde", 5, 0, 9);
- test("abcdefghij", 1, 9, "abcde", 5, 1, 9);
- test("abcdefghij", 1, 9, "abcde", 6, 0, 0);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 1, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 5, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 10, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 0, 11, 1);
- test("abcdefghij", 1, 9, "abcdefghij", 1, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 1, 1, 8);
- test("abcdefghij", 1, 9, "abcdefghij", 1, 4, 5);
- test("abcdefghij", 1, 9, "abcdefghij", 1, 8, 1);
-}
-
-void test27()
-{
- test("abcdefghij", 1, 9, "abcdefghij", 1, 9, 0);
- test("abcdefghij", 1, 9, "abcdefghij", 1, 10, 0);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 1, -4);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 2, -4);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 5, -4);
- test("abcdefghij", 1, 9, "abcdefghij", 5, 6, -4);
- test("abcdefghij", 1, 9, "abcdefghij", 9, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 9, 1, -8);
- test("abcdefghij", 1, 9, "abcdefghij", 9, 2, -8);
- test("abcdefghij", 1, 9, "abcdefghij", 10, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 10, 1, 9);
- test("abcdefghij", 1, 9, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 1, 8);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 9, 0);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 18, -9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 19, -10);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 20, -10);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 0, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 1, 9);
- test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 1, 10, "", 0, 0, 9);
- test("abcdefghij", 1, 10, "", 0, 1, 9);
- test("abcdefghij", 1, 10, "", 1, 0, 0);
- test("abcdefghij", 1, 10, "abcde", 0, 0, 9);
- test("abcdefghij", 1, 10, "abcde", 0, 1, 1);
- test("abcdefghij", 1, 10, "abcde", 0, 2, 1);
- test("abcdefghij", 1, 10, "abcde", 0, 4, 1);
- test("abcdefghij", 1, 10, "abcde", 0, 5, 1);
- test("abcdefghij", 1, 10, "abcde", 0, 6, 1);
- test("abcdefghij", 1, 10, "abcde", 1, 0, 9);
- test("abcdefghij", 1, 10, "abcde", 1, 1, 8);
- test("abcdefghij", 1, 10, "abcde", 1, 2, 7);
- test("abcdefghij", 1, 10, "abcde", 1, 3, 6);
- test("abcdefghij", 1, 10, "abcde", 1, 4, 5);
- test("abcdefghij", 1, 10, "abcde", 1, 5, 5);
- test("abcdefghij", 1, 10, "abcde", 2, 0, 9);
- test("abcdefghij", 1, 10, "abcde", 2, 1, -1);
- test("abcdefghij", 1, 10, "abcde", 2, 2, -1);
- test("abcdefghij", 1, 10, "abcde", 2, 3, -1);
- test("abcdefghij", 1, 10, "abcde", 2, 4, -1);
- test("abcdefghij", 1, 10, "abcde", 4, 0, 9);
- test("abcdefghij", 1, 10, "abcde", 4, 1, -3);
- test("abcdefghij", 1, 10, "abcde", 4, 2, -3);
- test("abcdefghij", 1, 10, "abcde", 5, 0, 9);
- test("abcdefghij", 1, 10, "abcde", 5, 1, 9);
- test("abcdefghij", 1, 10, "abcde", 6, 0, 0);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 1, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 5, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 9, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 10, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 0, 11, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 1, 8);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 4, 5);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 8, 1);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 9, 0);
- test("abcdefghij", 1, 10, "abcdefghij", 1, 10, 0);
- test("abcdefghij", 1, 10, "abcdefghij", 5, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 5, 1, -4);
- test("abcdefghij", 1, 10, "abcdefghij", 5, 2, -4);
- test("abcdefghij", 1, 10, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 1, 10, "abcdefghij", 5, 5, -4);
- test("abcdefghij", 1, 10, "abcdefghij", 5, 6, -4);
- test("abcdefghij", 1, 10, "abcdefghij", 9, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 9, 1, -8);
- test("abcdefghij", 1, 10, "abcdefghij", 9, 2, -8);
- test("abcdefghij", 1, 10, "abcdefghij", 10, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 10, 1, 9);
- test("abcdefghij", 1, 10, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 1, 8);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 9, 0);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 18, -9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 19, -10);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 20, -10);
-}
-
-void test28()
-{
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 0, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 1, 9);
- test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 5, 0, "", 0, 0, 0);
- test("abcdefghij", 5, 0, "", 0, 1, 0);
- test("abcdefghij", 5, 0, "", 1, 0, 0);
- test("abcdefghij", 5, 0, "abcde", 0, 0, 0);
- test("abcdefghij", 5, 0, "abcde", 0, 1, -1);
- test("abcdefghij", 5, 0, "abcde", 0, 2, -2);
- test("abcdefghij", 5, 0, "abcde", 0, 4, -4);
- test("abcdefghij", 5, 0, "abcde", 0, 5, -5);
- test("abcdefghij", 5, 0, "abcde", 0, 6, -5);
- test("abcdefghij", 5, 0, "abcde", 1, 0, 0);
- test("abcdefghij", 5, 0, "abcde", 1, 1, -1);
- test("abcdefghij", 5, 0, "abcde", 1, 2, -2);
- test("abcdefghij", 5, 0, "abcde", 1, 3, -3);
- test("abcdefghij", 5, 0, "abcde", 1, 4, -4);
- test("abcdefghij", 5, 0, "abcde", 1, 5, -4);
- test("abcdefghij", 5, 0, "abcde", 2, 0, 0);
- test("abcdefghij", 5, 0, "abcde", 2, 1, -1);
- test("abcdefghij", 5, 0, "abcde", 2, 2, -2);
- test("abcdefghij", 5, 0, "abcde", 2, 3, -3);
- test("abcdefghij", 5, 0, "abcde", 2, 4, -3);
- test("abcdefghij", 5, 0, "abcde", 4, 0, 0);
- test("abcdefghij", 5, 0, "abcde", 4, 1, -1);
- test("abcdefghij", 5, 0, "abcde", 4, 2, -1);
- test("abcdefghij", 5, 0, "abcde", 5, 0, 0);
- test("abcdefghij", 5, 0, "abcde", 5, 1, 0);
- test("abcdefghij", 5, 0, "abcde", 6, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghij", 5, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghij", 5, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghij", 5, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghij", 5, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghij", 5, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghij", 5, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghij", 5, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 5, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 5, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 5, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghij", 5, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 5, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 5, 1, "", 0, 0, 1);
- test("abcdefghij", 5, 1, "", 0, 1, 1);
- test("abcdefghij", 5, 1, "", 1, 0, 0);
- test("abcdefghij", 5, 1, "abcde", 0, 0, 1);
- test("abcdefghij", 5, 1, "abcde", 0, 1, 5);
- test("abcdefghij", 5, 1, "abcde", 0, 2, 5);
- test("abcdefghij", 5, 1, "abcde", 0, 4, 5);
- test("abcdefghij", 5, 1, "abcde", 0, 5, 5);
- test("abcdefghij", 5, 1, "abcde", 0, 6, 5);
- test("abcdefghij", 5, 1, "abcde", 1, 0, 1);
- test("abcdefghij", 5, 1, "abcde", 1, 1, 4);
- test("abcdefghij", 5, 1, "abcde", 1, 2, 4);
- test("abcdefghij", 5, 1, "abcde", 1, 3, 4);
- test("abcdefghij", 5, 1, "abcde", 1, 4, 4);
-}
-
-void test29()
-{
- test("abcdefghij", 5, 1, "abcde", 1, 5, 4);
- test("abcdefghij", 5, 1, "abcde", 2, 0, 1);
- test("abcdefghij", 5, 1, "abcde", 2, 1, 3);
- test("abcdefghij", 5, 1, "abcde", 2, 2, 3);
- test("abcdefghij", 5, 1, "abcde", 2, 3, 3);
- test("abcdefghij", 5, 1, "abcde", 2, 4, 3);
- test("abcdefghij", 5, 1, "abcde", 4, 0, 1);
- test("abcdefghij", 5, 1, "abcde", 4, 1, 1);
- test("abcdefghij", 5, 1, "abcde", 4, 2, 1);
- test("abcdefghij", 5, 1, "abcde", 5, 0, 1);
- test("abcdefghij", 5, 1, "abcde", 5, 1, 1);
- test("abcdefghij", 5, 1, "abcde", 6, 0, 0);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 1, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 9, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 10, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 0, 11, 5);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 1, 4);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 4, 4);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 8, 4);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 9, 4);
- test("abcdefghij", 5, 1, "abcdefghij", 1, 10, 4);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 1, 0);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 2, -1);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 4, -3);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 5, -4);
- test("abcdefghij", 5, 1, "abcdefghij", 5, 6, -4);
- test("abcdefghij", 5, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 9, 1, -4);
- test("abcdefghij", 5, 1, "abcdefghij", 9, 2, -4);
- test("abcdefghij", 5, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghij", 5, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 1, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 10, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 19, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 20, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 21, 5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 1, 4);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 9, 4);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 18, 4);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 19, 4);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 20, 4);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 1, -5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 9, -5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 10, -5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 11, -5);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 1, -14);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 2, -14);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 5, 2, "", 0, 0, 2);
- test("abcdefghij", 5, 2, "", 0, 1, 2);
- test("abcdefghij", 5, 2, "", 1, 0, 0);
- test("abcdefghij", 5, 2, "abcde", 0, 0, 2);
- test("abcdefghij", 5, 2, "abcde", 0, 1, 5);
- test("abcdefghij", 5, 2, "abcde", 0, 2, 5);
- test("abcdefghij", 5, 2, "abcde", 0, 4, 5);
- test("abcdefghij", 5, 2, "abcde", 0, 5, 5);
- test("abcdefghij", 5, 2, "abcde", 0, 6, 5);
- test("abcdefghij", 5, 2, "abcde", 1, 0, 2);
- test("abcdefghij", 5, 2, "abcde", 1, 1, 4);
- test("abcdefghij", 5, 2, "abcde", 1, 2, 4);
- test("abcdefghij", 5, 2, "abcde", 1, 3, 4);
- test("abcdefghij", 5, 2, "abcde", 1, 4, 4);
- test("abcdefghij", 5, 2, "abcde", 1, 5, 4);
- test("abcdefghij", 5, 2, "abcde", 2, 0, 2);
- test("abcdefghij", 5, 2, "abcde", 2, 1, 3);
- test("abcdefghij", 5, 2, "abcde", 2, 2, 3);
- test("abcdefghij", 5, 2, "abcde", 2, 3, 3);
- test("abcdefghij", 5, 2, "abcde", 2, 4, 3);
- test("abcdefghij", 5, 2, "abcde", 4, 0, 2);
- test("abcdefghij", 5, 2, "abcde", 4, 1, 1);
- test("abcdefghij", 5, 2, "abcde", 4, 2, 1);
- test("abcdefghij", 5, 2, "abcde", 5, 0, 2);
- test("abcdefghij", 5, 2, "abcde", 5, 1, 2);
- test("abcdefghij", 5, 2, "abcde", 6, 0, 0);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 1, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 9, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 10, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 0, 11, 5);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 1, 4);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 4, 4);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 8, 4);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 9, 4);
- test("abcdefghij", 5, 2, "abcdefghij", 1, 10, 4);
- test("abcdefghij", 5, 2, "abcdefghij", 5, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 5, 1, 1);
-}
-
-void test30()
-{
- test("abcdefghij", 5, 2, "abcdefghij", 5, 2, 0);
- test("abcdefghij", 5, 2, "abcdefghij", 5, 4, -2);
- test("abcdefghij", 5, 2, "abcdefghij", 5, 5, -3);
- test("abcdefghij", 5, 2, "abcdefghij", 5, 6, -3);
- test("abcdefghij", 5, 2, "abcdefghij", 9, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 9, 1, -4);
- test("abcdefghij", 5, 2, "abcdefghij", 9, 2, -4);
- test("abcdefghij", 5, 2, "abcdefghij", 10, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 10, 1, 2);
- test("abcdefghij", 5, 2, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 1, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 10, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 19, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 20, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 21, 5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 1, 4);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 9, 4);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 18, 4);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 19, 4);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 20, 4);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 1, -5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 9, -5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 10, -5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 11, -5);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 1, -14);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 2, -14);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 0, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 1, 2);
- test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 5, 4, "", 0, 0, 4);
- test("abcdefghij", 5, 4, "", 0, 1, 4);
- test("abcdefghij", 5, 4, "", 1, 0, 0);
- test("abcdefghij", 5, 4, "abcde", 0, 0, 4);
- test("abcdefghij", 5, 4, "abcde", 0, 1, 5);
- test("abcdefghij", 5, 4, "abcde", 0, 2, 5);
- test("abcdefghij", 5, 4, "abcde", 0, 4, 5);
- test("abcdefghij", 5, 4, "abcde", 0, 5, 5);
- test("abcdefghij", 5, 4, "abcde", 0, 6, 5);
- test("abcdefghij", 5, 4, "abcde", 1, 0, 4);
- test("abcdefghij", 5, 4, "abcde", 1, 1, 4);
- test("abcdefghij", 5, 4, "abcde", 1, 2, 4);
- test("abcdefghij", 5, 4, "abcde", 1, 3, 4);
- test("abcdefghij", 5, 4, "abcde", 1, 4, 4);
- test("abcdefghij", 5, 4, "abcde", 1, 5, 4);
- test("abcdefghij", 5, 4, "abcde", 2, 0, 4);
- test("abcdefghij", 5, 4, "abcde", 2, 1, 3);
- test("abcdefghij", 5, 4, "abcde", 2, 2, 3);
- test("abcdefghij", 5, 4, "abcde", 2, 3, 3);
- test("abcdefghij", 5, 4, "abcde", 2, 4, 3);
- test("abcdefghij", 5, 4, "abcde", 4, 0, 4);
- test("abcdefghij", 5, 4, "abcde", 4, 1, 1);
- test("abcdefghij", 5, 4, "abcde", 4, 2, 1);
- test("abcdefghij", 5, 4, "abcde", 5, 0, 4);
- test("abcdefghij", 5, 4, "abcde", 5, 1, 4);
- test("abcdefghij", 5, 4, "abcde", 6, 0, 0);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 1, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 9, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 10, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 0, 11, 5);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 1, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 4, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 8, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 9, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 1, 10, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 1, 3);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 2, 2);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 4, 0);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 5, -1);
- test("abcdefghij", 5, 4, "abcdefghij", 5, 6, -1);
- test("abcdefghij", 5, 4, "abcdefghij", 9, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 9, 1, -4);
- test("abcdefghij", 5, 4, "abcdefghij", 9, 2, -4);
- test("abcdefghij", 5, 4, "abcdefghij", 10, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 10, 1, 4);
- test("abcdefghij", 5, 4, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 1, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 10, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 19, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 20, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 21, 5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 1, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 9, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 18, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 19, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 20, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 1, -5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 9, -5);
-}
-
-void test31()
-{
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 10, -5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 11, -5);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 1, -14);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 2, -14);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 0, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 1, 4);
- test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 5, 5, "", 0, 0, 5);
- test("abcdefghij", 5, 5, "", 0, 1, 5);
- test("abcdefghij", 5, 5, "", 1, 0, 0);
- test("abcdefghij", 5, 5, "abcde", 0, 0, 5);
- test("abcdefghij", 5, 5, "abcde", 0, 1, 5);
- test("abcdefghij", 5, 5, "abcde", 0, 2, 5);
- test("abcdefghij", 5, 5, "abcde", 0, 4, 5);
- test("abcdefghij", 5, 5, "abcde", 0, 5, 5);
- test("abcdefghij", 5, 5, "abcde", 0, 6, 5);
- test("abcdefghij", 5, 5, "abcde", 1, 0, 5);
- test("abcdefghij", 5, 5, "abcde", 1, 1, 4);
- test("abcdefghij", 5, 5, "abcde", 1, 2, 4);
- test("abcdefghij", 5, 5, "abcde", 1, 3, 4);
- test("abcdefghij", 5, 5, "abcde", 1, 4, 4);
- test("abcdefghij", 5, 5, "abcde", 1, 5, 4);
- test("abcdefghij", 5, 5, "abcde", 2, 0, 5);
- test("abcdefghij", 5, 5, "abcde", 2, 1, 3);
- test("abcdefghij", 5, 5, "abcde", 2, 2, 3);
- test("abcdefghij", 5, 5, "abcde", 2, 3, 3);
- test("abcdefghij", 5, 5, "abcde", 2, 4, 3);
- test("abcdefghij", 5, 5, "abcde", 4, 0, 5);
- test("abcdefghij", 5, 5, "abcde", 4, 1, 1);
- test("abcdefghij", 5, 5, "abcde", 4, 2, 1);
- test("abcdefghij", 5, 5, "abcde", 5, 0, 5);
- test("abcdefghij", 5, 5, "abcde", 5, 1, 5);
- test("abcdefghij", 5, 5, "abcde", 6, 0, 0);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 1, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 9, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 10, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 0, 11, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 1, 4);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 4, 4);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 8, 4);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 9, 4);
- test("abcdefghij", 5, 5, "abcdefghij", 1, 10, 4);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 1, 4);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 2, 3);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 4, 1);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 5, 0);
- test("abcdefghij", 5, 5, "abcdefghij", 5, 6, 0);
- test("abcdefghij", 5, 5, "abcdefghij", 9, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 9, 1, -4);
- test("abcdefghij", 5, 5, "abcdefghij", 9, 2, -4);
- test("abcdefghij", 5, 5, "abcdefghij", 10, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 10, 1, 5);
- test("abcdefghij", 5, 5, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 1, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 10, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 19, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 20, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 21, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 1, 4);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 9, 4);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 18, 4);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 19, 4);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 20, 4);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 1, -5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 9, -5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 10, -5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 11, -5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 1, -14);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 2, -14);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 0, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 1, 5);
- test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 5, 6, "", 0, 0, 5);
- test("abcdefghij", 5, 6, "", 0, 1, 5);
- test("abcdefghij", 5, 6, "", 1, 0, 0);
- test("abcdefghij", 5, 6, "abcde", 0, 0, 5);
- test("abcdefghij", 5, 6, "abcde", 0, 1, 5);
- test("abcdefghij", 5, 6, "abcde", 0, 2, 5);
- test("abcdefghij", 5, 6, "abcde", 0, 4, 5);
- test("abcdefghij", 5, 6, "abcde", 0, 5, 5);
- test("abcdefghij", 5, 6, "abcde", 0, 6, 5);
- test("abcdefghij", 5, 6, "abcde", 1, 0, 5);
- test("abcdefghij", 5, 6, "abcde", 1, 1, 4);
- test("abcdefghij", 5, 6, "abcde", 1, 2, 4);
- test("abcdefghij", 5, 6, "abcde", 1, 3, 4);
- test("abcdefghij", 5, 6, "abcde", 1, 4, 4);
- test("abcdefghij", 5, 6, "abcde", 1, 5, 4);
- test("abcdefghij", 5, 6, "abcde", 2, 0, 5);
- test("abcdefghij", 5, 6, "abcde", 2, 1, 3);
- test("abcdefghij", 5, 6, "abcde", 2, 2, 3);
-}
-
-void test32()
-{
- test("abcdefghij", 5, 6, "abcde", 2, 3, 3);
- test("abcdefghij", 5, 6, "abcde", 2, 4, 3);
- test("abcdefghij", 5, 6, "abcde", 4, 0, 5);
- test("abcdefghij", 5, 6, "abcde", 4, 1, 1);
- test("abcdefghij", 5, 6, "abcde", 4, 2, 1);
- test("abcdefghij", 5, 6, "abcde", 5, 0, 5);
- test("abcdefghij", 5, 6, "abcde", 5, 1, 5);
- test("abcdefghij", 5, 6, "abcde", 6, 0, 0);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 1, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 5, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 9, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 10, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 0, 11, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 1, 4);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 4, 4);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 8, 4);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 9, 4);
- test("abcdefghij", 5, 6, "abcdefghij", 1, 10, 4);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 1, 4);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 2, 3);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 4, 1);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 5, 0);
- test("abcdefghij", 5, 6, "abcdefghij", 5, 6, 0);
- test("abcdefghij", 5, 6, "abcdefghij", 9, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 9, 1, -4);
- test("abcdefghij", 5, 6, "abcdefghij", 9, 2, -4);
- test("abcdefghij", 5, 6, "abcdefghij", 10, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 10, 1, 5);
- test("abcdefghij", 5, 6, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 1, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 10, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 19, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 20, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 21, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 1, 4);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 9, 4);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 18, 4);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 19, 4);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 20, 4);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 1, -5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 9, -5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 10, -5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 11, -5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 1, -14);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 2, -14);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 0, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 1, 5);
- test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 9, 0, "", 0, 0, 0);
- test("abcdefghij", 9, 0, "", 0, 1, 0);
- test("abcdefghij", 9, 0, "", 1, 0, 0);
- test("abcdefghij", 9, 0, "abcde", 0, 0, 0);
- test("abcdefghij", 9, 0, "abcde", 0, 1, -1);
- test("abcdefghij", 9, 0, "abcde", 0, 2, -2);
- test("abcdefghij", 9, 0, "abcde", 0, 4, -4);
- test("abcdefghij", 9, 0, "abcde", 0, 5, -5);
- test("abcdefghij", 9, 0, "abcde", 0, 6, -5);
- test("abcdefghij", 9, 0, "abcde", 1, 0, 0);
- test("abcdefghij", 9, 0, "abcde", 1, 1, -1);
- test("abcdefghij", 9, 0, "abcde", 1, 2, -2);
- test("abcdefghij", 9, 0, "abcde", 1, 3, -3);
- test("abcdefghij", 9, 0, "abcde", 1, 4, -4);
- test("abcdefghij", 9, 0, "abcde", 1, 5, -4);
- test("abcdefghij", 9, 0, "abcde", 2, 0, 0);
- test("abcdefghij", 9, 0, "abcde", 2, 1, -1);
- test("abcdefghij", 9, 0, "abcde", 2, 2, -2);
- test("abcdefghij", 9, 0, "abcde", 2, 3, -3);
- test("abcdefghij", 9, 0, "abcde", 2, 4, -3);
- test("abcdefghij", 9, 0, "abcde", 4, 0, 0);
- test("abcdefghij", 9, 0, "abcde", 4, 1, -1);
- test("abcdefghij", 9, 0, "abcde", 4, 2, -1);
- test("abcdefghij", 9, 0, "abcde", 5, 0, 0);
- test("abcdefghij", 9, 0, "abcde", 5, 1, 0);
- test("abcdefghij", 9, 0, "abcde", 6, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghij", 9, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghij", 9, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghij", 9, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghij", 9, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghij", 9, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghij", 9, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghij", 9, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 9, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 9, 0, "abcdefghij", 5, 6, -5);
-}
-
-void test33()
-{
- test("abcdefghij", 9, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghij", 9, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 9, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 9, 1, "", 0, 0, 1);
- test("abcdefghij", 9, 1, "", 0, 1, 1);
- test("abcdefghij", 9, 1, "", 1, 0, 0);
- test("abcdefghij", 9, 1, "abcde", 0, 0, 1);
- test("abcdefghij", 9, 1, "abcde", 0, 1, 9);
- test("abcdefghij", 9, 1, "abcde", 0, 2, 9);
- test("abcdefghij", 9, 1, "abcde", 0, 4, 9);
- test("abcdefghij", 9, 1, "abcde", 0, 5, 9);
- test("abcdefghij", 9, 1, "abcde", 0, 6, 9);
- test("abcdefghij", 9, 1, "abcde", 1, 0, 1);
- test("abcdefghij", 9, 1, "abcde", 1, 1, 8);
- test("abcdefghij", 9, 1, "abcde", 1, 2, 8);
- test("abcdefghij", 9, 1, "abcde", 1, 3, 8);
- test("abcdefghij", 9, 1, "abcde", 1, 4, 8);
- test("abcdefghij", 9, 1, "abcde", 1, 5, 8);
- test("abcdefghij", 9, 1, "abcde", 2, 0, 1);
- test("abcdefghij", 9, 1, "abcde", 2, 1, 7);
- test("abcdefghij", 9, 1, "abcde", 2, 2, 7);
- test("abcdefghij", 9, 1, "abcde", 2, 3, 7);
- test("abcdefghij", 9, 1, "abcde", 2, 4, 7);
- test("abcdefghij", 9, 1, "abcde", 4, 0, 1);
- test("abcdefghij", 9, 1, "abcde", 4, 1, 5);
- test("abcdefghij", 9, 1, "abcde", 4, 2, 5);
- test("abcdefghij", 9, 1, "abcde", 5, 0, 1);
- test("abcdefghij", 9, 1, "abcde", 5, 1, 1);
- test("abcdefghij", 9, 1, "abcde", 6, 0, 0);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 1, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 5, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 9, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 10, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 0, 11, 9);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 1, 8);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 4, 8);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 8, 8);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 9, 8);
- test("abcdefghij", 9, 1, "abcdefghij", 1, 10, 8);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 1, 4);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 2, 4);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 4, 4);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 5, 4);
- test("abcdefghij", 9, 1, "abcdefghij", 5, 6, 4);
- test("abcdefghij", 9, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 9, 1, 0);
- test("abcdefghij", 9, 1, "abcdefghij", 9, 2, 0);
- test("abcdefghij", 9, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghij", 9, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 1, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 10, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 19, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 20, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 21, 9);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 1, 8);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 9, 8);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 18, 8);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 19, 8);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 20, 8);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 5, -1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 9, -1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 10, -1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 11, -1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 1, -10);
-}
-
-void test34()
-{
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 2, -10);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 9, 2, "", 0, 0, 1);
- test("abcdefghij", 9, 2, "", 0, 1, 1);
- test("abcdefghij", 9, 2, "", 1, 0, 0);
- test("abcdefghij", 9, 2, "abcde", 0, 0, 1);
- test("abcdefghij", 9, 2, "abcde", 0, 1, 9);
- test("abcdefghij", 9, 2, "abcde", 0, 2, 9);
- test("abcdefghij", 9, 2, "abcde", 0, 4, 9);
- test("abcdefghij", 9, 2, "abcde", 0, 5, 9);
- test("abcdefghij", 9, 2, "abcde", 0, 6, 9);
- test("abcdefghij", 9, 2, "abcde", 1, 0, 1);
- test("abcdefghij", 9, 2, "abcde", 1, 1, 8);
- test("abcdefghij", 9, 2, "abcde", 1, 2, 8);
- test("abcdefghij", 9, 2, "abcde", 1, 3, 8);
- test("abcdefghij", 9, 2, "abcde", 1, 4, 8);
- test("abcdefghij", 9, 2, "abcde", 1, 5, 8);
- test("abcdefghij", 9, 2, "abcde", 2, 0, 1);
- test("abcdefghij", 9, 2, "abcde", 2, 1, 7);
- test("abcdefghij", 9, 2, "abcde", 2, 2, 7);
- test("abcdefghij", 9, 2, "abcde", 2, 3, 7);
- test("abcdefghij", 9, 2, "abcde", 2, 4, 7);
- test("abcdefghij", 9, 2, "abcde", 4, 0, 1);
- test("abcdefghij", 9, 2, "abcde", 4, 1, 5);
- test("abcdefghij", 9, 2, "abcde", 4, 2, 5);
- test("abcdefghij", 9, 2, "abcde", 5, 0, 1);
- test("abcdefghij", 9, 2, "abcde", 5, 1, 1);
- test("abcdefghij", 9, 2, "abcde", 6, 0, 0);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 1, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 5, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 9, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 10, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 0, 11, 9);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 1, 8);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 4, 8);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 8, 8);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 9, 8);
- test("abcdefghij", 9, 2, "abcdefghij", 1, 10, 8);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 1, 4);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 2, 4);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 4, 4);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 5, 4);
- test("abcdefghij", 9, 2, "abcdefghij", 5, 6, 4);
- test("abcdefghij", 9, 2, "abcdefghij", 9, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 9, 1, 0);
- test("abcdefghij", 9, 2, "abcdefghij", 9, 2, 0);
- test("abcdefghij", 9, 2, "abcdefghij", 10, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 10, 1, 1);
- test("abcdefghij", 9, 2, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 1, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 10, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 19, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 20, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 21, 9);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 1, 8);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 9, 8);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 18, 8);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 19, 8);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 20, 8);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 5, -1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 9, -1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 10, -1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 11, -1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 1, -10);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 2, -10);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 10, 0, "", 0, 0, 0);
- test("abcdefghij", 10, 0, "", 0, 1, 0);
- test("abcdefghij", 10, 0, "", 1, 0, 0);
- test("abcdefghij", 10, 0, "abcde", 0, 0, 0);
- test("abcdefghij", 10, 0, "abcde", 0, 1, -1);
- test("abcdefghij", 10, 0, "abcde", 0, 2, -2);
- test("abcdefghij", 10, 0, "abcde", 0, 4, -4);
- test("abcdefghij", 10, 0, "abcde", 0, 5, -5);
- test("abcdefghij", 10, 0, "abcde", 0, 6, -5);
- test("abcdefghij", 10, 0, "abcde", 1, 0, 0);
- test("abcdefghij", 10, 0, "abcde", 1, 1, -1);
- test("abcdefghij", 10, 0, "abcde", 1, 2, -2);
- test("abcdefghij", 10, 0, "abcde", 1, 3, -3);
- test("abcdefghij", 10, 0, "abcde", 1, 4, -4);
- test("abcdefghij", 10, 0, "abcde", 1, 5, -4);
- test("abcdefghij", 10, 0, "abcde", 2, 0, 0);
- test("abcdefghij", 10, 0, "abcde", 2, 1, -1);
- test("abcdefghij", 10, 0, "abcde", 2, 2, -2);
- test("abcdefghij", 10, 0, "abcde", 2, 3, -3);
- test("abcdefghij", 10, 0, "abcde", 2, 4, -3);
- test("abcdefghij", 10, 0, "abcde", 4, 0, 0);
- test("abcdefghij", 10, 0, "abcde", 4, 1, -1);
-}
-
-void test35()
-{
- test("abcdefghij", 10, 0, "abcde", 4, 2, -1);
- test("abcdefghij", 10, 0, "abcde", 5, 0, 0);
- test("abcdefghij", 10, 0, "abcde", 5, 1, 0);
- test("abcdefghij", 10, 0, "abcde", 6, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghij", 10, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghij", 10, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghij", 10, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghij", 10, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghij", 10, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghij", 10, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghij", 10, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 10, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 10, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 10, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghij", 10, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 10, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 10, 1, "", 0, 0, 0);
- test("abcdefghij", 10, 1, "", 0, 1, 0);
- test("abcdefghij", 10, 1, "", 1, 0, 0);
- test("abcdefghij", 10, 1, "abcde", 0, 0, 0);
- test("abcdefghij", 10, 1, "abcde", 0, 1, -1);
- test("abcdefghij", 10, 1, "abcde", 0, 2, -2);
- test("abcdefghij", 10, 1, "abcde", 0, 4, -4);
- test("abcdefghij", 10, 1, "abcde", 0, 5, -5);
- test("abcdefghij", 10, 1, "abcde", 0, 6, -5);
- test("abcdefghij", 10, 1, "abcde", 1, 0, 0);
- test("abcdefghij", 10, 1, "abcde", 1, 1, -1);
- test("abcdefghij", 10, 1, "abcde", 1, 2, -2);
- test("abcdefghij", 10, 1, "abcde", 1, 3, -3);
- test("abcdefghij", 10, 1, "abcde", 1, 4, -4);
- test("abcdefghij", 10, 1, "abcde", 1, 5, -4);
- test("abcdefghij", 10, 1, "abcde", 2, 0, 0);
- test("abcdefghij", 10, 1, "abcde", 2, 1, -1);
- test("abcdefghij", 10, 1, "abcde", 2, 2, -2);
- test("abcdefghij", 10, 1, "abcde", 2, 3, -3);
- test("abcdefghij", 10, 1, "abcde", 2, 4, -3);
- test("abcdefghij", 10, 1, "abcde", 4, 0, 0);
- test("abcdefghij", 10, 1, "abcde", 4, 1, -1);
- test("abcdefghij", 10, 1, "abcde", 4, 2, -1);
- test("abcdefghij", 10, 1, "abcde", 5, 0, 0);
- test("abcdefghij", 10, 1, "abcde", 5, 1, 0);
- test("abcdefghij", 10, 1, "abcde", 6, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 5, -5);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 9, -9);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 10, -10);
- test("abcdefghij", 10, 1, "abcdefghij", 0, 11, -10);
- test("abcdefghij", 10, 1, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 1, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghij", 1, 4, -4);
- test("abcdefghij", 10, 1, "abcdefghij", 1, 8, -8);
- test("abcdefghij", 10, 1, "abcdefghij", 1, 9, -9);
- test("abcdefghij", 10, 1, "abcdefghij", 1, 10, -9);
- test("abcdefghij", 10, 1, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 5, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghij", 5, 2, -2);
- test("abcdefghij", 10, 1, "abcdefghij", 5, 4, -4);
- test("abcdefghij", 10, 1, "abcdefghij", 5, 5, -5);
- test("abcdefghij", 10, 1, "abcdefghij", 5, 6, -5);
- test("abcdefghij", 10, 1, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 9, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghij", 9, 2, -1);
- test("abcdefghij", 10, 1, "abcdefghij", 10, 0, 0);
-}
-
-void test36()
-{
- test("abcdefghij", 10, 1, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 10, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghij", 11, 0, "", 0, 0, 0);
- test("abcdefghij", 11, 0, "", 0, 1, 0);
- test("abcdefghij", 11, 0, "", 1, 0, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 0, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 1, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 2, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 4, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 5, 0);
- test("abcdefghij", 11, 0, "abcde", 0, 6, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 0, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 1, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 2, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 3, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 4, 0);
- test("abcdefghij", 11, 0, "abcde", 1, 5, 0);
- test("abcdefghij", 11, 0, "abcde", 2, 0, 0);
- test("abcdefghij", 11, 0, "abcde", 2, 1, 0);
- test("abcdefghij", 11, 0, "abcde", 2, 2, 0);
- test("abcdefghij", 11, 0, "abcde", 2, 3, 0);
- test("abcdefghij", 11, 0, "abcde", 2, 4, 0);
- test("abcdefghij", 11, 0, "abcde", 4, 0, 0);
- test("abcdefghij", 11, 0, "abcde", 4, 1, 0);
- test("abcdefghij", 11, 0, "abcde", 4, 2, 0);
- test("abcdefghij", 11, 0, "abcde", 5, 0, 0);
- test("abcdefghij", 11, 0, "abcde", 5, 1, 0);
- test("abcdefghij", 11, 0, "abcde", 6, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 5, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 9, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 10, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 0, 11, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 4, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 8, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 9, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 1, 10, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 2, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 4, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 5, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 5, 6, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 9, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 9, 2, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 10, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 19, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 20, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 21, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 9, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 18, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 19, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 20, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 5, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 9, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 10, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 11, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 2, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 21, 0, 0);
-}
-
-void test37()
-{
- test("abcdefghijklmnopqrst", 0, 0, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 0, 0, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 2, -2);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 4, -4);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 5, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 6, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 2, -2);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 3, -3);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 4, -4);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 5, -4);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 3, -3);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 4, -3);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 2, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 0, 1, "", 0, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "", 0, 1, 1);
- test("abcdefghijklmnopqrst", 0, 1, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 1, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 2, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 4, -3);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 5, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 6, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 2, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 3, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 5, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 1, -2);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 3, -2);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 4, -2);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 1, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 2, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, 1, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcde", 6, 0, 0);
-}
-
-void test38()
-{
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 1, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 5, -4);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 9, -8);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 10, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 11, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 8, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 10, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 1, -5);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 2, -5);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 4, -5);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 1, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 2, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 0, 10, "", 0, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "", 0, 1, 10);
- test("abcdefghijklmnopqrst", 0, 10, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 1, 9);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 2, 8);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 4, 6);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 5, 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 6, 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 2, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 3, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 5, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 1, -2);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 3, -2);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 4, -2);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 1, -4);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 2, -4);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 1, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 1, 9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 5, 5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 9, 1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 10, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 11, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 8, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 10, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 1, -5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 2, -5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 4, -5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 1, -9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 2, -9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 1, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 1, 9);
-}
-
-void test39()
-{
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 10, 0);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 19, -9);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 20, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 21, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, 0, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, 1, 10);
- test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 0, 19, "", 0, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 19, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 1, 18);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 2, 17);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 4, 15);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 5, 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 6, 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 2, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 3, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 5, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 1, -2);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 3, -2);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 4, -2);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 1, -4);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 2, -4);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 1, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 1, 18);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 5, 14);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 9, 10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 10, 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 11, 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 8, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 10, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 1, -5);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 2, -5);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 4, -5);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 1, -9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 2, -9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 1, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 1, 18);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 10, 9);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 19, 0);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 20, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 21, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, 0, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, 1, 19);
- test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 0, 20, "", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "", 0, 1, 20);
- test("abcdefghijklmnopqrst", 0, 20, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 0, 20);
-}
-
-void test40()
-{
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 2, 18);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 4, 16);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 5, 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 6, 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 2, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 3, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 5, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 1, -2);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 3, -2);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 4, -2);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 1, -4);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 2, -4);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 1, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 5, 15);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 9, 11);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 8, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 10, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 1, -5);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 2, -5);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 4, -5);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 1, -9);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 2, -9);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 1, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 20, 0);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 21, 0);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 0, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 1, 20);
- test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 0, 21, "", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "", 0, 1, 20);
- test("abcdefghijklmnopqrst", 0, 21, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 2, 18);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 4, 16);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 5, 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 6, 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 2, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 3, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 5, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 1, -2);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 3, -2);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 4, -2);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 1, -4);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 2, -4);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 1, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 5, 15);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 9, 11);
-}
-
-void test41()
-{
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 4, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 8, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 10, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 1, -5);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 2, -5);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 4, -5);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 1, -9);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 2, -9);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 1, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 1, 19);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 20, 0);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 21, 0);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 9, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 18, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 1, -10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 5, -10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 9, -10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 1, -19);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 2, -19);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 0, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 1, 20);
- test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 1, 0, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 2, -2);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 4, -4);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 5, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 6, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 2, -2);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 3, -3);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 4, -4);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 5, -4);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 3, -3);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 4, -3);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 2, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20);
-}
-
-void test42()
-{
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 1, 1, "", 0, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 2, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 4, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 6, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 1, 0);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 2, -1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 3, -2);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 4, -3);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 5, -3);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 2, -1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 3, -1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 4, -1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 1, -3);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 2, -3);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 9, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 11, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 1, 0);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 4, -3);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 8, -7);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 9, -8);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 10, -8);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 1, -4);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 2, -4);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 5, -4);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 6, -4);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 1, -8);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 2, -8);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 1, 9, "", 0, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "", 0, 1, 9);
- test("abcdefghijklmnopqrst", 1, 9, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 2, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 4, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 5, 1);
-}
-
-void test43()
-{
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 6, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 1, 8);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 2, 7);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 3, 6);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 4, 5);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 5, 5);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 2, -1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 3, -1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 4, -1);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 1, -3);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 2, -3);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 1, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 9, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 11, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 1, 8);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 4, 5);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 8, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 9, 0);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 10, 0);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 1, -4);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 2, -4);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 5, -4);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 6, -4);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 1, -8);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 2, -8);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 1, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 1, 8);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 9, 0);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 18, -9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 19, -10);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 20, -10);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 0, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 1, 9);
- test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 1, 18, "", 0, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "", 0, 1, 18);
- test("abcdefghijklmnopqrst", 1, 18, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 2, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 4, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 6, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 1, 17);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 2, 16);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 3, 15);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 4, 14);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 5, 14);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 2, -1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 3, -1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 4, -1);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 1, -3);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 2, -3);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 1, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 9, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 11, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 1, 17);
-}
-
-void test44()
-{
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 4, 14);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 8, 10);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 9, 9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 10, 9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 1, -4);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 2, -4);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 5, -4);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 6, -4);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 1, -8);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 2, -8);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 1, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 1, 17);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 9, 9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 18, 0);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 19, -1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 20, -1);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 0, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 1, 18);
- test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 1, 19, "", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "", 0, 1, 19);
- test("abcdefghijklmnopqrst", 1, 19, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 2, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 4, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 6, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 1, 18);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 2, 17);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 3, 16);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 4, 15);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 5, 15);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 2, -1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 3, -1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 4, -1);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 1, -3);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 2, -3);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 1, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 9, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 11, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 1, 18);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 4, 15);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 8, 11);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 9, 10);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 10, 10);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 1, -4);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 2, -4);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 5, -4);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 6, -4);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 1, -8);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 2, -8);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 1, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 1, 18);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 9, 10);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 18, 1);
-}
-
-void test45()
-{
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 19, 0);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 20, 0);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 0, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 1, 19);
- test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 1, 20, "", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "", 0, 1, 19);
- test("abcdefghijklmnopqrst", 1, 20, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 2, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 4, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 6, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 1, 18);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 2, 17);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 3, 16);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 4, 15);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 5, 15);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 2, -1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 3, -1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 4, -1);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 1, -3);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 2, -3);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 1, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 5, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 9, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 11, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 1, 18);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 4, 15);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 8, 11);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 9, 10);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 10, 10);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 1, -4);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 2, -4);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 5, -4);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 6, -4);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 1, -8);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 2, -8);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 1, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 1, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 10, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 19, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 20, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 21, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 1, 18);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 9, 10);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 18, 1);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 19, 0);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 20, 0);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 1, -9);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 5, -9);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 1, -18);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 2, -18);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 0, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 1, 19);
- test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 10, 0, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 2, -2);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 4, -4);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 5, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 6, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 2, -2);
-}
-
-void test46()
-{
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 3, -3);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 4, -4);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 5, -4);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 3, -3);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 4, -3);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 2, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 10, 1, "", 0, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "", 0, 1, 1);
- test("abcdefghijklmnopqrst", 10, 1, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 2, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 4, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 6, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 2, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 3, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 5, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 1, 8);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 2, 8);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 3, 8);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 4, 8);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 1, 6);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 2, 6);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 1, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 9, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 8, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 10, 9);
-}
-
-void test47()
-{
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 1, 5);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 2, 5);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 4, 5);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 5, 5);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 6, 5);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 1, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 2, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 19, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 20, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 21, 10);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 18, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 19, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 20, 9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 1, 0);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 5, -4);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 9, -8);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 10, -9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 11, -9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 1, -9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 2, -9);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 10, 5, "", 0, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "", 0, 1, 5);
- test("abcdefghijklmnopqrst", 10, 5, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 2, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 4, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 6, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 2, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 3, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 5, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 1, 8);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 2, 8);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 3, 8);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 4, 8);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 1, 6);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 2, 6);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 1, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 9, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 8, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 10, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 1, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 2, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 4, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 5, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 6, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 1, 1);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 2, 1);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 1, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 19, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 20, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 21, 10);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 18, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 19, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 20, 9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 1, 4);
-}
-
-void test48()
-{
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 5, 0);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 9, -4);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 10, -5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 11, -5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 1, -9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 2, -9);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 0, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 1, 5);
- test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 10, 9, "", 0, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "", 0, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 2, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 4, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 6, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 2, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 3, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 5, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 1, 8);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 2, 8);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 3, 8);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 4, 8);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 1, 6);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 2, 6);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 9, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 8, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 10, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 1, 5);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 2, 5);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 4, 5);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 5, 5);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 6, 5);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 1, 1);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 2, 1);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 19, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 20, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 21, 10);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 18, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 19, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 20, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 1, 8);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 5, 4);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 9, 0);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 10, -1);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 11, -1);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 1, -9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 2, -9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 0, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 1, 9);
- test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 10, 10, "", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 2, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 4, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 6, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 2, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 3, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 5, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 0, 10);
-}
-
-void test49()
-{
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 1, 8);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 2, 8);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 3, 8);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 4, 8);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 1, 6);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 2, 6);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 9, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 8, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 10, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 1, 5);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 2, 5);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 4, 5);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 5, 5);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 6, 5);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 1, 1);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 2, 1);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 19, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 20, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 21, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 18, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 19, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 20, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 1, 9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 5, 5);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 9, 1);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 10, 0);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 11, 0);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 1, -9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 2, -9);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 0, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 1, 10);
- test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 10, 11, "", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 2, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 4, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 6, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 2, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 3, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 5, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 1, 8);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 2, 8);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 3, 8);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 4, 8);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 1, 6);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 2, 6);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 5, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 9, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 11, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 4, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 8, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 10, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 1, 5);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 2, 5);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 4, 5);
-}
-
-void test50()
-{
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 5, 5);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 6, 5);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 1, 1);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 2, 1);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 10, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 19, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 20, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 21, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 1, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 9, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 18, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 19, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 20, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 1, 9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 5, 5);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 9, 1);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 10, 0);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 11, 0);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 1, -9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 2, -9);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 0, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 1, 10);
- test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 19, 0, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 2, -2);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 4, -4);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 5, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 6, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 2, -2);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 3, -3);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 4, -4);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 5, -4);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 3, -3);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 4, -3);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 2, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 11, -10);
-}
-
-void test51()
-{
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 19, 1, "", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "", 0, 1, 1);
- test("abcdefghijklmnopqrst", 19, 1, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 1, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 2, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 4, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 5, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 6, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 1, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 2, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 3, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 4, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 5, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 1, 17);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 2, 17);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 3, 17);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 4, 17);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 1, 15);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 2, 15);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 1, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 1, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 5, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 9, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 10, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 11, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 1, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 4, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 8, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 9, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 10, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 1, 14);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 2, 14);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 4, 14);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 5, 14);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 6, 14);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 1, 10);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 2, 10);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 1, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 1, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 10, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 19, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 20, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 21, 19);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 1, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 9, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 18, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 19, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 20, 18);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 1, 9);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 5, 9);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 9, 9);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 10, 9);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 11, 9);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 1, 0);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 2, 0);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 19, 2, "", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "", 0, 1, 1);
- test("abcdefghijklmnopqrst", 19, 2, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 1, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 2, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 4, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 5, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 6, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 1, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 2, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 3, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 4, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 5, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 1, 17);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 2, 17);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 3, 17);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 4, 17);
-}
-
-void test52()
-{
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 1, 15);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 2, 15);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 1, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 1, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 5, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 9, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 10, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 11, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 1, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 4, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 8, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 9, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 10, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 1, 14);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 2, 14);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 4, 14);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 5, 14);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 6, 14);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 1, 10);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 2, 10);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 1, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 1, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 10, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 19, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 20, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 21, 19);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 1, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 9, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 18, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 19, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 20, 18);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 1, 9);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 5, 9);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 9, 9);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 10, 9);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 11, 9);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 1, 0);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 2, 0);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 0, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 1, 1);
- test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 20, 0, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 2, -2);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 4, -4);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 5, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 6, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 2, -2);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 3, -3);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 4, -4);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 5, -4);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 3, -3);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 4, -3);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 2, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 5, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 9, -9);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 10, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 11, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 4, -4);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 8, -8);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 9, -9);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 10, -9);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 2, -2);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 1, -1);
-}
-
-void test53()
-{
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 2, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 20, 1, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 2, -2);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 4, -4);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 5, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 6, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 2, -2);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 3, -3);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 4, -4);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 5, -4);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 2, -2);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 3, -3);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 4, -3);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 2, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 5, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 9, -9);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 10, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 11, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 4, -4);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 8, -8);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 9, -9);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 10, -9);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 2, -2);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 4, -4);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 5, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 6, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 2, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 10, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 19, -19);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 20, -20);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 21, -20);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 9, -9);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 18, -18);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 19, -19);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 20, -19);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 5, -5);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 9, -9);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 10, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 11, -10);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 1, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 2, -1);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, 0, 0);
-}
-
-void test54()
-{
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 21, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "", 0, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "", 0, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "", 1, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 4, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 6, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 3, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 4, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 3, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 4, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcde", 6, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 9, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 10, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 11, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 4, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 8, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 9, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 10, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 4, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 6, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 11, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 10, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 19, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 20, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 21, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 9, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 18, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 19, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 20, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 5, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 9, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 10, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 11, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 2, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 0, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 1, 0);
- test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 21, 0, 0);
-}
-
-
-int main () {
- test0();
- test1();
- test2();
- test3();
- test4();
- test5();
- test6();
- test7();
- test8();
- test9();
- test10();
- test11();
- test12();
- test13();
- test14();
- test15();
- test16();
- test17();
- test18();
- test19();
- test20();
- test21();
- test22();
- test23();
- test24();
- test25();
- test26();
- test27();
- test28();
- test29();
- test30();
- test31();
- test32();
- test33();
- test34();
- test35();
- test36();
- test37();
- test38();
- test39();
- test40();
- test41();
- test42();
- test43();
- test44();
- test45();
- test46();
- test47();
- test48();
- test49();
- test50();
- test51();
- test52();
- test53();
- test54();
-
-
- {
- test("abcde", 5, 1, "", 0, 0, 0);
- test("abcde", 2, 4, "", 0, 0, 3);
- test("abcde", 2, 4, "abcde", 3, 4, -2);
- test("ABCde", 2, 4, "abcde", 2, 4, -1);
- }
-
- {
- test(L"abcde", 5, 1, L"", 0, 0, 0);
- test(L"abcde", 2, 4, L"", 0, 0, 3);
- test(L"abcde", 2, 4, L"abcde", 3, 4, -2);
- test(L"ABCde", 2, 4, L"abcde", 2, 4, -1);
- }
-
-#if TEST_STD_VER >= 11
- {
- test(u"abcde", 5, 1, u"", 0, 0, 0);
- test(u"abcde", 2, 4, u"", 0, 0, 3);
- test(u"abcde", 2, 4, u"abcde", 3, 4, -2);
- test(u"ABCde", 2, 4, u"abcde", 2, 4, -1);
- }
-
- {
- test(U"abcde", 5, 1, U"", 0, 0, 0);
- test(U"abcde", 2, 4, U"", 0, 0, 3);
- test(U"abcde", 2, 4, U"abcde", 3, 4, -2);
- test(U"ABCde", 2, 4, U"abcde", 2, 4, -1);
- }
-#endif
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1 { "abcde", 5 };
- static_assert ( sv1.compare(5, 1, "", 0, 0) == 0, "" );
- static_assert ( sv1.compare(2, 4, "", 0, 0) == 1, "" );
- static_assert ( sv1.compare(2, 4, "abcde", 3, 4) == -1, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp
deleted file mode 100644
index ff01daaf1ce4..000000000000
--- a/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-// constexpr int compare(basic_string_view str) const noexcept;
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-#include "constexpr_char_traits.hpp"
-
-int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv1,
- std::experimental::basic_string_view<CharT> sv2, int expected ) {
- assert ( sign( sv1.compare(sv2)) == sign(expected));
-}
-
-
-template<typename CharT>
-void test ( const CharT *s1, const CharT *s2, int expected ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
-
- string_view_t sv1 ( s1 );
- string_view_t sv2 ( s2 );
- test1(sv1, sv2, expected);
-}
-
-int main () {
-
- test("", "", 0);
- test("", "abcde", -5);
- test("", "abcdefghij", -10);
- test("", "abcdefghijklmnopqrst", -20);
- test("abcde", "", 5);
- test("abcde", "abcde", 0);
- test("abcde", "abcdefghij", -5);
- test("abcde", "abcdefghijklmnopqrst", -15);
- test("abcdefghij", "", 10);
- test("abcdefghij", "abcde", 5);
- test("abcdefghij", "abcdefghij", 0);
- test("abcdefghij", "abcdefghijklmnopqrst", -10);
- test("abcdefghijklmnopqrst", "", 20);
- test("abcdefghijklmnopqrst", "abcde", 15);
- test("abcdefghijklmnopqrst", "abcdefghij", 10);
- test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0);
-
- test(L"", L"", 0);
- test(L"", L"abcde", -5);
- test(L"", L"abcdefghij", -10);
- test(L"", L"abcdefghijklmnopqrst", -20);
- test(L"abcde", L"", 5);
- test(L"abcde", L"abcde", 0);
- test(L"abcde", L"abcdefghij", -5);
- test(L"abcde", L"abcdefghijklmnopqrst", -15);
- test(L"abcdefghij", L"", 10);
- test(L"abcdefghij", L"abcde", 5);
- test(L"abcdefghij", L"abcdefghij", 0);
- test(L"abcdefghij", L"abcdefghijklmnopqrst", -10);
- test(L"abcdefghijklmnopqrst", L"", 20);
- test(L"abcdefghijklmnopqrst", L"abcde", 15);
- test(L"abcdefghijklmnopqrst", L"abcdefghij", 10);
- test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0);
-
-#if TEST_STD_VER >= 11
- test(u"", u"", 0);
- test(u"", u"abcde", -5);
- test(u"", u"abcdefghij", -10);
- test(u"", u"abcdefghijklmnopqrst", -20);
- test(u"abcde", u"", 5);
- test(u"abcde", u"abcde", 0);
- test(u"abcde", u"abcdefghij", -5);
- test(u"abcde", u"abcdefghijklmnopqrst", -15);
- test(u"abcdefghij", u"", 10);
- test(u"abcdefghij", u"abcde", 5);
- test(u"abcdefghij", u"abcdefghij", 0);
- test(u"abcdefghij", u"abcdefghijklmnopqrst", -10);
- test(u"abcdefghijklmnopqrst", u"", 20);
- test(u"abcdefghijklmnopqrst", u"abcde", 15);
- test(u"abcdefghijklmnopqrst", u"abcdefghij", 10);
- test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0);
-
- test(U"", U"", 0);
- test(U"", U"abcde", -5);
- test(U"", U"abcdefghij", -10);
- test(U"", U"abcdefghijklmnopqrst", -20);
- test(U"abcde", U"", 5);
- test(U"abcde", U"abcde", 0);
- test(U"abcde", U"abcdefghij", -5);
- test(U"abcde", U"abcdefghijklmnopqrst", -15);
- test(U"abcdefghij", U"", 10);
- test(U"abcdefghij", U"abcde", 5);
- test(U"abcdefghij", U"abcdefghij", 0);
- test(U"abcdefghij", U"abcdefghijklmnopqrst", -10);
- test(U"abcdefghijklmnopqrst", U"", 20);
- test(U"abcdefghijklmnopqrst", U"abcde", 15);
- test(U"abcdefghijklmnopqrst", U"abcdefghij", 10);
- test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
-#endif
-
-#if TEST_STD_VER > 11
- {
- typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
- constexpr SV sv1 { "abcde", 5 };
- constexpr SV sv2 { "abcde", 5 };
- constexpr SV sv3 { "edcba0", 6 };
- static_assert ( sv1.compare(sv2) == 0, "" );
- static_assert ( sv2.compare(sv1) == 0, "" );
- static_assert ( sv3.compare(sv2) > 0, "" );
- static_assert ( sv2.compare(sv3) < 0, "" );
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/copy.pass.cpp b/test/std/experimental/string.view/string.view.ops/copy.pass.cpp
deleted file mode 100644
index 0acd5bda4011..000000000000
--- a/test/std/experimental/string.view/string.view.ops/copy.pass.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// size_type copy(charT* s, size_type n, size_type pos = 0) const;
-
-// Throws: out_of_range if pos > size().
-// Remarks: Let rlen be the smaller of n and size() - pos.
-// Requires: [s, s+rlen) is a valid range.
-// Effects: Equivalent to std::copy_n(begin() + pos, rlen, s).
-// Returns: rlen.
-
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv, size_t n, size_t pos ) {
- const size_t rlen = std::min ( n, sv.size() - pos );
-
- CharT *dest1 = new CharT [rlen + 1]; dest1[rlen] = 0;
- CharT *dest2 = new CharT [rlen + 1]; dest2[rlen] = 0;
-
- if (pos > sv.size()) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- sv.copy(dest1, n, pos);
- assert(false);
- } catch (const std::out_of_range&) {
- } catch (...) {
- assert(false);
- }
-#endif
- } else {
- sv.copy(dest1, n, pos);
- std::copy_n(sv.begin() + pos, rlen, dest2);
- for ( size_t i = 0; i <= rlen; ++i )
- assert ( dest1[i] == dest2[i] );
- }
- delete [] dest1;
- delete [] dest2;
-}
-
-
-template<typename CharT>
-void test ( const CharT *s ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
-
- string_view_t sv1 ( s );
-
- test1(sv1, 0, 0);
- test1(sv1, 1, 0);
- test1(sv1, 20, 0);
- test1(sv1, sv1.size(), 0);
- test1(sv1, 20, string_view_t::npos);
-
- test1(sv1, 0, 3);
- test1(sv1, 2, 3);
- test1(sv1, 100, 3);
- test1(sv1, 100, string_view_t::npos);
-
- test1(sv1, sv1.size(), string_view_t::npos);
-
- test1(sv1, sv1.size() + 1, 0);
- test1(sv1, sv1.size() + 1, 1);
- test1(sv1, sv1.size() + 1, string_view_t::npos);
-
-}
-
-int main () {
- test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( "ABCDE");
- test ( "a" );
- test ( "" );
-
- test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( L"ABCDE" );
- test ( L"a" );
- test ( L"" );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( u"ABCDE" );
- test ( u"a" );
- test ( u"" );
-
- test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( U"ABCDE" );
- test ( U"a" );
- test ( U"" );
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/substr.pass.cpp b/test/std/experimental/string.view/string.view.ops/substr.pass.cpp
deleted file mode 100644
index a3a1dbf418b8..000000000000
--- a/test/std/experimental/string.view/string.view.ops/substr.pass.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-
-// constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
-
-// Throws: out_of_range if pos > size().
-// Effects: Determines the effective length rlen of the string to reference as the smaller of n and size() - pos.
-// Returns: basic_string_view(data()+pos, rlen).
-
-#include <experimental/string_view>
-#include <cassert>
-
-#include "test_macros.h"
-
-template<typename CharT>
-void test1 ( std::experimental::basic_string_view<CharT> sv, size_t n, size_t pos ) {
- if (pos > sv.size()) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- std::experimental::basic_string_view<CharT> sv1 = sv.substr(pos, n);
- assert(false);
- ((void)sv1);
- } catch (const std::out_of_range&) {
- return;
- } catch (...) {
- assert(false);
- }
-#endif
- } else {
- std::experimental::basic_string_view<CharT> sv1 = sv.substr(pos, n);
- const size_t rlen = std::min ( n, sv.size() - pos );
- assert ( sv1.size() == rlen );
- for ( size_t i = 0; i <= rlen; ++i )
- assert ( sv[pos+i] == sv1[i] );
- }
-}
-
-
-template<typename CharT>
-void test ( const CharT *s ) {
- typedef std::experimental::basic_string_view<CharT> string_view_t;
-
- string_view_t sv1 ( s );
-
- test1(sv1, 0, 0);
- test1(sv1, 1, 0);
- test1(sv1, 20, 0);
- test1(sv1, sv1.size(), 0);
-
- test1(sv1, 0, 3);
- test1(sv1, 2, 3);
- test1(sv1, 100, 3);
-
- test1(sv1, 0, string_view_t::npos);
- test1(sv1, 2, string_view_t::npos);
- test1(sv1, sv1.size(), string_view_t::npos);
-
- test1(sv1, sv1.size() + 1, 0);
- test1(sv1, sv1.size() + 1, 1);
- test1(sv1, sv1.size() + 1, string_view_t::npos);
-}
-
-int main () {
- test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( "ABCDE");
- test ( "a" );
- test ( "" );
-
- test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( L"ABCDE" );
- test ( L"a" );
- test ( L"" );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( u"ABCDE" );
- test ( u"a" );
- test ( u"" );
-
- test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( U"ABCDE" );
- test ( U"a" );
- test ( U"" );
-#endif
-
-#if TEST_STD_VER > 11
- {
- constexpr std::experimental::string_view sv1 { "ABCDE", 5 };
-
- {
- constexpr std::experimental::string_view sv2 = sv1.substr ( 0, 3 );
- static_assert ( sv2.size() == 3, "" );
- static_assert ( sv2[0] == 'A', "" );
- static_assert ( sv2[1] == 'B', "" );
- static_assert ( sv2[2] == 'C', "" );
- }
-
- {
- constexpr std::experimental::string_view sv2 = sv1.substr ( 3, 0 );
- static_assert ( sv2.size() == 0, "" );
- }
-
- {
- constexpr std::experimental::string_view sv2 = sv1.substr ( 3, 3 );
- static_assert ( sv2.size() == 2, "" );
- static_assert ( sv2[0] == 'D', "" );
- static_assert ( sv2[1] == 'E', "" );
- }
- }
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp b/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp
deleted file mode 100644
index a32a2684c548..000000000000
--- a/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-// <string_view>
-
-// template<class Allocator>
-// explicit operator basic_string<_CharT, _Traits, Allocator> () const;
-// template<class _CharT, class _Traits = char_traits<_CharT>, class Allocator = allocator<_CharT> >
-// basic_string<_CharT, _Traits, Allocator> to_string (
-// basic_string_view<_CharT, _Traits> _sv, const Allocator& _a = Allocator()) const;
-
-#include <experimental/string_view>
-#include <cassert>
-#include "min_allocator.h"
-
-template<typename CharT>
-void test ( const CharT *s ) {
- typedef std::basic_string<CharT> String ;
- {
- const std::experimental::basic_string_view<CharT> sv1 ( s );
- String str1 = (String) sv1;
-
- assert ( sv1.size() == str1.size ());
- assert ( std::char_traits<CharT>::compare ( sv1.data(), str1.data(), sv1.size()) == 0 );
-
-#if TEST_STD_VER >= 11
- auto str2 = sv1.to_string(min_allocator<CharT>());
- assert ( sv1.size() == str2.size ());
- assert ( std::char_traits<CharT>::compare ( sv1.data(), str2.data(), sv1.size()) == 0 );
-#endif
- }
-
- {
- const std::experimental::basic_string_view<CharT> sv1;
- String str1 = (String) sv1;
-
- assert ( sv1.size() == 0);
- assert ( sv1.size() == str1.size ());
-
-#if TEST_STD_VER >= 11
- auto str2 = sv1.to_string(min_allocator<CharT>());
- assert ( sv1.size() == str2.size ());
-#endif
- }
-}
-
-int main () {
- test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( "ABCDE");
- test ( "a" );
- test ( "" );
-
- test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( L"ABCDE" );
- test ( L"a" );
- test ( L"" );
-
-#if TEST_STD_VER >= 11
- test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( u"ABCDE" );
- test ( u"a" );
- test ( u"" );
-
- test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
- test ( U"ABCDE" );
- test ( U"a" );
- test ( U"" );
-#endif
-}
diff --git a/test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp b/test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp
deleted file mode 100644
index c21f8a701685..000000000000
--- a/test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <experimental/string_view>
-
-int main () {}
diff --git a/test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp b/test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp
deleted file mode 100644
index c21f8a701685..000000000000
--- a/test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <experimental/string_view>
-
-int main () {}
diff --git a/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp
deleted file mode 100644
index cb8db1febd27..000000000000
--- a/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-// template<class... B> struct conjunction; // C++17
-// template<class... B>
-// constexpr bool conjunction_v = conjunction<B...>::value; // C++17
-
-#include <experimental/type_traits>
-#include <cassert>
-
-namespace ex = std::experimental;
-
-struct True { static constexpr bool value = true; };
-struct False { static constexpr bool value = false; };
-
-int main()
-{
- static_assert ( ex::conjunction<>::value, "" );
- static_assert ( ex::conjunction<std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::false_type>::value, "" );
-
- static_assert ( ex::conjunction_v<>, "" );
- static_assert ( ex::conjunction_v<std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::false_type>, "" );
-
- static_assert ( ex::conjunction<std::true_type, std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::true_type, std::false_type>::value, "" );
- static_assert (!ex::conjunction<std::false_type, std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::false_type, std::false_type>::value, "" );
-
- static_assert ( ex::conjunction_v<std::true_type, std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::true_type, std::false_type>, "" );
- static_assert (!ex::conjunction_v<std::false_type, std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::false_type, std::false_type>, "" );
-
- static_assert ( ex::conjunction<std::true_type, std::true_type, std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::true_type, std::false_type, std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::false_type, std::true_type, std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::false_type, std::false_type, std::true_type >::value, "" );
- static_assert (!ex::conjunction<std::true_type, std::true_type, std::false_type>::value, "" );
- static_assert (!ex::conjunction<std::true_type, std::false_type, std::false_type>::value, "" );
- static_assert (!ex::conjunction<std::false_type, std::true_type, std::false_type>::value, "" );
- static_assert (!ex::conjunction<std::false_type, std::false_type, std::false_type>::value, "" );
-
- static_assert ( ex::conjunction_v<std::true_type, std::true_type, std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::true_type, std::false_type, std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::false_type, std::true_type, std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::false_type, std::false_type, std::true_type >, "" );
- static_assert (!ex::conjunction_v<std::true_type, std::true_type, std::false_type>, "" );
- static_assert (!ex::conjunction_v<std::true_type, std::false_type, std::false_type>, "" );
- static_assert (!ex::conjunction_v<std::false_type, std::true_type, std::false_type>, "" );
- static_assert (!ex::conjunction_v<std::false_type, std::false_type, std::false_type>, "" );
-
- static_assert ( ex::conjunction<True >::value, "" );
- static_assert (!ex::conjunction<False>::value, "" );
-
- static_assert ( ex::conjunction_v<True >, "" );
- static_assert (!ex::conjunction_v<False>, "" );
-}
diff --git a/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp
deleted file mode 100644
index dcdbf09fb099..000000000000
--- a/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-// template<class... B> struct disjunction;
-// template<class... B>
-// constexpr bool disjunction_v = disjunction<B...>::value;
-
-#include <experimental/type_traits>
-#include <cassert>
-
-namespace ex = std::experimental;
-
-struct True { static constexpr bool value = true; };
-struct False { static constexpr bool value = false; };
-
-int main()
-{
- static_assert (!ex::disjunction<>::value, "" );
- static_assert ( ex::disjunction<std::true_type >::value, "" );
- static_assert (!ex::disjunction<std::false_type>::value, "" );
-
- static_assert (!ex::disjunction_v<>, "" );
- static_assert ( ex::disjunction_v<std::true_type >, "" );
- static_assert (!ex::disjunction_v<std::false_type>, "" );
-
- static_assert ( ex::disjunction<std::true_type, std::true_type >::value, "" );
- static_assert ( ex::disjunction<std::true_type, std::false_type>::value, "" );
- static_assert ( ex::disjunction<std::false_type, std::true_type >::value, "" );
- static_assert (!ex::disjunction<std::false_type, std::false_type>::value, "" );
-
- static_assert ( ex::disjunction_v<std::true_type, std::true_type >, "" );
- static_assert ( ex::disjunction_v<std::true_type, std::false_type>, "" );
- static_assert ( ex::disjunction_v<std::false_type, std::true_type >, "" );
- static_assert (!ex::disjunction_v<std::false_type, std::false_type>, "" );
-
- static_assert ( ex::disjunction<std::true_type, std::true_type, std::true_type >::value, "" );
- static_assert ( ex::disjunction<std::true_type, std::false_type, std::true_type >::value, "" );
- static_assert ( ex::disjunction<std::false_type, std::true_type, std::true_type >::value, "" );
- static_assert ( ex::disjunction<std::false_type, std::false_type, std::true_type >::value, "" );
- static_assert ( ex::disjunction<std::true_type, std::true_type, std::false_type>::value, "" );
- static_assert ( ex::disjunction<std::true_type, std::false_type, std::false_type>::value, "" );
- static_assert ( ex::disjunction<std::false_type, std::true_type, std::false_type>::value, "" );
- static_assert (!ex::disjunction<std::false_type, std::false_type, std::false_type>::value, "" );
-
- static_assert ( ex::disjunction_v<std::true_type, std::true_type, std::true_type >, "" );
- static_assert ( ex::disjunction_v<std::true_type, std::false_type, std::true_type >, "" );
- static_assert ( ex::disjunction_v<std::false_type, std::true_type, std::true_type >, "" );
- static_assert ( ex::disjunction_v<std::false_type, std::false_type, std::true_type >, "" );
- static_assert ( ex::disjunction_v<std::true_type, std::true_type, std::false_type>, "" );
- static_assert ( ex::disjunction_v<std::true_type, std::false_type, std::false_type>, "" );
- static_assert ( ex::disjunction_v<std::false_type, std::true_type, std::false_type>, "" );
- static_assert (!ex::disjunction_v<std::false_type, std::false_type, std::false_type>, "" );
-
- static_assert ( ex::disjunction<True >::value, "" );
- static_assert (!ex::disjunction<False>::value, "" );
-
- static_assert ( ex::disjunction_v<True >, "" );
- static_assert (!ex::disjunction_v<False>, "" );
-}
diff --git a/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp
deleted file mode 100644
index b0d43d7e5122..000000000000
--- a/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-// template<class B> struct negation;
-// template<class B>
-// constexpr bool negation_v = negation<B>::value;
-
-#include <experimental/type_traits>
-#include <cassert>
-
-namespace ex = std::experimental;
-
-struct True { static constexpr bool value = true; };
-struct False { static constexpr bool value = false; };
-
-int main()
-{
- static_assert (!ex::negation<std::true_type >::value, "" );
- static_assert ( ex::negation<std::false_type>::value, "" );
-
- static_assert (!ex::negation_v<std::true_type >, "" );
- static_assert ( ex::negation_v<std::false_type>, "" );
-
- static_assert (!ex::negation<True >::value, "" );
- static_assert ( ex::negation<False>::value, "" );
-
- static_assert (!ex::negation_v<True >, "" );
- static_assert ( ex::negation_v<False>, "" );
-
- static_assert ( ex::negation<ex::negation<std::true_type >>::value, "" );
- static_assert (!ex::negation<ex::negation<std::false_type>>::value, "" );
-}
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp
deleted file mode 100644
index 8edc917303ac..000000000000
--- a/test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-#include <experimental/type_traits>
-
-namespace ex = std::experimental;
-
-struct base_type {};
-struct derived_type : base_type {};
-
-int main()
-{
- {
- typedef int T;
- typedef int U;
- static_assert(ex::is_same_v<T, U>, "");
- static_assert(std::is_same<decltype(ex::is_same_v<T, U>), const bool>::value, "");
- static_assert(ex::is_same_v<T, U> == std::is_same<T, U>::value, "");
- }
- {
- typedef int T;
- typedef long U;
- static_assert(!ex::is_same_v<T, U>, "");
- static_assert(ex::is_same_v<T, U> == std::is_same<T, U>::value, "");
- }
- {
- typedef base_type T;
- typedef derived_type U;
- static_assert(ex::is_base_of_v<T, U>, "");
- static_assert(std::is_same<decltype(ex::is_base_of_v<T, U>), const bool>::value, "");
- static_assert(ex::is_base_of_v<T, U> == std::is_base_of<T, U>::value, "");
- }
- {
- typedef int T;
- typedef int U;
- static_assert(!ex::is_base_of_v<T, U>, "");
- static_assert(ex::is_base_of_v<T, U> == std::is_base_of<T, U>::value, "");
- }
- {
- typedef int T;
- typedef long U;
- static_assert(ex::is_convertible_v<T, U>, "");
- static_assert(std::is_same<decltype(ex::is_convertible_v<T, U>), const bool>::value, "");
- static_assert(ex::is_convertible_v<T, U> == std::is_convertible<T, U>::value, "");
- }
- {
- typedef void T;
- typedef int U;
- static_assert(!ex::is_convertible_v<T, U>, "");
- static_assert(ex::is_convertible_v<T, U> == std::is_convertible<T, U>::value, "");
- }
-}
-
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp
deleted file mode 100644
index a4a91c136927..000000000000
--- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-#include <experimental/type_traits>
-
-namespace ex = std::experimental;
-
-struct class_type {};
-enum enum_type {};
-union union_type {};
-
-int main()
-{
- {
- typedef void T;
- static_assert(ex::is_void_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_void_v<T>), const bool>::value, "");
- static_assert(ex::is_void_v<T> == std::is_void<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_void_v<T>, "");
- static_assert(ex::is_void_v<T> == std::is_void<T>::value, "");
- }
- {
- typedef decltype(nullptr) T;
- static_assert(ex::is_null_pointer_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_null_pointer_v<T>), const bool>::value, "");
- static_assert(ex::is_null_pointer_v<T> == std::is_null_pointer<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_null_pointer_v<T>, "");
- static_assert(ex::is_null_pointer_v<T> == std::is_null_pointer<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_integral_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_integral_v<T>), const bool>::value, "");
- static_assert(ex::is_integral_v<T> == std::is_integral<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_integral_v<T>, "");
- static_assert(ex::is_integral_v<T> == std::is_integral<T>::value, "");
- }
- {
- typedef float T;
- static_assert(ex::is_floating_point_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_floating_point_v<T>), const bool>::value, "");
- static_assert(ex::is_floating_point_v<T> == std::is_floating_point<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_floating_point_v<T>, "");
- static_assert(ex::is_floating_point_v<T> == std::is_floating_point<T>::value, "");
- }
- {
- typedef int(T)[42];
- static_assert(ex::is_array_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_array_v<T>), const bool>::value, "");
- static_assert(ex::is_array_v<T> == std::is_array<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_array_v<T>, "");
- static_assert(ex::is_array_v<T> == std::is_array<T>::value, "");
- }
- {
- typedef void* T;
- static_assert(ex::is_pointer_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_pointer_v<T>), const bool>::value, "");
- static_assert(ex::is_pointer_v<T> == std::is_pointer<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_pointer_v<T>, "");
- static_assert(ex::is_pointer_v<T> == std::is_pointer<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(ex::is_lvalue_reference_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_lvalue_reference_v<T>), const bool>::value, "");
- static_assert(ex::is_lvalue_reference_v<T> == std::is_lvalue_reference<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_lvalue_reference_v<T>, "");
- static_assert(ex::is_lvalue_reference_v<T> == std::is_lvalue_reference<T>::value, "");
- }
- {
- typedef int && T;
- static_assert(ex::is_rvalue_reference_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_rvalue_reference_v<T>), const bool>::value, "");
- static_assert(ex::is_rvalue_reference_v<T> == std::is_rvalue_reference<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_rvalue_reference_v<T>, "");
- static_assert(ex::is_rvalue_reference_v<T> == std::is_rvalue_reference<T>::value, "");
- }
- {
- typedef int class_type::*T;
- static_assert(ex::is_member_object_pointer_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_member_object_pointer_v<T>), const bool>::value, "");
- static_assert(ex::is_member_object_pointer_v<T> == std::is_member_object_pointer<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_member_object_pointer_v<T>, "");
- static_assert(ex::is_member_object_pointer_v<T> == std::is_member_object_pointer<T>::value, "");
- }
- {
- typedef void(class_type::*T)();
- static_assert(ex::is_member_function_pointer_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_member_function_pointer_v<T>), const bool>::value, "");
- static_assert(ex::is_member_function_pointer_v<T> == std::is_member_function_pointer<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_member_function_pointer_v<T>, "");
- static_assert(ex::is_member_function_pointer_v<T> == std::is_member_function_pointer<T>::value, "");
- }
- {
- typedef enum_type T;
- static_assert(ex::is_enum_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_enum_v<T>), const bool>::value, "");
- static_assert(ex::is_enum_v<T> == std::is_enum<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_enum_v<T>, "");
- static_assert(ex::is_enum_v<T> == std::is_enum<T>::value, "");
- }
- {
- typedef union_type T;
- static_assert(ex::is_union_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_union_v<T>), const bool>::value, "");
- static_assert(ex::is_union_v<T> == std::is_union<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_union_v<T>, "");
- static_assert(ex::is_union_v<T> == std::is_union<T>::value, "");
- }
- {
- typedef class_type T;
- static_assert(ex::is_class_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_class_v<T>), const bool>::value, "");
- static_assert(ex::is_class_v<T> == std::is_class<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_class_v<T>, "");
- static_assert(ex::is_class_v<T> == std::is_class<T>::value, "");
- }
- {
- typedef void(T)();
- static_assert(ex::is_function_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_function_v<T>), const bool>::value, "");
- static_assert(ex::is_function_v<T> == std::is_function<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_function_v<T>, "");
- static_assert(ex::is_function_v<T> == std::is_function<T>::value, "");
- }
-}
-
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp
deleted file mode 100644
index b3927b120951..000000000000
--- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-#include <experimental/type_traits>
-
-namespace ex = std::experimental;
-
-struct class_type {};
-
-int main()
-{
- {
- typedef int & T;
- static_assert(ex::is_reference_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_reference_v<T>), const bool>::value, "");
- static_assert(ex::is_reference_v<T> == std::is_reference<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_reference_v<T>, "");
- static_assert(ex::is_reference_v<T> == std::is_reference<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_arithmetic_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_arithmetic_v<T>), const bool>::value, "");
- static_assert(ex::is_arithmetic_v<T> == std::is_arithmetic<T>::value, "");
- }
- {
- typedef void* T;
- static_assert(!ex::is_arithmetic_v<T>, "");
- static_assert(ex::is_arithmetic_v<T> == std::is_arithmetic<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_fundamental_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_fundamental_v<T>), const bool>::value, "");
- static_assert(ex::is_fundamental_v<T> == std::is_fundamental<T>::value, "");
- }
- {
- typedef class_type T;
- static_assert(!ex::is_fundamental_v<T>, "");
- static_assert(ex::is_fundamental_v<T> == std::is_fundamental<T>::value, "");
- }
- {
- typedef class_type T;
- static_assert(ex::is_object_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_object_v<T>), const bool>::value, "");
- static_assert(ex::is_object_v<T> == std::is_object<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_object_v<T>, "");
- static_assert(ex::is_object_v<T> == std::is_object<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_scalar_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_scalar_v<T>), const bool>::value, "");
- static_assert(ex::is_scalar_v<T> == std::is_scalar<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_scalar_v<T>, "");
- static_assert(ex::is_scalar_v<T> == std::is_scalar<T>::value, "");
- }
- {
- typedef void* T;
- static_assert(ex::is_compound_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_compound_v<T>), const bool>::value, "");
- static_assert(ex::is_compound_v<T> == std::is_compound<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_compound_v<T>, "");
- static_assert(ex::is_compound_v<T> == std::is_compound<T>::value, "");
- }
- {
- typedef int class_type::*T;
- static_assert(ex::is_member_pointer_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_member_pointer_v<T>), const bool>::value, "");
- static_assert(ex::is_member_pointer_v<T> == std::is_member_pointer<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_member_pointer_v<T>, "");
- static_assert(ex::is_member_pointer_v<T> == std::is_member_pointer<T>::value, "");
- }
-}
-
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp
deleted file mode 100644
index bfd385a1b8e3..000000000000
--- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp
+++ /dev/null
@@ -1,492 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// GCC returns true for __is_trivially_constructible(void, int)
-// See gcc.gnu.org/PR80682
-// NOTE: This has been fixed in trunk and will be backported soon.
-// XFAIL: gcc-7, gcc-6, gcc-5, gcc-4
-
-// <experimental/type_traits>
-
-#include <experimental/type_traits>
-
-namespace ex = std::experimental;
-
-struct non_literal_type { non_literal_type() {} };
-struct empty_type {};
-
-struct polymorphic_type
-{
- virtual void foo() {}
-};
-
-struct abstract_type
-{
- virtual void foo() = 0;
-};
-
-struct final_type final {};
-
-struct virtual_dtor_type
-{
- virtual ~virtual_dtor_type() {}
-};
-
-void type_properties_test()
-{
- {
- typedef const int T;
- static_assert(ex::is_const_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_const_v<T>), const bool>::value, "");
- static_assert(ex::is_const_v<T> == std::is_const<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_const_v<T>, "");
- static_assert(ex::is_const_v<T> == std::is_const<T>::value, "");
- }
- {
- typedef volatile int T;
- static_assert(ex::is_volatile_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_volatile_v<T>), const bool>::value, "");
- static_assert(ex::is_volatile_v<T> == std::is_volatile<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_volatile_v<T>, "");
- static_assert(ex::is_volatile_v<T> == std::is_volatile<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivial_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivial_v<T>), const bool>::value, "");
- static_assert(ex::is_trivial_v<T> == std::is_trivial<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_trivial_v<T>, "");
- static_assert(ex::is_trivial_v<T> == std::is_trivial<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_copyable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_copyable_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_copyable_v<T> == std::is_trivially_copyable<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_trivially_copyable_v<T>, "");
- static_assert(ex::is_trivially_copyable_v<T> == std::is_trivially_copyable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_standard_layout_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_standard_layout_v<T>), const bool>::value, "");
- static_assert(ex::is_standard_layout_v<T> == std::is_standard_layout<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_standard_layout_v<T>, "");
- static_assert(ex::is_standard_layout_v<T> == std::is_standard_layout<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_pod_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_pod_v<T>), const bool>::value, "");
- static_assert(ex::is_pod_v<T> == std::is_pod<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_pod_v<T>, "");
- static_assert(ex::is_pod_v<T> == std::is_pod<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_literal_type_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_literal_type_v<T>), const bool>::value, "");
- static_assert(ex::is_literal_type_v<T> == std::is_literal_type<T>::value, "");
- }
- {
- typedef non_literal_type T;
- static_assert(!ex::is_literal_type_v<T>, "");
- static_assert(ex::is_literal_type_v<T> == std::is_literal_type<T>::value, "");
- }
- {
- typedef empty_type T;
- static_assert(ex::is_empty_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_empty_v<T>), const bool>::value, "");
- static_assert(ex::is_empty_v<T> == std::is_empty<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_empty_v<T>, "");
- static_assert(ex::is_empty_v<T> == std::is_empty<T>::value, "");
- }
- {
- typedef polymorphic_type T;
- static_assert(ex::is_polymorphic_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_polymorphic_v<T>), const bool>::value, "");
- static_assert(ex::is_polymorphic_v<T> == std::is_polymorphic<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_polymorphic_v<T>, "");
- static_assert(ex::is_polymorphic_v<T> == std::is_polymorphic<T>::value, "");
- }
- {
- typedef abstract_type T;
- static_assert(ex::is_abstract_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_abstract_v<T>), const bool>::value, "");
- static_assert(ex::is_abstract_v<T> == std::is_abstract<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_abstract_v<T>, "");
- static_assert(ex::is_abstract_v<T> == std::is_abstract<T>::value, "");
- }
- {
- typedef final_type T;
- static_assert(ex::is_final_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_final_v<T>), const bool>::value, "");
- static_assert(ex::is_final_v<T> == std::is_final<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_final_v<T>, "");
- static_assert(ex::is_final_v<T> == std::is_final<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_signed_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_signed_v<T>), const bool>::value, "");
- static_assert(ex::is_signed_v<T> == std::is_signed<T>::value, "");
- }
- {
- typedef unsigned T;
- static_assert(!ex::is_signed_v<T>, "");
- static_assert(ex::is_signed_v<T> == std::is_signed<T>::value, "");
- }
- {
- typedef unsigned T;
- static_assert(ex::is_unsigned_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_unsigned_v<T>), const bool>::value, "");
- static_assert(ex::is_unsigned_v<T> == std::is_unsigned<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::is_unsigned_v<T>, "");
- static_assert(ex::is_unsigned_v<T> == std::is_unsigned<T>::value, "");
- }
-}
-
-void is_constructible_and_assignable_test()
-{
- {
- typedef int T;
- static_assert(ex::is_constructible_v<T, int>, "");
- static_assert(std::is_same<decltype(ex::is_constructible_v<T, int>), const bool>::value, "");
- static_assert(ex::is_constructible_v<T, int> == std::is_constructible<T, int>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_constructible_v<T, int>, "");
- static_assert(ex::is_constructible_v<T, int> == std::is_constructible<T, int>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_default_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_default_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_default_constructible_v<T> == std::is_default_constructible<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_default_constructible_v<T>, "");
- static_assert(ex::is_default_constructible_v<T> == std::is_default_constructible<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_copy_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_copy_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_copy_constructible_v<T> == std::is_copy_constructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_copy_constructible_v<T>, "");
- static_assert(ex::is_copy_constructible_v<T> == std::is_copy_constructible<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_move_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_move_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_move_constructible_v<T> == std::is_move_constructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_move_constructible_v<T>, "");
- static_assert(ex::is_move_constructible_v<T> == std::is_move_constructible<T>::value, "");
- }
- {
- typedef int & T;
- typedef int U;
- static_assert(ex::is_assignable_v<T, U>, "");
- static_assert(std::is_same<decltype(ex::is_assignable_v<T, U>), const bool>::value, "");
- static_assert(ex::is_assignable_v<T, U> == std::is_assignable<T, U>::value, "");
- }
- {
- typedef int & T;
- typedef void U;
- static_assert(!ex::is_assignable_v<T, U>, "");
- static_assert(ex::is_assignable_v<T, U> == std::is_assignable<T, U>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_copy_assignable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_copy_assignable_v<T>), const bool>::value, "");
- static_assert(ex::is_copy_assignable_v<T> == std::is_copy_assignable<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_copy_assignable_v<T>, "");
- static_assert(ex::is_copy_assignable_v<T> == std::is_copy_assignable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_move_assignable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_move_assignable_v<T>), const bool>::value, "");
- static_assert(ex::is_move_assignable_v<T> == std::is_move_assignable<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_move_assignable_v<T>, "");
- static_assert(ex::is_move_assignable_v<T> == std::is_move_assignable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_destructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_destructible_v<T>), const bool>::value, "");
- static_assert(ex::is_destructible_v<T> == std::is_destructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_destructible_v<T>, "");
- static_assert(ex::is_destructible_v<T> == std::is_destructible<T>::value, "");
- }
-}
-
-void is_trivially_constructible_and_assignable_test()
-{
- {
- typedef int T;
- static_assert(ex::is_trivially_constructible_v<T, int>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_constructible_v<T, int>), const bool>::value, "");
- static_assert(ex::is_trivially_constructible_v<T, int> == std::is_constructible<T, int>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_trivially_constructible_v<T, int>, "");
- static_assert(ex::is_trivially_constructible_v<T, int> == std::is_constructible<T, int>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_default_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_default_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_default_constructible_v<T> == std::is_default_constructible<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_trivially_default_constructible_v<T>, "");
- static_assert(ex::is_trivially_default_constructible_v<T> == std::is_default_constructible<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_copy_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_copy_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_copy_constructible_v<T> == std::is_copy_constructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_trivially_copy_constructible_v<T>, "");
- static_assert(ex::is_trivially_copy_constructible_v<T> == std::is_copy_constructible<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_move_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_move_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_move_constructible_v<T> == std::is_move_constructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_trivially_move_constructible_v<T>, "");
- static_assert(ex::is_trivially_move_constructible_v<T> == std::is_move_constructible<T>::value, "");
- }
- {
- typedef int & T;
- typedef int U;
- static_assert(ex::is_trivially_assignable_v<T, U>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_assignable_v<T, U>), const bool>::value, "");
- static_assert(ex::is_trivially_assignable_v<T, U> == std::is_assignable<T, U>::value, "");
- }
- {
- typedef int & T;
- typedef void U;
- static_assert(!ex::is_trivially_assignable_v<T, U>, "");
- static_assert(ex::is_trivially_assignable_v<T, U> == std::is_assignable<T, U>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_copy_assignable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_copy_assignable_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_copy_assignable_v<T> == std::is_copy_assignable<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_trivially_copy_assignable_v<T>, "");
- static_assert(ex::is_trivially_copy_assignable_v<T> == std::is_copy_assignable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_move_assignable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_move_assignable_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_move_assignable_v<T> == std::is_move_assignable<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_trivially_move_assignable_v<T>, "");
- static_assert(ex::is_trivially_move_assignable_v<T> == std::is_move_assignable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_trivially_destructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_trivially_destructible_v<T>), const bool>::value, "");
- static_assert(ex::is_trivially_destructible_v<T> == std::is_destructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_trivially_destructible_v<T>, "");
- static_assert(ex::is_trivially_destructible_v<T> == std::is_destructible<T>::value, "");
- }
-}
-
-
-
-void is_nothrow_constructible_and_assignable_test()
-{
- {
- typedef int T;
- static_assert(ex::is_nothrow_constructible_v<T, int>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_constructible_v<T, int>), const bool>::value, "");
- static_assert(ex::is_nothrow_constructible_v<T, int> == std::is_constructible<T, int>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_nothrow_constructible_v<T, int>, "");
- static_assert(ex::is_nothrow_constructible_v<T, int> == std::is_constructible<T, int>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_nothrow_default_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_default_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_nothrow_default_constructible_v<T> == std::is_default_constructible<T>::value, "");
- }
- {
- typedef int & T;
- static_assert(!ex::is_nothrow_default_constructible_v<T>, "");
- static_assert(ex::is_nothrow_default_constructible_v<T> == std::is_default_constructible<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_nothrow_copy_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_copy_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_nothrow_copy_constructible_v<T> == std::is_copy_constructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_nothrow_copy_constructible_v<T>, "");
- static_assert(ex::is_nothrow_copy_constructible_v<T> == std::is_copy_constructible<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_nothrow_move_constructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_move_constructible_v<T>), const bool>::value, "");
- static_assert(ex::is_nothrow_move_constructible_v<T> == std::is_move_constructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_nothrow_move_constructible_v<T>, "");
- static_assert(ex::is_nothrow_move_constructible_v<T> == std::is_move_constructible<T>::value, "");
- }
- {
- typedef int & T;
- typedef int U;
- static_assert(ex::is_nothrow_assignable_v<T, U>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_assignable_v<T, U>), const bool>::value, "");
- static_assert(ex::is_nothrow_assignable_v<T, U> == std::is_assignable<T, U>::value, "");
- }
- {
- typedef int & T;
- typedef void U;
- static_assert(!ex::is_nothrow_assignable_v<T, U>, "");
- static_assert(ex::is_nothrow_assignable_v<T, U> == std::is_assignable<T, U>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_nothrow_copy_assignable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_copy_assignable_v<T>), const bool>::value, "");
- static_assert(ex::is_nothrow_copy_assignable_v<T> == std::is_copy_assignable<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_nothrow_copy_assignable_v<T>, "");
- static_assert(ex::is_nothrow_copy_assignable_v<T> == std::is_copy_assignable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_nothrow_move_assignable_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_move_assignable_v<T>), const bool>::value, "");
- static_assert(ex::is_nothrow_move_assignable_v<T> == std::is_move_assignable<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_nothrow_move_assignable_v<T>, "");
- static_assert(ex::is_nothrow_move_assignable_v<T> == std::is_move_assignable<T>::value, "");
- }
- {
- typedef int T;
- static_assert(ex::is_nothrow_destructible_v<T>, "");
- static_assert(std::is_same<decltype(ex::is_nothrow_destructible_v<T>), const bool>::value, "");
- static_assert(ex::is_nothrow_destructible_v<T> == std::is_destructible<T>::value, "");
- }
- {
- typedef void T;
- static_assert(!ex::is_nothrow_destructible_v<T>, "");
- static_assert(ex::is_nothrow_destructible_v<T> == std::is_destructible<T>::value, "");
- }
-}
-
-int main()
-{
- type_properties_test();
- is_constructible_and_assignable_test();
- is_trivially_constructible_and_assignable_test();
- is_nothrow_constructible_and_assignable_test();
- {
- typedef virtual_dtor_type T;
- static_assert(ex::has_virtual_destructor_v<T>, "");
- static_assert(std::is_same<decltype(ex::has_virtual_destructor_v<T>), const bool>::value, "");
- static_assert(ex::has_virtual_destructor_v<T> == std::has_virtual_destructor<T>::value, "");
- }
- {
- typedef int T;
- static_assert(!ex::has_virtual_destructor_v<T>, "");
- static_assert(ex::has_virtual_destructor_v<T> == std::has_virtual_destructor<T>::value, "");
- }
-}
-
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp
deleted file mode 100644
index f91667da523c..000000000000
--- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
-
-#include <experimental/type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef char T;
- static_assert(ex::alignment_of_v<T> == 1, "");
- static_assert(std::is_same<decltype(ex::alignment_of_v<T>), const std::size_t>::value, "");
- static_assert(ex::alignment_of_v<T> == std::alignment_of<T>::value, "");
- }
- {
- typedef char(T)[1][1][1];
- static_assert(ex::rank_v<T> == 3, "");
- static_assert(std::is_same<decltype(ex::rank_v<T>), const std::size_t>::value, "");
- static_assert(ex::rank_v<T> == std::rank<T>::value, "");
- }
- {
- typedef void T;
- static_assert(ex::rank_v<T> == 0, "");
- static_assert(ex::rank_v<T> == std::rank<T>::value, "");
- }
- {
- typedef char(T)[2][3][4];
- static_assert(ex::extent_v<T> == 2, "");
- static_assert(std::is_same<decltype(ex::extent_v<T>), const std::size_t>::value, "");
- static_assert(ex::extent_v<T> == std::extent<T>::value, "");
- }
- {
- typedef char(T)[2][3][4];
- static_assert(ex::extent_v<T, 0> == 2, "");
- static_assert(ex::extent_v<T, 0> == std::extent<T, 0>::value, "");
- }
- {
- typedef char(T)[2][3][4];
- static_assert(ex::extent_v<T, 1> == 3, "");
- static_assert(ex::extent_v<T, 1> == std::extent<T, 1>::value, "");
- }
- {
- typedef char(T)[2][3][4];
- static_assert(ex::extent_v<T, 5> == 0, "");
- static_assert(ex::extent_v<T, 5> == std::extent<T, 5>::value, "");
- }
- {
- typedef void T;
- static_assert(ex::extent_v<T, 0> == 0, "");
- static_assert(ex::extent_v<T, 0> == std::extent<T, 0>::value, "");
- }
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
deleted file mode 100644
index 485da33cdec7..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// Test that <ratio> is included.
-
-#include <experimental/ratio>
-
-int main()
-{
- std::ratio<100> x;
- ((void)x);
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp
deleted file mode 100644
index 641e6ae22cc8..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// template <class R1, class R2> constexpr bool ratio_equal_v;
-
-#include <experimental/ratio>
-#include <type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_equal_v<R1, R2> == std::ratio_equal<R1, R2>::value, ""
- );
- static_assert(
- std::is_same<decltype(ex::ratio_equal_v<R1, R2>), const bool>::value
- , ""
- );
- }
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, -1> R2;
- static_assert(
- !ex::ratio_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_equal_v<R1, R2> == std::ratio_equal<R1, R2>::value, ""
- );
- }
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp
deleted file mode 100644
index 3896d0ac64dc..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// template <class R1, class R2> constexpr bool ratio_greater_equal_v;
-
-#include <experimental/ratio>
-#include <type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef std::ratio<1, 2> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_greater_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_greater_equal_v<R1, R2>
- == std::ratio_greater_equal<R1, R2>::value, ""
- );
- static_assert(
- std::is_same<
- decltype(ex::ratio_greater_equal_v<R1, R2>), const bool>::value
- , ""
- );
- }
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_greater_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_greater_equal_v<R1, R2>
- == std::ratio_greater_equal<R1, R2>::value, ""
- );
- }
- {
- typedef std::ratio<2, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_greater_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_greater_equal_v<R1, R2>
- == std::ratio_greater_equal<R1, R2>::value, ""
- );
- }
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp
deleted file mode 100644
index bdc54515f629..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// template <class R1, class R2> constexpr bool ratio_greater_v;
-
-#include <experimental/ratio>
-#include <type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef std::ratio<1, 2> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_greater_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_greater_v<R1, R2> == std::ratio_greater<R1, R2>::value, ""
- );
- static_assert(
- std::is_same<decltype(ex::ratio_greater_v<R1, R2>), const bool>::value
- , ""
- );
- }
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_greater_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_greater_v<R1, R2> == std::ratio_greater<R1, R2>::value, ""
- );
- }
- {
- typedef std::ratio<2, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_greater_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_greater_v<R1, R2> == std::ratio_greater<R1, R2>::value, ""
- );
- }
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp
deleted file mode 100644
index 50f213b01339..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// template <class R1, class R2> constexpr bool ratio_less_equal_v;
-
-#include <experimental/ratio>
-#include <type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef std::ratio<1, 2> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_less_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_less_equal_v<R1, R2> == std::ratio_less_equal<R1, R2>::value, ""
- );
- static_assert(
- std::is_same<decltype(ex::ratio_less_equal_v<R1, R2>), const bool>::value
- , ""
- );
- }
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_less_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_less_equal_v<R1, R2> == std::ratio_less_equal<R1, R2>::value, ""
- );
- }
- {
- typedef std::ratio<2, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_less_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_less_equal_v<R1, R2> == std::ratio_less_equal<R1, R2>::value, ""
- );
- }
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp
deleted file mode 100644
index 7a6d7738bd9d..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// template <class R1, class R2> constexpr bool ratio_less_v;
-
-#include <experimental/ratio>
-#include <type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef std::ratio<1, 2> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- ex::ratio_less_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_less_v<R1, R2> == std::ratio_less<R1, R2>::value, ""
- );
- static_assert(
- std::is_same<decltype(ex::ratio_less_v<R1, R2>), const bool>::value
- , ""
- );
- }
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_less_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_less_v<R1, R2> == std::ratio_less<R1, R2>::value, ""
- );
- }
- {
- typedef std::ratio<2, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_less_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_less_v<R1, R2> == std::ratio_less<R1, R2>::value, ""
- );
- }
-}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp
deleted file mode 100644
index b5296ff24ef1..000000000000
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/ratio>
-
-// template <class R1, class R2> constexpr bool ratio_not_equal_v;
-
-#include <experimental/ratio>
-#include <type_traits>
-
-namespace ex = std::experimental;
-
-int main()
-{
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, -1> R2;
- static_assert(
- ex::ratio_not_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_not_equal_v<R1, R2> == std::ratio_not_equal<R1, R2>::value, ""
- );
- static_assert(
- std::is_same<decltype(ex::ratio_not_equal_v<R1, R2>), const bool>::value
- , ""
- );
- }
- {
- typedef std::ratio<1, 1> R1;
- typedef std::ratio<1, 1> R2;
- static_assert(
- !ex::ratio_not_equal_v<R1, R2>, ""
- );
- static_assert(
- ex::ratio_not_equal_v<R1, R2> == std::ratio_not_equal<R1, R2>::value, ""
- );
- }
-}
diff --git a/test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp b/test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp
deleted file mode 100644
index de813925f218..000000000000
--- a/test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/system_error>
-
-#include <experimental/system_error>
-
-int main()
-{
- // Check that <system_error> has been included
- std::error_code ec;
- ((void)ec);
-}
diff --git a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp b/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp
deleted file mode 100644
index f944123ebc06..000000000000
--- a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/system_error>
-
-// template <class T> constexpr bool is_error_code_enum_v;
-
-#include <experimental/system_error>
-#include <ios> /* for std::io_errc */
-
-namespace ex = std::experimental;
-
-int main() {
- {
- static_assert(ex::is_error_code_enum_v<std::io_errc>, "");
-
- static_assert(ex::is_error_code_enum_v<std::io_errc> ==
- std::is_error_code_enum <std::io_errc>::value, "");
-
- static_assert(std::is_same<decltype(ex::is_error_code_enum_v<std::io_errc>),
- const bool>::value, "");
- }
- {
- static_assert(!ex::is_error_code_enum_v<int>, "");
-
- static_assert(ex::is_error_code_enum_v<int> ==
- std::is_error_code_enum <int>::value, "");
- }
-}
diff --git a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp b/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp
deleted file mode 100644
index ee8dc57aa9db..000000000000
--- a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/system_error>
-
-// template <class T> constexpr bool is_error_condition_enum_v;
-
-#include <experimental/system_error>
-#include <type_traits>
-namespace ex = std::experimental;
-
-int main() {
- {
- static_assert(ex::is_error_condition_enum_v<std::errc>, "");
-
- static_assert(ex::is_error_condition_enum_v<std::errc> ==
- std::is_error_condition_enum <std::errc>::value, "");
-
- static_assert(
- std::is_same<decltype(ex::is_error_condition_enum_v<std::errc>),
- const bool>::value,
- "");
- }
- {
- static_assert(!ex::is_error_condition_enum_v<int>, "");
-
- static_assert(ex::is_error_condition_enum_v<int> ==
- std::is_error_condition_enum <int>::value, "");
- }
-}
diff --git a/test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp b/test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp
deleted file mode 100644
index f6ad37f9ee3e..000000000000
--- a/test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/chrono>
-
-#include <experimental/chrono>
-
-int main()
-{
- // Check that <chrono> has been included.
- std::chrono::seconds s;
- ((void)s);
-}
diff --git a/test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp b/test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp
deleted file mode 100644
index 9ac9a2ed1c83..000000000000
--- a/test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/chrono>
-
-// template <class Rep> constexpr bool treat_as_floating_point_v;
-
-#include <experimental/chrono>
-#include <type_traits>
-
-namespace ex = std::chrono::experimental;
-namespace cr = std::chrono;
-
-template <class T, bool Expect>
-void test()
-{
- static_assert(
- ex::treat_as_floating_point_v<T> == Expect, ""
- );
- static_assert(
- ex::treat_as_floating_point_v<T> == cr::treat_as_floating_point<T>::value, ""
- );
-}
-
-int main()
-{
- {
- static_assert(
- std::is_same<
- decltype(ex::treat_as_floating_point_v<float>), const bool
- >::value, ""
- );
- }
- test<int, false>();
- test<unsigned, false>();
- test<char, false>();
- test<bool, false>();
- test<float, true>();
- test<double, true>();
- test<long double, true>();
-}
diff --git a/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp b/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
deleted file mode 100644
index 5cfb15e3df29..000000000000
--- a/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-#include <experimental/tuple>
-
-int main()
-{
- std::tuple<int> x(1);
- (void)x;
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp
deleted file mode 100644
index cb44707fa7e7..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Test with different ref/ptr/cv qualified argument types.
-
-#include <experimental/tuple>
-#include <array>
-#include <utility>
-#include <cassert>
-
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-
-namespace ex = std::experimental;
-
-int call_with_value(int x, int y) { return (x + y); }
-int call_with_ref(int & x, int & y) { return (x + y); }
-int call_with_const_ref(int const & x, int const & y) { return (x + y); }
-int call_with_rvalue_ref(int && x, int && y) { return (x + y); }
-int call_with_pointer(int * x, int * y) { return (*x + *y); }
-int call_with_const_pointer(int const* x, int const * y) { return (*x + *y); }
-
-
-template <class Tuple>
-void test_values()
-{
- {
- Tuple t{1, 2};
- assert(3 == ex::apply(call_with_value, t));
- }
- {
- Tuple t{2, 2};
- assert(4 == ex::apply(call_with_ref, t));
- }
- {
- Tuple t{2, 3};
- assert(5 == ex::apply(call_with_const_ref, t));
- }
- {
- Tuple t{3, 3};
- assert(6 == ex::apply(call_with_rvalue_ref, static_cast<Tuple &&>(t)));
- }
- {
- Tuple const t{4, 4};
- assert(8 == ex::apply(call_with_value, t));
- }
- {
- Tuple const t{4, 5};
- assert(9 == ex::apply(call_with_const_ref, t));
- }
-}
-
-template <class Tuple>
-void test_refs()
-{
- int x = 0;
- int y = 0;
- {
- x = 1; y = 2;
- Tuple t{x, y};
- assert(3 == ex::apply(call_with_value, t));
- }
- {
- x = 2; y = 2;
- Tuple t{x, y};
- assert(4 == ex::apply(call_with_ref, t));
- }
- {
- x = 2; y = 3;
- Tuple t{x, y};
- assert(5 == ex::apply(call_with_const_ref, t));
- }
- {
- x = 3; y = 3;
- Tuple const t{x, y};
- assert(6 == ex::apply(call_with_value, t));
- }
- {
- x = 3; y = 4;
- Tuple const t{x, y};
- assert(7 == ex::apply(call_with_const_ref, t));
- }
-}
-
-template <class Tuple>
-void test_const_refs()
-{
- int x = 0;
- int y = 0;
- {
- x = 1; y = 2;
- Tuple t{x, y};
- assert(3 == ex::apply(call_with_value, t));
- }
- {
- x = 2; y = 3;
- Tuple t{x, y};
- assert(5 == ex::apply(call_with_const_ref, t));
- }
- {
- x = 3; y = 3;
- Tuple const t{x, y};
- assert(6 == ex::apply(call_with_value, t));
- }
- {
- x = 3; y = 4;
- Tuple const t{x, y};
- assert(7 == ex::apply(call_with_const_ref, t));
- }
-}
-
-
-template <class Tuple>
-void test_pointer()
-{
- int x = 0;
- int y = 0;
- {
- x = 2; y = 2;
- Tuple t{&x, &y};
- assert(4 == ex::apply(call_with_pointer, t));
- }
- {
- x = 2; y = 3;
- Tuple t{&x, &y};
- assert(5 == ex::apply(call_with_const_pointer, t));
- }
- {
- x = 3; y = 4;
- Tuple const t{&x, &y};
- assert(7 == ex::apply(call_with_const_pointer, t));
- }
-}
-
-
-template <class Tuple>
-void test_const_pointer()
-{
- int x = 0;
- int y = 0;
- {
- x = 2; y = 3;
- Tuple t{&x, &y};
- assert(5 == ex::apply(call_with_const_pointer, t));
- }
- {
- x = 3; y = 4;
- Tuple const t{&x, &y};
- assert(7 == ex::apply(call_with_const_pointer, t));
- }
-}
-
-
-int main()
-{
- test_values<std::tuple<int, int>>();
- test_values<std::pair<int, int>>();
- test_values<std::array<int, 2>>();
-
- test_refs<std::tuple<int &, int &>>();
- test_refs<std::pair<int &, int &>>();
-
- test_const_refs<std::tuple<int const &, int const &>>();
- test_const_refs<std::pair<int const &, int const &>>();
-
- test_pointer<std::tuple<int *, int *>>();
- test_pointer<std::pair<int *, int *>>();
- test_pointer<std::array<int *, 2>>();
-
- test_const_pointer<std::tuple<int const *, int const *>>();
- test_const_pointer<std::pair<int const *, int const *>>();
- test_const_pointer<std::array<int const *, 2>>();
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp
deleted file mode 100644
index 5b8a8f09d1ee..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Testing constexpr evaluation
-
-#include <experimental/tuple>
-#include <utility>
-#include <cassert>
-
-constexpr int f_int_0() { return 1; }
-constexpr int f_int_1(int x) { return x; }
-constexpr int f_int_2(int x, int y) { return (x + y); }
-
-struct A_int_0
-{
- constexpr A_int_0() {}
- constexpr int operator()() const { return 1; }
-};
-
-struct A_int_1
-{
- constexpr A_int_1() {}
- constexpr int operator()(int x) const { return x; }
-};
-
-struct A_int_2
-{
- constexpr A_int_2() {}
- constexpr int operator()(int x, int y) const { return (x + y); }
-};
-
-namespace ex = std::experimental;
-
-template <class Tuple>
-void test_0()
-{
- // function
- {
- constexpr Tuple t{};
- static_assert(1 == ex::apply(f_int_0, t), "");
- }
- // function pointer
- {
- constexpr Tuple t{};
- constexpr auto fp = &f_int_0;
- static_assert(1 == ex::apply(fp, t), "");
- }
- // functor
- {
- constexpr Tuple t{};
- constexpr A_int_0 a;
- static_assert(1 == ex::apply(a, t), "");
- }
-}
-
-template <class Tuple>
-void test_1()
-{
- // function
- {
- constexpr Tuple t{1};
- static_assert(1 == ex::apply(f_int_1, t), "");
- }
- // function pointer
- {
- constexpr Tuple t{2};
- constexpr int (*fp)(int) = f_int_1;
- static_assert(2 == ex::apply(fp, t), "");
- }
- // functor
- {
- constexpr Tuple t{3};
- constexpr A_int_1 fn;
- static_assert(3 == ex::apply(fn, t), "");
- }
-}
-
-template <class Tuple>
-void test_2()
-{
- // function
- {
- constexpr Tuple t{1, 2};
- static_assert(3 == ex::apply(f_int_2, t), "");
- }
- // function pointer
- {
- constexpr Tuple t{2, 3};
- constexpr auto fp = &f_int_2;
- static_assert(5 == ex::apply(fp, t), "");
- }
- // functor
- {
- constexpr Tuple t{3, 4};
- constexpr A_int_2 a;
- static_assert(7 == ex::apply(a, t), "");
- }
-}
-
-int main()
-{
- test_0<std::tuple<>>();
- test_1<std::tuple<int>>();
- test_2<std::tuple<int, int>>();
- test_2<std::pair<int, int>>();
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp
deleted file mode 100644
index 57dff44976bc..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Testing extended function types. The extended function types are those
-// named by INVOKE but that are not actual callable objects. These include
-// bullets 1-4 of invoke.
-
-#include <experimental/tuple>
-#include <array>
-#include <utility>
-#include <cassert>
-
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-int count = 0;
-
-struct A_int_0
-{
- A_int_0() : obj1(0){}
- A_int_0(int x) : obj1(x) {}
- int mem1() { return ++count; }
- int mem2() const { return ++count; }
- int const obj1;
-};
-
-struct A_int_1
-{
- A_int_1() {}
- A_int_1(int) {}
- int mem1(int x) { return count += x; }
- int mem2(int x) const { return count += x; }
-};
-
-struct A_int_2
-{
- A_int_2() {}
- A_int_2(int) {}
- int mem1(int x, int y) { return count += (x + y); }
- int mem2(int x, int y) const { return count += (x + y); }
-};
-
-template <class A>
-struct A_wrap
-{
- A_wrap() {}
- A_wrap(int x) : m_a(x) {}
- A & operator*() { return m_a; }
- A const & operator*() const { return m_a; }
- A m_a;
-};
-
-typedef A_wrap<A_int_0> A_wrap_0;
-typedef A_wrap<A_int_1> A_wrap_1;
-typedef A_wrap<A_int_2> A_wrap_2;
-
-
-template <class A>
-struct A_base : public A
-{
- A_base() : A() {}
- A_base(int x) : A(x) {}
-};
-
-typedef A_base<A_int_0> A_base_0;
-typedef A_base<A_int_1> A_base_1;
-typedef A_base<A_int_2> A_base_2;
-
-namespace ex = std::experimental;
-
-template <
- class Tuple, class ConstTuple
- , class TuplePtr, class ConstTuplePtr
- , class TupleWrap, class ConstTupleWrap
- , class TupleBase, class ConstTupleBase
- >
-void test_ext_int_0()
-{
- count = 0;
- typedef A_int_0 T;
- typedef A_wrap_0 Wrap;
- typedef A_base_0 Base;
-
- typedef int(T::*mem1_t)();
- mem1_t mem1 = &T::mem1;
-
- typedef int(T::*mem2_t)() const;
- mem2_t mem2 = &T::mem2;
-
- typedef int const T::*obj1_t;
- obj1_t obj1 = &T::obj1;
-
- // member function w/ref
- {
- T a;
- Tuple t{a};
- assert(1 == ex::apply(mem1, t));
- assert(count == 1);
- }
- count = 0;
- // member function w/pointer
- {
- T a;
- TuplePtr t{&a};
- assert(1 == ex::apply(mem1, t));
- assert(count == 1);
- }
- count = 0;
- // member function w/base
- {
- Base a;
- TupleBase t{a};
- assert(1 == ex::apply(mem1, t));
- assert(count == 1);
- }
- count = 0;
- // member function w/wrap
- {
- Wrap a;
- TupleWrap t{a};
- assert(1 == ex::apply(mem1, t));
- assert(count == 1);
- }
- count = 0;
- // const member function w/ref
- {
- T const a;
- ConstTuple t{a};
- assert(1 == ex::apply(mem2, t));
- assert(count == 1);
- }
- count = 0;
- // const member function w/pointer
- {
- T const a;
- ConstTuplePtr t{&a};
- assert(1 == ex::apply(mem2, t));
- assert(count == 1);
- }
- count = 0;
- // const member function w/base
- {
- Base const a;
- ConstTupleBase t{a};
- assert(1 == ex::apply(mem2, t));
- assert(count == 1);
- }
- count = 0;
- // const member function w/wrapper
- {
- Wrap const a;
- ConstTupleWrap t{a};
- assert(1 == ex::apply(mem2, t));
- assert(1 == count);
- }
- // member object w/ref
- {
- T a{42};
- Tuple t{a};
- assert(42 == ex::apply(obj1, t));
- }
- // member object w/pointer
- {
- T a{42};
- TuplePtr t{&a};
- assert(42 == ex::apply(obj1, t));
- }
- // member object w/base
- {
- Base a{42};
- TupleBase t{a};
- assert(42 == ex::apply(obj1, t));
- }
- // member object w/wrapper
- {
- Wrap a{42};
- TupleWrap t{a};
- assert(42 == ex::apply(obj1, t));
- }
-}
-
-
-template <
- class Tuple, class ConstTuple
- , class TuplePtr, class ConstTuplePtr
- , class TupleWrap, class ConstTupleWrap
- , class TupleBase, class ConstTupleBase
- >
-void test_ext_int_1()
-{
- count = 0;
- typedef A_int_1 T;
- typedef A_wrap_1 Wrap;
- typedef A_base_1 Base;
-
- typedef int(T::*mem1_t)(int);
- mem1_t mem1 = &T::mem1;
-
- typedef int(T::*mem2_t)(int) const;
- mem2_t mem2 = &T::mem2;
-
- // member function w/ref
- {
- T a;
- Tuple t{a, 2};
- assert(2 == ex::apply(mem1, t));
- assert(count == 2);
- }
- count = 0;
- // member function w/pointer
- {
- T a;
- TuplePtr t{&a, 3};
- assert(3 == ex::apply(mem1, t));
- assert(count == 3);
- }
- count = 0;
- // member function w/base
- {
- Base a;
- TupleBase t{a, 4};
- assert(4 == ex::apply(mem1, t));
- assert(count == 4);
- }
- count = 0;
- // member function w/wrap
- {
- Wrap a;
- TupleWrap t{a, 5};
- assert(5 == ex::apply(mem1, t));
- assert(count == 5);
- }
- count = 0;
- // const member function w/ref
- {
- T const a;
- ConstTuple t{a, 6};
- assert(6 == ex::apply(mem2, t));
- assert(count == 6);
- }
- count = 0;
- // const member function w/pointer
- {
- T const a;
- ConstTuplePtr t{&a, 7};
- assert(7 == ex::apply(mem2, t));
- assert(count == 7);
- }
- count = 0;
- // const member function w/base
- {
- Base const a;
- ConstTupleBase t{a, 8};
- assert(8 == ex::apply(mem2, t));
- assert(count == 8);
- }
- count = 0;
- // const member function w/wrapper
- {
- Wrap const a;
- ConstTupleWrap t{a, 9};
- assert(9 == ex::apply(mem2, t));
- assert(9 == count);
- }
-}
-
-
-template <
- class Tuple, class ConstTuple
- , class TuplePtr, class ConstTuplePtr
- , class TupleWrap, class ConstTupleWrap
- , class TupleBase, class ConstTupleBase
- >
-void test_ext_int_2()
-{
- count = 0;
- typedef A_int_2 T;
- typedef A_wrap_2 Wrap;
- typedef A_base_2 Base;
-
- typedef int(T::*mem1_t)(int, int);
- mem1_t mem1 = &T::mem1;
-
- typedef int(T::*mem2_t)(int, int) const;
- mem2_t mem2 = &T::mem2;
-
- // member function w/ref
- {
- T a;
- Tuple t{a, 1, 1};
- assert(2 == ex::apply(mem1, t));
- assert(count == 2);
- }
- count = 0;
- // member function w/pointer
- {
- T a;
- TuplePtr t{&a, 1, 2};
- assert(3 == ex::apply(mem1, t));
- assert(count == 3);
- }
- count = 0;
- // member function w/base
- {
- Base a;
- TupleBase t{a, 2, 2};
- assert(4 == ex::apply(mem1, t));
- assert(count == 4);
- }
- count = 0;
- // member function w/wrap
- {
- Wrap a;
- TupleWrap t{a, 2, 3};
- assert(5 == ex::apply(mem1, t));
- assert(count == 5);
- }
- count = 0;
- // const member function w/ref
- {
- T const a;
- ConstTuple t{a, 3, 3};
- assert(6 == ex::apply(mem2, t));
- assert(count == 6);
- }
- count = 0;
- // const member function w/pointer
- {
- T const a;
- ConstTuplePtr t{&a, 3, 4};
- assert(7 == ex::apply(mem2, t));
- assert(count == 7);
- }
- count = 0;
- // const member function w/base
- {
- Base const a;
- ConstTupleBase t{a, 4, 4};
- assert(8 == ex::apply(mem2, t));
- assert(count == 8);
- }
- count = 0;
- // const member function w/wrapper
- {
- Wrap const a;
- ConstTupleWrap t{a, 4, 5};
- assert(9 == ex::apply(mem2, t));
- assert(9 == count);
- }
-}
-
-int main()
-{
- {
- test_ext_int_0<
- std::tuple<A_int_0 &>, std::tuple<A_int_0 const &>
- , std::tuple<A_int_0 *>, std::tuple<A_int_0 const *>
- , std::tuple<A_wrap_0 &>, std::tuple<A_wrap_0 const &>
- , std::tuple<A_base_0 &>, std::tuple<A_base_0 const &>
- >();
- test_ext_int_0<
- std::tuple<A_int_0>, std::tuple<A_int_0 const>
- , std::tuple<A_int_0 *>, std::tuple<A_int_0 const *>
- , std::tuple<A_wrap_0>, std::tuple<A_wrap_0 const>
- , std::tuple<A_base_0>, std::tuple<A_base_0 const>
- >();
- test_ext_int_0<
- std::array<A_int_0, 1>, std::array<A_int_0 const, 1>
- , std::array<A_int_0*, 1>, std::array<A_int_0 const*, 1>
- , std::array<A_wrap_0, 1>, std::array<A_wrap_0 const, 1>
- , std::array<A_base_0, 1>, std::array<A_base_0 const, 1>
- >();
- }
- {
- test_ext_int_1<
- std::tuple<A_int_1 &, int>, std::tuple<A_int_1 const &, int>
- , std::tuple<A_int_1 *, int>, std::tuple<A_int_1 const *, int>
- , std::tuple<A_wrap_1 &, int>, std::tuple<A_wrap_1 const &, int>
- , std::tuple<A_base_1 &, int>, std::tuple<A_base_1 const &, int>
- >();
- test_ext_int_1<
- std::tuple<A_int_1, int>, std::tuple<A_int_1 const, int>
- , std::tuple<A_int_1 *, int>, std::tuple<A_int_1 const *, int>
- , std::tuple<A_wrap_1, int>, std::tuple<A_wrap_1 const, int>
- , std::tuple<A_base_1, int>, std::tuple<A_base_1 const, int>
- >();
- test_ext_int_1<
- std::pair<A_int_1 &, int>, std::pair<A_int_1 const &, int>
- , std::pair<A_int_1 *, int>, std::pair<A_int_1 const *, int>
- , std::pair<A_wrap_1 &, int>, std::pair<A_wrap_1 const &, int>
- , std::pair<A_base_1 &, int>, std::pair<A_base_1 const &, int>
- >();
- test_ext_int_1<
- std::pair<A_int_1, int>, std::pair<A_int_1 const, int>
- , std::pair<A_int_1 *, int>, std::pair<A_int_1 const *, int>
- , std::pair<A_wrap_1, int>, std::pair<A_wrap_1 const, int>
- , std::pair<A_base_1, int>, std::pair<A_base_1 const, int>
- >();
- }
- {
- test_ext_int_2<
- std::tuple<A_int_2 &, int, int>, std::tuple<A_int_2 const &, int, int>
- , std::tuple<A_int_2 *, int, int>, std::tuple<A_int_2 const *, int, int>
- , std::tuple<A_wrap_2 &, int, int>, std::tuple<A_wrap_2 const &, int, int>
- , std::tuple<A_base_2 &, int, int>, std::tuple<A_base_2 const &, int, int>
- >();
- test_ext_int_2<
- std::tuple<A_int_2, int, int>, std::tuple<A_int_2 const, int, int>
- , std::tuple<A_int_2 *, int, int>, std::tuple<A_int_2 const *, int, int>
- , std::tuple<A_wrap_2, int, int>, std::tuple<A_wrap_2 const, int, int>
- , std::tuple<A_base_2, int, int>, std::tuple<A_base_2 const, int, int>
- >();
- }
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp
deleted file mode 100644
index 027258ad8d1d..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Stress testing large arities with tuple and array.
-
-#include <experimental/tuple>
-#include <array>
-#include <utility>
-#include <cassert>
-
-////////////////////////////////////////////////////////////////////////////////
-template <class T, std::size_t Dummy = 0>
-struct always_imp
-{
- typedef T type;
-};
-
-template <class T, std::size_t Dummy = 0>
-using always_t = typename always_imp<T, Dummy>::type;
-
-////////////////////////////////////////////////////////////////////////////////
-template <class Tuple, class Idx>
-struct make_function;
-
-template <class Tp, std::size_t ...Idx>
-struct make_function<Tp, std::integer_sequence<std::size_t, Idx...>>
-{
- using type = bool (*)(always_t<Tp, Idx>...);
-};
-
-template <class Tp, std::size_t Size>
-using make_function_t = typename make_function<Tp, std::make_index_sequence<Size>>::type;
-
-////////////////////////////////////////////////////////////////////////////////
-template <class Tp, class Idx>
-struct make_tuple_imp;
-
-////////////////////////////////////////////////////////////////////////////////
-template <class Tp, std::size_t ...Idx>
-struct make_tuple_imp<Tp, std::integer_sequence<std::size_t, Idx...>>
-{
- using type = std::tuple<always_t<Tp, Idx>...>;
-};
-
-template <class Tp, std::size_t Size>
-using make_tuple_t = typename make_tuple_imp<Tp, std::make_index_sequence<Size>>::type;
-
-template <class ...Types>
-bool test_apply_fn(Types...) { return true; }
-
-namespace ex = std::experimental;
-
-template <std::size_t Size>
-void test_all()
-{
-
- using A = std::array<int, Size>;
- using ConstA = std::array<int const, Size>;
-
- using Tuple = make_tuple_t<int, Size>;
- using CTuple = make_tuple_t<const int, Size>;
-
- using ValFn = make_function_t<int, Size>;
- ValFn val_fn = &test_apply_fn;
-
- using RefFn = make_function_t<int &, Size>;
- RefFn ref_fn = &test_apply_fn;
-
- using CRefFn = make_function_t<int const &, Size>;
- CRefFn cref_fn = &test_apply_fn;
-
- using RRefFn = make_function_t<int &&, Size>;
- RRefFn rref_fn = &test_apply_fn;
-
- {
- A a{};
- assert(ex::apply(val_fn, a));
- assert(ex::apply(ref_fn, a));
- assert(ex::apply(cref_fn, a));
- assert(ex::apply(rref_fn, std::move(a)));
- }
- {
- ConstA a{};
- assert(ex::apply(val_fn, a));
- assert(ex::apply(cref_fn, a));
- }
- {
- Tuple a{};
- assert(ex::apply(val_fn, a));
- assert(ex::apply(ref_fn, a));
- assert(ex::apply(cref_fn, a));
- assert(ex::apply(rref_fn, std::move(a)));
- }
- {
- CTuple a{};
- assert(ex::apply(val_fn, a));
- assert(ex::apply(cref_fn, a));
- }
-
-}
-
-
-template <std::size_t Size>
-void test_one()
-{
- using A = std::array<int, Size>;
- using Tuple = make_tuple_t<int, Size>;
-
- using ValFn = make_function_t<int, Size>;
- ValFn val_fn = &test_apply_fn;
-
- {
- A a{};
- assert(ex::apply(val_fn, a));
- }
- {
- Tuple a{};
- assert(ex::apply(val_fn, a));
- }
-}
-
-int main()
-{
- // Instantiate with 1-5 arguments.
- test_all<1>();
- test_all<2>();
- test_all<3>();
- test_all<4>();
- test_all<5>();
-
- // Stress test with 128.
- test_one<128>();
- //test_one<256>();
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp
deleted file mode 100644
index 3cf259f531c9..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Testing ref qualified functions
-
-#include <experimental/tuple>
-#include <cassert>
-
-struct func_obj
-{
- constexpr func_obj() {}
-
- constexpr int operator()() const & { return 1; }
- constexpr int operator()() const && { return 2; }
- constexpr int operator()() & { return 3; }
- constexpr int operator()() && { return 4; }
-};
-
-namespace ex = std::experimental;
-
-int main()
-{
-// TODO(ericwf): Re-enable constexpr support
-/*
- {
- constexpr func_obj f;
- constexpr std::tuple<> tp;
-
- static_assert(1 == ex::apply(static_cast<func_obj const &>(f), tp), "");
- static_assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp), "");
- }
-*/
- {
- func_obj f;
- std::tuple<> tp;
- assert(1 == ex::apply(static_cast<func_obj const &>(f), tp));
- assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp));
- assert(3 == ex::apply(static_cast<func_obj &>(f), tp));
- assert(4 == ex::apply(static_cast<func_obj &&>(f), tp));
- }
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp
deleted file mode 100644
index 01d36637e1c3..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Test the return type deduction.
-
-#include <experimental/tuple>
-#include <cassert>
-
-static int my_int = 42;
-
-template <int N> struct index_t {};
-
-void f(index_t<0>) {}
-
-int f(index_t<1>) { return 0; }
-
-int & f(index_t<2>) { return static_cast<int &>(my_int); }
-int const & f(index_t<3>) { return static_cast<int const &>(my_int); }
-int volatile & f(index_t<4>) { return static_cast<int volatile &>(my_int); }
-int const volatile & f(index_t<5>) { return static_cast<int const volatile &>(my_int); }
-
-int && f(index_t<6>) { return static_cast<int &&>(my_int); }
-int const && f(index_t<7>) { return static_cast<int const &&>(my_int); }
-int volatile && f(index_t<8>) { return static_cast<int volatile &&>(my_int); }
-int const volatile && f(index_t<9>) { return static_cast<int const volatile &&>(my_int); }
-
-int * f(index_t<10>) { return static_cast<int *>(&my_int); }
-int const * f(index_t<11>) { return static_cast<int const *>(&my_int); }
-int volatile * f(index_t<12>) { return static_cast<int volatile *>(&my_int); }
-int const volatile * f(index_t<13>) { return static_cast<int const volatile *>(&my_int); }
-
-
-template <int Func, class Expect>
-void test()
-{
- using F = decltype(f(index_t<Func>{}));
- static_assert(std::is_same<F, Expect>::value, "");
-}
-
-namespace ex = std::experimental;
-
-int main()
-{
- test<0, void>();
- test<1, int>();
- test<2, int &>();
- test<3, int const &>();
- test<4, int volatile &>();
- test<5, int const volatile &>();
- test<6, int &&>();
- test<7, int const &&>();
- test<8, int volatile &&>();
- test<9, int const volatile &&>();
- test<10, int *>();
- test<11, int const *>();
- test<12, int volatile *>();
- test<13, int const volatile *>();
-}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp
deleted file mode 100644
index 52eec276394a..000000000000
--- a/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&)
-
-// Test function types.
-
-#include <experimental/tuple>
-#include <array>
-#include <utility>
-#include <cassert>
-
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-namespace ex = std::experimental;
-
-int count = 0;
-
-void f_void_0() { ++count; }
-void f_void_1(int i) { count += i; }
-void f_void_2(int x, int y) { count += (x + y); }
-void f_void_3(int x, int y, int z) { count += (x + y + z); }
-
-int f_int_0() { return ++count; }
-int f_int_1(int x) { return count += x; }
-int f_int_2(int x, int y) { return count += (x + y); }
-int f_int_3(int x, int y, int z) { return count += (x + y + z); }
-
-struct A_void_0
-{
- A_void_0() {}
- void operator()() { ++count; }
- void operator()() const { ++count; ++count; }
-};
-
-struct A_void_1
-{
- A_void_1() {}
- void operator()(int x) { count += x; }
- void operator()(int x) const { count += x + 1; }
-};
-
-struct A_void_2
-{
- A_void_2() {}
- void operator()(int x, int y) { count += (x + y); }
- void operator()(int x, int y) const { count += (x + y) + 1; }
-};
-
-struct A_void_3
-{
- A_void_3() {}
- void operator()(int x, int y, int z) { count += (x + y + z); }
- void operator()(int x, int y, int z) const { count += (x + y + z) + 1; }
-};
-
-
-struct A_int_0
-{
- A_int_0() {}
- int operator()() { return ++count; }
- int operator()() const { ++count; return ++count; }
-};
-
-struct A_int_1
-{
- A_int_1() {}
- int operator()(int x) { return count += x; }
- int operator()(int x) const { return count += (x + 1); }
-
-};
-
-struct A_int_2
-{
- A_int_2() {}
- int operator()(int x, int y) { return count += (x + y); }
- int operator()(int x, int y) const { return count += (x + y + 1); }
-};
-
-struct A_int_3
-{
- A_int_3() {}
- int operator()(int x, int y, int z) { return count += (x + y + z); }
- int operator()(int x, int y, int z) const { return count += (x + y + z + 1); }
-};
-
-
-template <class Tuple>
-void test_void_0()
-{
- count = 0;
- // function
- {
- Tuple t{};
- ex::apply(f_void_0, t);
- assert(count == 1);
- }
- count = 0;
- // function pointer
- {
- Tuple t{};
- auto fp = &f_void_0;
- ex::apply(fp, t);
- assert(count == 1);
- }
- count = 0;
- // functor
- {
- Tuple t{};
- A_void_0 a;
- ex::apply(a, t);
- assert(count == 1);
- }
- count = 0;
- // const functor
- {
- Tuple t{};
- A_void_0 const a;
- ex::apply(a, t);
- assert(count == 2);
- }
-}
-
-template <class Tuple>
-void test_void_1()
-{
- count = 0;
- // function
- {
- Tuple t{1};
- ex::apply(f_void_1, t);
- assert(count == 1);
- }
- count = 0;
- // function pointer
- {
- Tuple t{2};
- void (*fp)(int) = f_void_1;
- ex::apply(fp, t);
- assert(count == 2);
- }
- count = 0;
- // functor
- {
- Tuple t{3};
- A_void_1 fn;
- ex::apply(fn, t);
- assert(count == 3);
- }
- count = 0;
- // const functor
- {
- Tuple t{4};
- A_void_1 const a;
- ex::apply(a, t);
- assert(count == 5);
- }
-}
-
-template <class Tuple>
-void test_void_2()
-{
- count = 0;
- // function
- {
- Tuple t{1, 2};
- ex::apply(f_void_2, t);
- assert(count == 3);
- }
- count = 0;
- // function pointer
- {
- Tuple t{2, 3};
- auto fp = &f_void_2;
- ex::apply(fp, t);
- assert(count == 5);
- }
- count = 0;
- // functor
- {
- Tuple t{3, 4};
- A_void_2 a;
- ex::apply(a, t);
- assert(count == 7);
- }
- count = 0;
- // const functor
- {
- Tuple t{4, 5};
- A_void_2 const a;
- ex::apply(a, t);
- assert(count == 10);
- }
-}
-
-template <class Tuple>
-void test_void_3()
-{
- count = 0;
- // function
- {
- Tuple t{1, 2, 3};
- ex::apply(f_void_3, t);
- assert(count == 6);
- }
- count = 0;
- // function pointer
- {
- Tuple t{2, 3, 4};
- auto fp = &f_void_3;
- ex::apply(fp, t);
- assert(count == 9);
- }
- count = 0;
- // functor
- {
- Tuple t{3, 4, 5};
- A_void_3 a;
- ex::apply(a, t);
- assert(count == 12);
- }
- count = 0;
- // const functor
- {
- Tuple t{4, 5, 6};
- A_void_3 const a;
- ex::apply(a, t);
- assert(count == 16);
- }
-}
-
-
-
-template <class Tuple>
-void test_int_0()
-{
- count = 0;
- // function
- {
- Tuple t{};
- assert(1 == ex::apply(f_int_0, t));
- assert(count == 1);
- }
- count = 0;
- // function pointer
- {
- Tuple t{};
- auto fp = &f_int_0;
- assert(1 == ex::apply(fp, t));
- assert(count == 1);
- }
- count = 0;
- // functor
- {
- Tuple t{};
- A_int_0 a;
- assert(1 == ex::apply(a, t));
- assert(count == 1);
- }
- count = 0;
- // const functor
- {
- Tuple t{};
- A_int_0 const a;
- assert(2 == ex::apply(a, t));
- assert(count == 2);
- }
-}
-
-template <class Tuple>
-void test_int_1()
-{
- count = 0;
- // function
- {
- Tuple t{1};
- assert(1 == ex::apply(f_int_1, t));
- assert(count == 1);
- }
- count = 0;
- // function pointer
- {
- Tuple t{2};
- int (*fp)(int) = f_int_1;
- assert(2 == ex::apply(fp, t));
- assert(count == 2);
- }
- count = 0;
- // functor
- {
- Tuple t{3};
- A_int_1 fn;
- assert(3 == ex::apply(fn, t));
- assert(count == 3);
- }
- count = 0;
- // const functor
- {
- Tuple t{4};
- A_int_1 const a;
- assert(5 == ex::apply(a, t));
- assert(count == 5);
- }
-}
-
-template <class Tuple>
-void test_int_2()
-{
- count = 0;
- // function
- {
- Tuple t{1, 2};
- assert(3 == ex::apply(f_int_2, t));
- assert(count == 3);
- }
- count = 0;
- // function pointer
- {
- Tuple t{2, 3};
- auto fp = &f_int_2;
- assert(5 == ex::apply(fp, t));
- assert(count == 5);
- }
- count = 0;
- // functor
- {
- Tuple t{3, 4};
- A_int_2 a;
- assert(7 == ex::apply(a, t));
- assert(count == 7);
- }
- count = 0;
- // const functor
- {
- Tuple t{4, 5};
- A_int_2 const a;
- assert(10 == ex::apply(a, t));
- assert(count == 10);
- }
-}
-
-template <class Tuple>
-void test_int_3()
-{
- count = 0;
- // function
- {
- Tuple t{1, 2, 3};
- assert(6 == ex::apply(f_int_3, t));
- assert(count == 6);
- }
- count = 0;
- // function pointer
- {
- Tuple t{2, 3, 4};
- auto fp = &f_int_3;
- assert(9 == ex::apply(fp, t));
- assert(count == 9);
- }
- count = 0;
- // functor
- {
- Tuple t{3, 4, 5};
- A_int_3 a;
- assert(12 == ex::apply(a, t));
- assert(count == 12);
- }
- count = 0;
- // const functor
- {
- Tuple t{4, 5, 6};
- A_int_3 const a;
- assert(16 == ex::apply(a, t));
- assert(count == 16);
- }
-}
-
-template <class Tuple>
-void test_0()
-{
- test_void_0<Tuple>();
- test_int_0<Tuple>();
-}
-
-template <class Tuple>
-void test_1()
-{
- test_void_1<Tuple>();
- test_int_1<Tuple>();
-}
-
-template <class Tuple>
-void test_2()
-{
- test_void_2<Tuple>();
- test_int_2<Tuple>();
-}
-
-template <class Tuple>
-void test_3()
-{
- test_void_3<Tuple>();
- test_int_3<Tuple>();
-}
-
-int main()
-{
- test_0<std::tuple<>>();
-
- test_1<std::tuple<int>>();
- test_1<std::array<int, 1>>();
-
- test_2<std::tuple<int, int>>();
- test_2<std::pair<int, int>>();
- test_2<std::array<int, 2>>();
-
- test_3<std::tuple<int, int, int>>();
- test_3<std::array<int, 3>>();
-}
diff --git a/test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp b/test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp
deleted file mode 100644
index a25b18cf5386..000000000000
--- a/test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value;
-
-// Test with reference
-
-#include <experimental/tuple>
-
-namespace ex = std::experimental;
-
-int main()
-{
- auto x = ex::tuple_size_v<std::tuple<> &>;
-}
diff --git a/test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp b/test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp
deleted file mode 100644
index d7a5aa679fcd..000000000000
--- a/test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value;
-
-#include <experimental/tuple>
-#include <utility>
-#include <array>
-
-namespace ex = std::experimental;
-
-template <class Tuple, int Expect>
-void test()
-{
- static_assert(ex::tuple_size_v<Tuple> == Expect, "");
- static_assert(ex::tuple_size_v<Tuple> == std::tuple_size<Tuple>::value, "");
- static_assert(ex::tuple_size_v<Tuple const> == std::tuple_size<Tuple>::value, "");
- static_assert(ex::tuple_size_v<Tuple volatile> == std::tuple_size<Tuple>::value, "");
- static_assert(ex::tuple_size_v<Tuple const volatile> == std::tuple_size<Tuple>::value, "");
-}
-
-int main()
-{
- test<std::tuple<>, 0>();
-
- test<std::tuple<int>, 1>();
- test<std::array<int, 1>, 1>();
-
- test<std::tuple<int, int>, 2>();
- test<std::pair<int, int>, 2>();
- test<std::array<int, 2>, 2>();
-
- test<std::tuple<int, int, int>, 3>();
- test<std::array<int, 3>, 3>();
-}
diff --git a/test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp b/test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp
deleted file mode 100644
index 7c2f0cc236f6..000000000000
--- a/test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/tuple>
-
-// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value;
-
-// Test with pointer
-
-#include <experimental/tuple>
-
-namespace ex = std::experimental;
-
-int main()
-{
- auto x = ex::tuple_size_v<std::tuple<>*>;
-}
diff --git a/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
new file mode 100644
index 000000000000..02e2b607e6d0
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// basic_filebuf<charT,traits>* open(const filesystem::path& p, ios_base::openmode mode);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+#include "platform_support.h"
+
+namespace fs = std::filesystem;
+
+int main() {
+
+ fs::path p = get_temp_file_name();
+ {
+ std::filebuf f;
+ assert(f.open(p, std::ios_base::out) != 0);
+ assert(f.is_open());
+ assert(f.sputn("123", 3) == 3);
+ }
+ {
+ std::filebuf f;
+ assert(f.open(p, std::ios_base::in) != 0);
+ assert(f.is_open());
+ assert(f.sbumpc() == '1');
+ assert(f.sbumpc() == '2');
+ assert(f.sbumpc() == '3');
+ }
+ std::remove(p.c_str());
+ {
+ std::wfilebuf f;
+ assert(f.open(p, std::ios_base::out) != 0);
+ assert(f.is_open());
+ assert(f.sputn(L"123", 3) == 3);
+ }
+ {
+ std::wfilebuf f;
+ assert(f.open(p, std::ios_base::in) != 0);
+ assert(f.is_open());
+ assert(f.sbumpc() == L'1');
+ assert(f.sbumpc() == L'2');
+ assert(f.sbumpc() == L'3');
+ }
+ remove(p.c_str());
+}
diff --git a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
index 4419cb51a6dc..3ac505e52dbc 100644
--- a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
@@ -11,11 +11,11 @@
// int_type pbackfail(int_type c = traits::eof());
-// This test is not entirely portable
-
#include <fstream>
#include <cassert>
+#include "test_macros.h"
+
template <class CharT>
struct test_buf
: public std::basic_filebuf<CharT>
@@ -41,7 +41,12 @@ int main()
assert(f.is_open());
assert(f.sbumpc() == '1');
assert(f.sgetc() == '2');
- assert(f.pbackfail('a') == -1);
+ typename test_buf<char>::int_type pbackResult = f.pbackfail('a');
+ LIBCPP_ASSERT(pbackResult == -1);
+ if (pbackResult != -1) {
+ assert(f.sbumpc() == 'a');
+ assert(f.sgetc() == '2');
+ }
}
{
test_buf<char> f;
@@ -49,8 +54,11 @@ int main()
assert(f.is_open());
assert(f.sbumpc() == '1');
assert(f.sgetc() == '2');
- assert(f.pbackfail('a') == 'a');
- assert(f.sbumpc() == 'a');
- assert(f.sgetc() == '2');
+ typename test_buf<char>::int_type pbackResult = f.pbackfail('a');
+ LIBCPP_ASSERT(pbackResult == 'a');
+ if (pbackResult != -1) {
+ assert(f.sbumpc() == 'a');
+ assert(f.sgetc() == '2');
+ }
}
}
diff --git a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
index eb15facad5ba..d2780c62762d 100644
--- a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
@@ -14,11 +14,11 @@
// pos_type seekpos(pos_type sp,
// ios_base::openmode which = ios_base::in | ios_base::out);
-// This test is not entirely portable
-
#include <fstream>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -30,7 +30,7 @@ int main()
| std::ios_base::trunc) != 0);
assert(f.is_open());
f.sputn("abcdefghijklmnopqrstuvwxyz", 26);
- assert(buf[0] == 'v');
+ LIBCPP_ASSERT(buf[0] == 'v');
pos_type p = f.pubseekoff(-15, std::ios_base::cur);
assert(p == 11);
assert(f.sgetc() == 'l');
@@ -51,7 +51,7 @@ int main()
| std::ios_base::trunc) != 0);
assert(f.is_open());
f.sputn(L"abcdefghijklmnopqrstuvwxyz", 26);
- assert(buf[0] == L'v');
+ LIBCPP_ASSERT(buf[0] == L'v');
pos_type p = f.pubseekoff(-15, std::ios_base::cur);
assert(p == 11);
assert(f.sgetc() == L'l');
diff --git a/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
new file mode 100644
index 000000000000..d9b4a8ccb55a
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// plate <class charT, class traits = char_traits<charT> >
+// class basic_fstream
+
+// explicit basic_fstream(const filesystem::path& s,
+// ios_base::openmode mode = ios_base::in|ios_base::out);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+#include "platform_support.h"
+
+namespace fs = std::filesystem;
+
+int main() {
+ fs::path p = get_temp_file_name();
+ {
+ std::fstream fs(p, std::ios_base::in | std::ios_base::out |
+ std::ios_base::trunc);
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ std::remove(p.c_str());
+ {
+ std::wfstream fs(p, std::ios_base::in | std::ios_base::out |
+ std::ios_base::trunc);
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ std::remove(p.c_str());
+}
diff --git a/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
new file mode 100644
index 000000000000..69cbf3f5c977
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// plate <class charT, class traits = char_traits<charT> >
+// class basic_fstream
+
+// void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in|ios_base::out);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+#include "platform_support.h"
+
+int main() {
+ std::filesystem::path p = get_temp_file_name();
+ {
+ std::fstream stream;
+ assert(!stream.is_open());
+ stream.open(p,
+ std::ios_base::in | std::ios_base::out | std::ios_base::trunc);
+ assert(stream.is_open());
+ double x = 0;
+ stream << 3.25;
+ stream.seekg(0);
+ stream >> x;
+ assert(x == 3.25);
+ }
+ std::remove(p.c_str());
+ {
+ std::wfstream stream;
+ assert(!stream.is_open());
+ stream.open(p,
+ std::ios_base::in | std::ios_base::out | std::ios_base::trunc);
+ assert(stream.is_open());
+ double x = 0;
+ stream << 3.25;
+ stream.seekg(0);
+ stream >> x;
+ assert(x == 3.25);
+ }
+ std::remove(p.c_str());
+}
diff --git a/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
new file mode 100644
index 000000000000..99eae3a28a72
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ifstream
+
+// explicit basic_ifstream(const filesystem::path& s,
+// ios_base::openmode mode = ios_base::in);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+
+namespace fs = std::filesystem;
+
+int main() {
+ {
+ fs::path p;
+ static_assert(!std::is_convertible<fs::path, std::ifstream>::value,
+ "ctor should be explicit");
+ static_assert(std::is_constructible<std::ifstream, fs::path const&,
+ std::ios_base::openmode>::value,
+ "");
+ }
+ {
+ std::ifstream fs(fs::path("test.dat"));
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ // std::ifstream(const fs::path&, std::ios_base::openmode) is tested in
+ // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+ // which creates writable files.
+ {
+ std::wifstream fs(fs::path("test.dat"));
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ // std::wifstream(const fs::path&, std::ios_base::openmode) is tested in
+ // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+ // which creates writable files.
+}
diff --git a/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
new file mode 100644
index 000000000000..82f7c64eba90
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_ifstream
+
+// void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+
+int main() {
+ {
+ std::ifstream fs;
+ assert(!fs.is_open());
+ char c = 'a';
+ fs >> c;
+ assert(fs.fail());
+ assert(c == 'a');
+ fs.open(std::filesystem::path("test.dat"));
+ assert(fs.is_open());
+ fs >> c;
+ assert(c == 'r');
+ }
+ {
+ std::wifstream fs;
+ assert(!fs.is_open());
+ wchar_t c = L'a';
+ fs >> c;
+ assert(fs.fail());
+ assert(c == L'a');
+ fs.open(std::filesystem::path("test.dat"));
+ assert(fs.is_open());
+ fs >> c;
+ assert(c == L'r');
+ }
+}
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
new file mode 100644
index 000000000000..9a23384b0b15
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// plate <class charT, class traits = char_traits<charT> >
+// class basic_ofstream
+
+// explicit basic_ofstream(const filesystem::path& s, ios_base::openmode mode = ios_base::out);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+#include "platform_support.h"
+
+namespace fs = std::filesystem;
+
+int main() {
+ fs::path p = get_temp_file_name();
+ {
+ static_assert(!std::is_convertible<fs::path, std::ofstream>::value,
+ "ctor should be explicit");
+ static_assert(std::is_constructible<std::ofstream, fs::path const&,
+ std::ios_base::openmode>::value,
+ "");
+ }
+ {
+ std::ofstream stream(p);
+ stream << 3.25;
+ }
+ {
+ std::ifstream stream(p);
+ double x = 0;
+ stream >> x;
+ assert(x == 3.25);
+ }
+ {
+ std::ifstream stream(p, std::ios_base::out);
+ double x = 0;
+ stream >> x;
+ assert(x == 3.25);
+ }
+ std::remove(p.c_str());
+ {
+ std::wofstream stream(p);
+ stream << 3.25;
+ }
+ {
+ std::wifstream stream(p);
+ double x = 0;
+ stream >> x;
+ assert(x == 3.25);
+ }
+ {
+ std::wifstream stream(p, std::ios_base::out);
+ double x = 0;
+ stream >> x;
+ assert(x == 3.25);
+ }
+ std::remove(p.c_str());
+}
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
new file mode 100644
index 000000000000..867998bb7af7
--- /dev/null
+++ b/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <fstream>
+
+// plate <class charT, class traits = char_traits<charT> >
+// class basic_ofstream
+
+// void open(const filesystem::path& s, ios_base::openmode mode = ios_base::out);
+
+#include <fstream>
+#include <filesystem>
+#include <cassert>
+#include "platform_support.h"
+
+namespace fs = std::filesystem;
+
+int main() {
+ fs::path p = get_temp_file_name();
+ {
+ std::ofstream fs;
+ assert(!fs.is_open());
+ char c = 'a';
+ fs << c;
+ assert(fs.fail());
+ fs.open(p);
+ assert(fs.is_open());
+ fs << c;
+ }
+ {
+ std::ifstream fs(p.c_str());
+ char c = 0;
+ fs >> c;
+ assert(c == 'a');
+ }
+ std::remove(p.c_str());
+ {
+ std::wofstream fs;
+ assert(!fs.is_open());
+ wchar_t c = L'a';
+ fs << c;
+ assert(fs.fail());
+ fs.open(p);
+ assert(fs.is_open());
+ fs << c;
+ }
+ {
+ std::wifstream fs(p.c_str());
+ wchar_t c = 0;
+ fs >> c;
+ assert(c == L'a');
+ }
+ std::remove(p.c_str());
+}
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink b/test/std/input.output/filesystems/Inputs/static_test_env/bad_symlink
index 76646beed5ed..76646beed5ed 120000
--- a/test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/bad_symlink
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/afile3
index e69de29bb2d1..e69de29bb2d1 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/afile3
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/dir3/file5
index e69de29bb2d1..e69de29bb2d1 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/dir3/file5
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/file4
index e69de29bb2d1..e69de29bb2d1 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/file4
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/symlink_to_dir3
index 397913952621..397913952621 120000
--- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/symlink_to_dir3
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file1
index e69de29bb2d1..e69de29bb2d1 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file1
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file2
index 44834e586734..44834e586734 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file2
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/empty_file b/test/std/input.output/filesystems/Inputs/static_test_env/empty_file
index e69de29bb2d1..e69de29bb2d1 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/empty_file
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/empty_file
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file b/test/std/input.output/filesystems/Inputs/static_test_env/non_empty_file
index 44834e586734..44834e586734 100644
--- a/test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/non_empty_file
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_dir
index df490f837a85..df490f837a85 120000
--- a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_dir
diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_empty_file
index b79b689fc85a..b79b689fc85a 120000
--- a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file
+++ b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_empty_file
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp
new file mode 100644
index 000000000000..a81d5ea7960f
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry(const directory_entry&) = default;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+#include "test_convertible.hpp"
+
+TEST_SUITE(directory_entry_path_ctor_suite)
+
+TEST_CASE(copy_ctor) {
+ using namespace fs;
+ // Copy
+ {
+ static_assert(std::is_copy_constructible<directory_entry>::value,
+ "directory_entry must be copy constructible");
+ static_assert(!std::is_nothrow_copy_constructible<directory_entry>::value,
+ "directory_entry's copy constructor cannot be noexcept");
+ const path p("foo/bar/baz");
+ const directory_entry e(p);
+ assert(e.path() == p);
+ directory_entry e2(e);
+ assert(e.path() == p);
+ assert(e2.path() == p);
+ }
+}
+
+TEST_CASE(copy_ctor_copies_cache) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ {
+ directory_entry ent(sym);
+
+ fs::remove(sym);
+
+ directory_entry ent_cp(ent);
+ TEST_CHECK(ent_cp.path() == sym);
+ TEST_CHECK(ent_cp.is_symlink());
+ }
+
+ {
+ directory_entry ent(file);
+
+ fs::remove(file);
+
+ directory_entry ent_cp(ent);
+ TEST_CHECK(ent_cp.path() == file);
+ TEST_CHECK(ent_cp.is_regular_file());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp
new file mode 100644
index 000000000000..204207276cb5
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry& operator=(directory_entry const&) = default;
+// directory_entry& operator=(directory_entry&&) noexcept = default;
+// void assign(path const&);
+// void replace_filename(path const&);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+TEST_SUITE(directory_entry_ctor_suite)
+
+TEST_CASE(test_copy_assign_operator) {
+ using namespace fs;
+ // Copy
+ {
+ static_assert(std::is_copy_assignable<directory_entry>::value,
+ "directory_entry must be copy assignable");
+ static_assert(!std::is_nothrow_copy_assignable<directory_entry>::value,
+ "directory_entry's copy assignment cannot be noexcept");
+ const path p("foo/bar/baz");
+ const path p2("abc");
+ const directory_entry e(p);
+ directory_entry e2;
+ assert(e.path() == p && e2.path() == path());
+ e2 = e;
+ assert(e.path() == p && e2.path() == p);
+ directory_entry e3(p2);
+ e2 = e3;
+ assert(e2.path() == p2 && e3.path() == p2);
+ }
+}
+
+TEST_CASE(copy_assign_copies_cache) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ {
+ directory_entry ent(sym);
+
+ fs::remove(sym);
+
+ directory_entry ent_cp;
+ ent_cp = ent;
+ TEST_CHECK(ent_cp.path() == sym);
+ TEST_CHECK(ent_cp.is_symlink());
+ }
+
+ {
+ directory_entry ent(file);
+
+ fs::remove(file);
+
+ directory_entry ent_cp;
+ ent_cp = ent;
+ TEST_CHECK(ent_cp.path() == file);
+ TEST_CHECK(ent_cp.is_regular_file());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp
new file mode 100644
index 000000000000..1d83cc69d6cb
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry() noexcept = default;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+int main() {
+ using namespace fs;
+ // Default
+ {
+ static_assert(std::is_nothrow_default_constructible<directory_entry>::value,
+ "directory_entry must have a nothrow default constructor");
+ directory_entry e;
+ assert(e.path() == path());
+ }
+}
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp
new file mode 100644
index 000000000000..240541d203d3
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// XFAIL: apple-clang-7, clang-3.7, clang-3.8
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry() noexcept = default;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+int main() {
+ using namespace fs;
+ // Default
+ {
+ static_assert(std::is_nothrow_default_constructible<directory_entry>::value,
+ "directory_entry must have a nothrow default constructor");
+ const directory_entry e;
+ assert(e.path() == path());
+ }
+}
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp
new file mode 100644
index 000000000000..238a8549ea3b
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry(directory_entry&&) noexcept = default;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+#include "test_convertible.hpp"
+
+TEST_SUITE(directory_entry_path_ctor_suite)
+
+TEST_CASE(move_ctor) {
+ using namespace fs;
+ // Move
+ {
+ static_assert(std::is_nothrow_move_constructible<directory_entry>::value,
+ "directory_entry must be nothrow move constructible");
+ const path p("foo/bar/baz");
+ directory_entry e(p);
+ assert(e.path() == p);
+ directory_entry e2(std::move(e));
+ assert(e2.path() == p);
+ assert(e.path() != p); // Testing moved from state.
+ }
+}
+
+TEST_CASE(move_ctor_copies_cache) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ {
+ directory_entry ent(sym);
+
+ fs::remove(sym);
+
+ directory_entry ent_cp(std::move(ent));
+ TEST_CHECK(ent_cp.path() == sym);
+ TEST_CHECK(ent_cp.is_symlink());
+ }
+
+ {
+ directory_entry ent(file);
+
+ fs::remove(file);
+
+ directory_entry ent_cp(std::move(ent));
+ TEST_CHECK(ent_cp.path() == file);
+ TEST_CHECK(ent_cp.is_regular_file());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp
new file mode 100644
index 000000000000..f104980c9c47
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry& operator=(directory_entry const&) = default;
+// directory_entry& operator=(directory_entry&&) noexcept = default;
+// void assign(path const&);
+// void replace_filename(path const&);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+TEST_SUITE(directory_entry_ctor_suite)
+
+TEST_CASE(test_move_assign_operator) {
+ using namespace fs;
+ // Copy
+ {
+ static_assert(std::is_nothrow_move_assignable<directory_entry>::value,
+ "directory_entry is noexcept move assignable");
+ const path p("foo/bar/baz");
+ const path p2("abc");
+ directory_entry e(p);
+ directory_entry e2(p2);
+ assert(e.path() == p && e2.path() == p2);
+ e2 = std::move(e);
+ assert(e2.path() == p);
+ assert(e.path() != p); // testing moved from state
+ }
+}
+
+TEST_CASE(move_assign_copies_cache) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ {
+ directory_entry ent(sym);
+
+ fs::remove(sym);
+
+ directory_entry ent_cp;
+ ent_cp = std::move(ent);
+ TEST_CHECK(ent_cp.path() == sym);
+ TEST_CHECK(ent_cp.is_symlink());
+ }
+
+ {
+ directory_entry ent(file);
+
+ fs::remove(file);
+
+ directory_entry ent_cp;
+ ent_cp = std::move(ent);
+ TEST_CHECK(ent_cp.path() == file);
+ TEST_CHECK(ent_cp.is_regular_file());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp
new file mode 100644
index 000000000000..b06bd129384d
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp
@@ -0,0 +1,182 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// explicit directory_entry(const path);
+// directory_entry(const path&, error_code& ec);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+#include "test_convertible.hpp"
+
+TEST_SUITE(directory_entry_path_ctor_suite)
+
+TEST_CASE(path_ctor) {
+ using namespace fs;
+ {
+ static_assert(std::is_constructible<directory_entry, const path&>::value,
+ "directory_entry must be constructible from path");
+ static_assert(
+ !std::is_nothrow_constructible<directory_entry, const path&>::value,
+ "directory_entry constructor should not be noexcept");
+ static_assert(!std::is_convertible<path const&, directory_entry>::value,
+ "directory_entry constructor should be explicit");
+ }
+ {
+ const path p("foo/bar/baz");
+ const directory_entry e(p);
+ TEST_CHECK(e.path() == p);
+ }
+}
+
+TEST_CASE(path_ec_ctor) {
+ using namespace fs;
+ {
+ static_assert(
+ std::is_constructible<directory_entry, const path&,
+ std::error_code&>::value,
+ "directory_entry must be constructible from path and error_code");
+ static_assert(!std::is_nothrow_constructible<directory_entry, const path&,
+ std::error_code&>::value,
+ "directory_entry constructor should not be noexcept");
+ static_assert(
+ test_convertible<directory_entry, const path&, std::error_code&>(),
+ "directory_entry constructor should not be explicit");
+ }
+ {
+ std::error_code ec = GetTestEC();
+ const directory_entry e(StaticEnv::File, ec);
+ TEST_CHECK(e.path() == StaticEnv::File);
+ TEST_CHECK(!ec);
+ }
+ {
+ const path p("foo/bar/baz");
+ std::error_code ec = GetTestEC();
+ const directory_entry e(p, ec);
+ TEST_CHECK(e.path() == p);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ }
+}
+
+TEST_CASE(path_ctor_calls_refresh) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ {
+ directory_entry ent(file);
+ std::error_code ec = GetTestEC();
+ directory_entry ent_ec(file, ec);
+ TEST_CHECK(!ec);
+
+ LIBCPP_ONLY(remove(file));
+
+ TEST_CHECK(ent.exists());
+ TEST_CHECK(ent_ec.exists());
+
+ TEST_CHECK(ent.file_size() == 42);
+ TEST_CHECK(ent_ec.file_size() == 42);
+ }
+
+ env.create_file("dir/file", 101);
+
+ {
+ directory_entry ent(sym);
+ std::error_code ec = GetTestEC();
+ directory_entry ent_ec(sym, ec);
+ TEST_CHECK(!ec);
+
+ LIBCPP_ONLY(remove(file));
+ LIBCPP_ONLY(remove(sym));
+
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent_ec.is_symlink());
+
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent_ec.is_regular_file());
+
+ TEST_CHECK(ent.file_size() == 101);
+ TEST_CHECK(ent_ec.file_size() == 101);
+ }
+}
+
+TEST_CASE(path_ctor_dne) {
+ using namespace fs;
+
+ {
+ std::error_code ec = GetTestEC();
+ directory_entry ent(StaticEnv::DNE, ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ TEST_CHECK(ent.path() == StaticEnv::DNE);
+ }
+ // don't report dead symlinks as an error.
+ {
+ std::error_code ec = GetTestEC();
+ directory_entry ent(StaticEnv::BadSymlink, ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(ent.path() == StaticEnv::BadSymlink);
+ }
+ // DNE does not cause the constructor to throw
+ {
+ directory_entry ent(StaticEnv::DNE);
+ TEST_CHECK(ent.path() == StaticEnv::DNE);
+
+ directory_entry ent_two(StaticEnv::BadSymlink);
+ TEST_CHECK(ent_two.path() == StaticEnv::BadSymlink);
+ }
+}
+
+TEST_CASE(path_ctor_cannot_resolve) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file1", 101);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path sym_in_dir = env.create_symlink("dir/file1", "dir/sym2");
+ permissions(dir, perms::none);
+
+ {
+ std::error_code ec = GetTestEC();
+ directory_entry ent(file, ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ TEST_CHECK(ent.path() == file);
+ }
+ {
+ std::error_code ec = GetTestEC();
+ directory_entry ent(sym_in_dir, ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ TEST_CHECK(ent.path() == sym_in_dir);
+ }
+ {
+ std::error_code ec = GetTestEC();
+ directory_entry ent(sym_out_of_dir, ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(ent.path() == sym_out_of_dir);
+ }
+ {
+ TEST_CHECK_NO_THROW(directory_entry(file));
+ TEST_CHECK_NO_THROW(directory_entry(sym_in_dir));
+ TEST_CHECK_NO_THROW(directory_entry(sym_out_of_dir));
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp
new file mode 100644
index 000000000000..d19c8c2ad873
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp
@@ -0,0 +1,132 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry& operator=(directory_entry const&) = default;
+// directory_entry& operator=(directory_entry&&) noexcept = default;
+// void assign(path const&);
+// void replace_filename(path const&);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+TEST_SUITE(directory_entry_mods_suite)
+
+TEST_CASE(test_path_assign_method) {
+ using namespace fs;
+ const path p("foo/bar/baz");
+ const path p2("abc");
+ directory_entry e(p);
+ {
+ static_assert(std::is_same<decltype(e.assign(p)), void>::value,
+ "return type should be void");
+ static_assert(noexcept(e.assign(p)) == false,
+ "operation must not be noexcept");
+ }
+ {
+ TEST_CHECK(e.path() == p);
+ e.assign(p2);
+ TEST_CHECK(e.path() == p2 && e.path() != p);
+ e.assign(p);
+ TEST_CHECK(e.path() == p && e.path() != p2);
+ }
+}
+
+TEST_CASE(test_path_assign_ec_method) {
+ using namespace fs;
+ const path p("foo/bar/baz");
+ const path p2("abc");
+ {
+ std::error_code ec;
+ directory_entry e(p);
+ static_assert(std::is_same<decltype(e.assign(p, ec)), void>::value,
+ "return type should be void");
+ static_assert(noexcept(e.assign(p, ec)) == false,
+ "operation must not be noexcept");
+ }
+ {
+ directory_entry ent(p);
+ std::error_code ec = GetTestEC();
+ ent.assign(p2, ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ TEST_CHECK(ent.path() == p2);
+ }
+}
+
+TEST_CASE(test_assign_calls_refresh) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ {
+ directory_entry ent;
+ ent.assign(file);
+
+ // removing the file demonstrates that the values where cached previously.
+ LIBCPP_ONLY(remove(file));
+
+ TEST_CHECK(ent.is_regular_file());
+ }
+ env.create_file("dir/file", 101);
+ {
+ directory_entry ent;
+ ent.assign(sym);
+
+ LIBCPP_ONLY(remove(file));
+ LIBCPP_ONLY(remove(sym));
+
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ }
+}
+
+TEST_CASE(test_assign_propagates_error) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path file_out_of_dir = env.create_file("file1");
+ const path sym_in_dir = env.create_symlink("file1", "dir/sym1");
+
+ permissions(dir, perms::none);
+
+ {
+ directory_entry ent;
+ std::error_code ec = GetTestEC();
+ ent.assign(file, ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ }
+ {
+ directory_entry ent;
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_in_dir, ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ }
+ {
+ directory_entry ent;
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_out_of_dir, ec);
+ TEST_CHECK(!ec);
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp
new file mode 100644
index 000000000000..575f0d59b4cd
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp
@@ -0,0 +1,341 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry& operator=(directory_entry const&) = default;
+// directory_entry& operator=(directory_entry&&) noexcept = default;
+// void assign(path const&);
+// void replace_filename(path const&);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+TEST_SUITE(directory_entry_mods_suite)
+
+TEST_CASE(test_refresh_method) {
+ using namespace fs;
+ {
+ directory_entry e;
+ static_assert(noexcept(e.refresh()) == false,
+ "operation cannot be noexcept");
+ static_assert(std::is_same<decltype(e.refresh()), void>::value,
+ "operation must return void");
+ }
+ {
+ directory_entry e;
+ e.refresh();
+ TEST_CHECK(!e.exists());
+ }
+}
+
+TEST_CASE(test_refresh_ec_method) {
+ using namespace fs;
+ {
+ directory_entry e;
+ std::error_code ec;
+ static_assert(noexcept(e.refresh(ec)), "operation should be noexcept");
+ static_assert(std::is_same<decltype(e.refresh(ec)), void>::value,
+ "operation must return void");
+ }
+ {
+ directory_entry e;
+ std::error_code ec = GetTestEC();
+ e.refresh(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ }
+}
+
+TEST_CASE(refresh_on_file_dne) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+
+ const perms old_perms = status(dir).permissions();
+
+ // test file doesn't exist
+ {
+ directory_entry ent(file);
+ remove(file);
+ TEST_CHECK(ent.exists());
+
+ ent.refresh();
+
+ permissions(dir, perms::none);
+ TEST_CHECK(!ent.exists());
+ }
+ permissions(dir, old_perms);
+ env.create_file("dir/file", 101);
+ {
+ directory_entry ent(file);
+ remove(file);
+ TEST_CHECK(ent.exists());
+
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ permissions(dir, perms::none);
+ TEST_CHECK(!ent.exists());
+ }
+}
+
+void remove_if_exists(const fs::path& p) {
+ std::error_code ec;
+ remove(p, ec);
+}
+
+TEST_CASE(refresh_on_bad_symlink) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path sym = env.create_symlink("dir/file", "sym");
+
+ const perms old_perms = status(dir).permissions();
+
+ // test file doesn't exist
+ {
+ directory_entry ent(sym);
+ LIBCPP_ONLY(remove(file));
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.exists());
+
+ remove_if_exists(file);
+ ent.refresh();
+
+ LIBCPP_ONLY(permissions(dir, perms::none));
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(!ent.is_regular_file());
+ TEST_CHECK(!ent.exists());
+ }
+ permissions(dir, old_perms);
+ env.create_file("dir/file", 101);
+ {
+ directory_entry ent(sym);
+ LIBCPP_ONLY(remove(file));
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.exists());
+
+ remove_if_exists(file);
+
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(!ec); // we don't report bad symlinks as an error.
+
+ LIBCPP_ONLY(permissions(dir, perms::none));
+ TEST_CHECK(!ent.exists());
+ }
+}
+
+TEST_CASE(refresh_cannot_resolve) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file1", 99);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path sym_in_dir = env.create_symlink("file1", "dir/sym1");
+ perms old_perms = status(dir).permissions();
+
+ {
+ directory_entry ent(file);
+ permissions(dir, perms::none);
+
+ TEST_CHECK(ent.is_regular_file());
+
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ TEST_CHECK(ent.path() == file);
+
+ ExceptionChecker Checker(file, std::errc::permission_denied,
+ "directory_entry::refresh");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.refresh());
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent(sym_in_dir);
+ permissions(dir, perms::none);
+ TEST_CHECK(ent.is_symlink());
+
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ TEST_CHECK(ent.path() == sym_in_dir);
+
+ ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
+ "directory_entry::refresh");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.refresh());
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent(sym_out_of_dir);
+ permissions(dir, perms::none);
+ TEST_CHECK(ent.is_symlink());
+
+ // Failure to resolve the linked entity due to permissions is not
+ // reported as an error.
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(ent.is_symlink());
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.exists(ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ TEST_CHECK(ent.path() == sym_out_of_dir);
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent_file(file);
+ directory_entry ent_sym(sym_in_dir);
+ directory_entry ent_sym2(sym_out_of_dir);
+ permissions(dir, perms::none);
+ ((void)ent_file);
+ ((void)ent_sym);
+
+ TEST_CHECK_THROW(filesystem_error, ent_file.refresh());
+ TEST_CHECK_THROW(filesystem_error, ent_sym.refresh());
+ TEST_CHECK_NO_THROW(ent_sym2);
+ }
+}
+
+TEST_CASE(refresh_doesnt_throw_on_dne_but_reports_it) {
+ using namespace fs;
+ scoped_test_env env;
+
+ const path file = env.create_file("file1", 42);
+ const path sym = env.create_symlink("file1", "sym");
+
+ {
+ directory_entry ent(file);
+ TEST_CHECK(ent.file_size() == 42);
+
+ remove(file);
+
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ TEST_CHECK_NO_THROW(ent.refresh());
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ // doesn't throw!
+ TEST_CHECK_THROW(filesystem_error, ent.file_size());
+ }
+ env.create_file("file1", 99);
+ {
+ directory_entry ent(sym);
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.file_size() == 99);
+
+ remove(file);
+
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ TEST_CHECK_THROW(filesystem_error, ent.file_size());
+ }
+}
+
+TEST_CASE(access_cache_after_refresh_fails) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file1", 101);
+ const path sym = env.create_symlink("dir/file", "sym");
+ const path sym_in_dir = env.create_symlink("dir/file", "dir/sym2");
+
+ const perms old_perms = status(dir).permissions();
+
+#define CHECK_ACCESS(func, expect) \
+ ec = GetTestEC(); \
+ TEST_CHECK(ent.func(ec) == expect); \
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied))
+
+ // test file doesn't exist
+ {
+ directory_entry ent(file);
+
+ TEST_CHECK(!ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.exists());
+
+ permissions(dir, perms::none);
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ CHECK_ACCESS(exists, false);
+ CHECK_ACCESS(is_symlink, false);
+ CHECK_ACCESS(last_write_time, file_time_type::min());
+ CHECK_ACCESS(hard_link_count, uintmax_t(-1));
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent(sym_in_dir);
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.exists());
+
+ permissions(dir, perms::none);
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ CHECK_ACCESS(exists, false);
+ CHECK_ACCESS(is_symlink, false);
+ CHECK_ACCESS(last_write_time, file_time_type::min());
+ CHECK_ACCESS(hard_link_count, uintmax_t(-1));
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent(sym);
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.exists());
+
+ permissions(dir, perms::none);
+ std::error_code ec = GetTestEC();
+ ent.refresh(ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(ent.is_symlink());
+
+ CHECK_ACCESS(exists, false);
+ CHECK_ACCESS(is_regular_file, false);
+ CHECK_ACCESS(last_write_time, file_time_type::min());
+ CHECK_ACCESS(hard_link_count, uintmax_t(-1));
+ }
+#undef CHECK_ACCESS
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp
new file mode 100644
index 000000000000..4a9b76d6375f
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp
@@ -0,0 +1,169 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// directory_entry& operator=(directory_entry const&) = default;
+// directory_entry& operator=(directory_entry&&) noexcept = default;
+// void assign(path const&);
+// void replace_filename(path const&);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+TEST_SUITE(directory_entry_mods_suite)
+
+TEST_CASE(test_replace_filename_method) {
+ using namespace fs;
+
+ {
+ directory_entry e;
+ path replace;
+ static_assert(noexcept(e.replace_filename(replace)) == false,
+ "operation cannot be noexcept");
+ static_assert(
+ std::is_same<decltype(e.replace_filename(replace)), void>::value,
+ "operation must return void");
+ }
+ {
+ const path p("/path/to/foo.exe");
+ const path replace("bar.out");
+ const path expect("/path/to/bar.out");
+ directory_entry e(p);
+ TEST_CHECK(e.path() == p);
+ e.replace_filename(replace);
+ TEST_CHECK(e.path() == expect);
+ }
+}
+
+TEST_CASE(test_replace_filename_ec_method) {
+ using namespace fs;
+
+ {
+ directory_entry e;
+ path replace;
+ std::error_code ec;
+ static_assert(noexcept(e.replace_filename(replace, ec)) == false,
+ "operation cannot be noexcept");
+ static_assert(
+ std::is_same<decltype(e.replace_filename(replace, ec)), void>::value,
+ "operation must return void");
+ }
+ {
+ const path p("/path/to/foo.exe");
+ const path replace("bar.out");
+ const path expect("/path/to/bar.out");
+ directory_entry e(p);
+ TEST_CHECK(e.path() == p);
+ std::error_code ec = GetTestEC();
+ e.replace_filename(replace, ec);
+ TEST_CHECK(e.path() == expect);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ }
+ {
+ const path p = StaticEnv::EmptyFile;
+ const path expect = StaticEnv::NonEmptyFile;
+ const path replace = StaticEnv::NonEmptyFile.filename();
+ TEST_REQUIRE(expect.parent_path() == p.parent_path());
+ directory_entry e(p);
+ TEST_CHECK(e.path() == p);
+ std::error_code ec = GetTestEC();
+ e.replace_filename(replace, ec);
+ TEST_CHECK(e.path() == expect);
+ TEST_CHECK(!ec);
+ }
+}
+
+TEST_CASE(test_replace_filename_calls_refresh) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_two = env.create_file("dir/file_two", 101);
+ const path sym = env.create_symlink("dir/file", "sym");
+ const path sym_two = env.create_symlink("dir/file_two", "sym_two");
+
+ {
+ directory_entry ent(file);
+ ent.replace_filename(file_two.filename());
+ TEST_REQUIRE(ent.path() == file_two);
+
+ // removing the file demonstrates that the values where cached previously.
+ LIBCPP_ONLY(remove(file_two));
+
+ TEST_CHECK(ent.file_size() == 101);
+ }
+ env.create_file("dir/file_two", 99);
+ {
+ directory_entry ent(sym);
+ ent.replace_filename(sym_two.filename());
+ TEST_REQUIRE(ent.path() == sym_two);
+
+ LIBCPP_ONLY(remove(file_two));
+ LIBCPP_ONLY(remove(sym_two));
+
+ TEST_CHECK(ent.is_symlink());
+ TEST_CHECK(ent.is_regular_file());
+ TEST_CHECK(ent.file_size() == 99);
+ }
+}
+
+TEST_CASE(test_replace_filename_propagates_error) {
+ using namespace fs;
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_two = env.create_file("dir/file_two", 99);
+ const path file_out_of_dir = env.create_file("file_three", 101);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path sym_out_of_dir_two = env.create_symlink("dir/file", "sym_two");
+ const path sym_in_dir = env.create_symlink("file_two", "dir/sym_three");
+ const path sym_in_dir_two = env.create_symlink("file_two", "dir/sym_four");
+
+ const perms old_perms = status(dir).permissions();
+
+ {
+ directory_entry ent(file);
+ permissions(dir, perms::none);
+ std::error_code ec = GetTestEC();
+ ent.replace_filename(file_two.filename(), ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent(sym_in_dir);
+ permissions(dir, perms::none);
+ std::error_code ec = GetTestEC();
+ ent.replace_filename(sym_in_dir_two.filename(), ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ }
+ permissions(dir, old_perms);
+ {
+ directory_entry ent(sym_out_of_dir);
+ permissions(dir, perms::none);
+ std::error_code ec = GetTestEC();
+ ent.replace_filename(sym_out_of_dir_two.filename(), ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(ent.is_symlink());
+ ec = GetTestEC();
+ TEST_CHECK(!ent.exists(ec));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
index 96e509300229..7df36fed3a6e 100644
--- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_entry
@@ -21,11 +21,10 @@
// bool operator>=(directory_entry const&) const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
-namespace fs = std::experimental::filesystem;
#define CHECK_OP(Op) \
static_assert(std::is_same<decltype(ce. operator Op (ce)), bool>::value, ""); \
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
new file mode 100644
index 000000000000..04dec92c9c99
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
@@ -0,0 +1,242 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// uintmax_t file_size() const;
+// uintmax_t file_size(error_code const&) const noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "filesystem_test_helper.hpp"
+#include "rapid-cxx-test.hpp"
+
+#include <iostream>
+
+TEST_SUITE(directory_entry_obs_testsuite)
+
+TEST_CASE(signatures) {
+ using namespace fs;
+ {
+ const fs::directory_entry e = {};
+ std::error_code ec;
+ static_assert(std::is_same<decltype(e.file_size()), uintmax_t>::value, "");
+ static_assert(std::is_same<decltype(e.file_size(ec)), uintmax_t>::value,
+ "");
+ static_assert(noexcept(e.file_size()) == false, "");
+ static_assert(noexcept(e.file_size(ec)) == true, "");
+ }
+}
+
+TEST_CASE(basic) {
+ using namespace fs;
+
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ const path dir = env.create_dir("dir");
+ const path sym = env.create_symlink("file", "sym");
+
+ {
+ directory_entry ent(file);
+ uintmax_t expect = file_size(ent);
+ TEST_CHECK(expect == 42);
+
+ // Remove the file to show that the results were already in the cache.
+ LIBCPP_ONLY(remove(file));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == expect);
+ TEST_CHECK(!ec);
+ }
+ env.create_file("file", 99);
+ {
+ directory_entry ent(sym);
+
+ uintmax_t expect = file_size(ent);
+ TEST_CHECK(expect == 99);
+
+ LIBCPP_ONLY(remove(ent));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == 99);
+ TEST_CHECK(!ec);
+ }
+}
+
+TEST_CASE(not_regular_file) {
+ using namespace fs;
+
+ scoped_test_env env;
+ struct {
+ const path p;
+ std::errc expected_err;
+ } TestCases[] = {
+ {env.create_dir("dir"), std::errc::is_a_directory},
+ {env.create_fifo("fifo"), std::errc::not_supported},
+ {env.create_symlink("dir", "sym"), std::errc::is_a_directory}};
+
+ for (auto const& TC : TestCases) {
+ const path& p = TC.p;
+ directory_entry ent(p);
+ TEST_CHECK(ent.path() == p);
+ std::error_code ec = GetTestEC(0);
+
+ std::error_code other_ec = GetTestEC(1);
+ uintmax_t expect = file_size(p, other_ec);
+
+ uintmax_t got = ent.file_size(ec);
+ TEST_CHECK(got == expect);
+ TEST_CHECK(got == uintmax_t(-1));
+ TEST_CHECK(ec == other_ec);
+ TEST_CHECK(ErrorIs(ec, TC.expected_err));
+
+ ExceptionChecker Checker(p, TC.expected_err, "directory_entry::file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ }
+}
+
+TEST_CASE(error_reporting) {
+ using namespace fs;
+
+ scoped_test_env env;
+
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file2", 101);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path sym_in_dir = env.create_symlink("file2", "dir/sym2");
+
+ const perms old_perms = status(dir).permissions();
+
+ // test a file which doesn't exist
+ {
+ directory_entry ent;
+
+ std::error_code ec = GetTestEC();
+ ent.assign(StaticEnv::DNE, ec);
+ TEST_REQUIRE(ent.path() == StaticEnv::DNE);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ExceptionChecker Checker(StaticEnv::DNE,
+ std::errc::no_such_file_or_directory,
+ "directory_entry::file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ }
+ // test a dead symlink
+ {
+ directory_entry ent;
+
+ std::error_code ec = GetTestEC();
+ uintmax_t expect_bad = file_size(StaticEnv::BadSymlink, ec);
+ TEST_CHECK(expect_bad == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ec = GetTestEC();
+ ent.assign(StaticEnv::BadSymlink, ec);
+ TEST_REQUIRE(ent.path() == StaticEnv::BadSymlink);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == expect_bad);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ExceptionChecker Checker(StaticEnv::BadSymlink,
+ std::errc::no_such_file_or_directory,
+ "directory_entry::file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ }
+ // test a file w/o appropriate permissions.
+ {
+ directory_entry ent;
+ uintmax_t expect_good = file_size(file);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(file, ec);
+ TEST_REQUIRE(ent.path() == file);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(file, std::errc::permission_denied, "file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.file_size());
+ }
+ permissions(dir, old_perms);
+ // test a symlink w/o appropriate permissions.
+ {
+ directory_entry ent;
+ uintmax_t expect_good = file_size(sym_in_dir);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_in_dir, ec);
+ TEST_REQUIRE(ent.path() == sym_in_dir);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
+ "file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.file_size());
+ }
+ permissions(dir, old_perms);
+ // test a symlink to a file w/o appropriate permissions
+ {
+ directory_entry ent;
+ uintmax_t expect_good = file_size(sym_out_of_dir);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_out_of_dir, ec);
+ TEST_REQUIRE(ent.path() == sym_out_of_dir);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied,
+ "file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.file_size(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.file_size());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp
new file mode 100644
index 000000000000..2a0d80ca6262
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp
@@ -0,0 +1,258 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// file_status status() const;
+// file_status status(error_code const&) const noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "filesystem_test_helper.hpp"
+#include "rapid-cxx-test.hpp"
+
+TEST_SUITE(directory_entry_obs_testsuite)
+
+TEST_CASE(file_dne) {
+ using namespace fs;
+ directory_entry p("dne");
+}
+
+TEST_CASE(signatures) {
+ using namespace fs;
+ const directory_entry e = {};
+ std::error_code ec;
+#define TEST_FUNC(name) \
+ static_assert(std::is_same<decltype(e.name()), bool>::value, \
+ "wrong return type"); \
+ static_assert(noexcept(e.name()) == false, "should not be noexcept"); \
+ static_assert(std::is_same<decltype(e.name(ec)), bool>::value, \
+ "wrong return type"); \
+ static_assert(noexcept(e.name(ec)) == true, "should be noexcept")
+
+ TEST_FUNC(exists);
+ TEST_FUNC(is_block_file);
+ TEST_FUNC(is_character_file);
+ TEST_FUNC(is_directory);
+ TEST_FUNC(is_fifo);
+ TEST_FUNC(is_other);
+ TEST_FUNC(is_regular_file);
+ TEST_FUNC(is_socket);
+ TEST_FUNC(is_symlink);
+
+#undef TEST_FUNC
+}
+
+TEST_CASE(test_without_ec) {
+ using namespace fs;
+ using fs::directory_entry;
+ using fs::file_status;
+ using fs::path;
+
+ scoped_test_env env;
+ path f = env.create_file("foo", 42);
+ path d = env.create_dir("dir");
+ path fifo = env.create_fifo("fifo");
+ path hl = env.create_hardlink("foo", "hl");
+ for (auto p : {hl, f, d, fifo}) {
+ directory_entry e(p);
+ file_status st = status(p);
+ file_status sym_st = symlink_status(p);
+ fs::remove(p);
+ TEST_REQUIRE(e.exists());
+ TEST_REQUIRE(!exists(p));
+ TEST_CHECK(e.exists() == exists(st));
+ TEST_CHECK(e.is_block_file() == is_block_file(st));
+ TEST_CHECK(e.is_character_file() == is_character_file(st));
+ TEST_CHECK(e.is_directory() == is_directory(st));
+ TEST_CHECK(e.is_fifo() == is_fifo(st));
+ TEST_CHECK(e.is_other() == is_other(st));
+ TEST_CHECK(e.is_regular_file() == is_regular_file(st));
+ TEST_CHECK(e.is_socket() == is_socket(st));
+ TEST_CHECK(e.is_symlink() == is_symlink(sym_st));
+ }
+}
+
+TEST_CASE(test_with_ec) {
+ using namespace fs;
+ using fs::directory_entry;
+ using fs::file_status;
+ using fs::path;
+
+ scoped_test_env env;
+ path f = env.create_file("foo", 42);
+ path d = env.create_dir("dir");
+ path fifo = env.create_fifo("fifo");
+ path hl = env.create_hardlink("foo", "hl");
+ for (auto p : {hl, f, d, fifo}) {
+ directory_entry e(p);
+ std::error_code status_ec = GetTestEC();
+ std::error_code sym_status_ec = GetTestEC(1);
+ file_status st = status(p, status_ec);
+ file_status sym_st = symlink_status(p, sym_status_ec);
+ fs::remove(p);
+ std::error_code ec = GetTestEC(2);
+ auto CheckEC = [&](std::error_code const& other_ec) {
+ bool res = ec == other_ec;
+ ec = GetTestEC(2);
+ return res;
+ };
+
+ TEST_REQUIRE(e.exists(ec));
+ TEST_CHECK(CheckEC(status_ec));
+ TEST_REQUIRE(!exists(p));
+
+ TEST_CHECK(e.exists(ec) == exists(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_block_file(ec) == is_block_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_character_file(ec) == is_character_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_directory(ec) == is_directory(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_fifo(ec) == is_fifo(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_other(ec) == is_other(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_socket(ec) == is_socket(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st));
+ TEST_CHECK(CheckEC(sym_status_ec));
+ }
+}
+
+TEST_CASE(test_with_ec_dne) {
+ using namespace fs;
+ using fs::directory_entry;
+ using fs::file_status;
+ using fs::path;
+
+ for (auto p : {StaticEnv::DNE, StaticEnv::BadSymlink}) {
+
+ directory_entry e(p);
+ std::error_code status_ec = GetTestEC();
+ std::error_code sym_status_ec = GetTestEC(1);
+ file_status st = status(p, status_ec);
+ file_status sym_st = symlink_status(p, sym_status_ec);
+ std::error_code ec = GetTestEC(2);
+ auto CheckEC = [&](std::error_code const& other_ec) {
+ bool res = ec == other_ec;
+ ec = GetTestEC(2);
+ return res;
+ };
+
+ TEST_CHECK(e.exists(ec) == exists(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_block_file(ec) == is_block_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_character_file(ec) == is_character_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_directory(ec) == is_directory(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_fifo(ec) == is_fifo(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_other(ec) == is_other(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_socket(ec) == is_socket(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st));
+ TEST_CHECK(CheckEC(sym_status_ec));
+ }
+}
+
+TEST_CASE(test_with_ec_cannot_resolve) {
+ using namespace fs;
+ using fs::directory_entry;
+ using fs::file_status;
+ using fs::path;
+
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file2", 99);
+ const path sym = env.create_symlink("file2", "dir/sym");
+
+ perms old_perms = fs::status(dir).permissions();
+
+ for (auto p : {file, sym}) {
+ permissions(dir, old_perms);
+ directory_entry e(p);
+
+ permissions(dir, perms::none);
+ std::error_code dummy_ec;
+ e.refresh(dummy_ec);
+ TEST_REQUIRE(dummy_ec);
+
+ std::error_code status_ec = GetTestEC();
+ std::error_code sym_status_ec = GetTestEC(1);
+ file_status st = status(p, status_ec);
+ file_status sym_st = symlink_status(p, sym_status_ec);
+ std::error_code ec = GetTestEC(2);
+ auto CheckEC = [&](std::error_code const& other_ec) {
+ bool res = ec == other_ec;
+ ec = GetTestEC(2);
+ return res;
+ };
+
+ TEST_CHECK(e.exists(ec) == exists(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_block_file(ec) == is_block_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_character_file(ec) == is_character_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_directory(ec) == is_directory(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_fifo(ec) == is_fifo(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_other(ec) == is_other(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_socket(ec) == is_socket(st));
+ TEST_CHECK(CheckEC(status_ec));
+
+ TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st));
+ TEST_CHECK(CheckEC(sym_status_ec));
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
new file mode 100644
index 000000000000..17124c132cb4
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
@@ -0,0 +1,242 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// uintmax_t hard_link_count() const;
+// uintmax_t hard_link_count(error_code const&) const noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "filesystem_test_helper.hpp"
+#include "rapid-cxx-test.hpp"
+
+TEST_SUITE(directory_entry_obs_testsuite)
+
+TEST_CASE(signatures) {
+ using namespace fs;
+ {
+ const directory_entry e = {};
+ std::error_code ec;
+ static_assert(std::is_same<decltype(e.hard_link_count()), uintmax_t>::value, "");
+ static_assert(std::is_same<decltype(e.hard_link_count(ec)), uintmax_t>::value,
+ "");
+ static_assert(noexcept(e.hard_link_count()) == false, "");
+ static_assert(noexcept(e.hard_link_count(ec)) == true, "");
+ }
+}
+
+TEST_CASE(basic) {
+ using namespace fs;
+
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ const path dir = env.create_dir("dir");
+ const path sym = env.create_symlink("file", "sym");
+
+ {
+ directory_entry ent(file);
+ uintmax_t expect = hard_link_count(ent);
+
+ // Remove the file to show that the results were already in the cache.
+ LIBCPP_ONLY(remove(file));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect);
+ TEST_CHECK(!ec);
+ }
+ {
+ directory_entry ent(dir);
+ uintmax_t expect = hard_link_count(ent);
+
+ LIBCPP_ONLY(remove(dir));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect);
+ TEST_CHECK(!ec);
+ }
+ env.create_file("file", 99);
+ env.create_hardlink("file", "hl");
+ {
+ directory_entry ent(sym);
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == 2);
+ TEST_CHECK(!ec);
+ }
+}
+
+TEST_CASE(not_regular_file) {
+ using namespace fs;
+
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path dir2 = env.create_dir("dir/dir2");
+ const path fifo = env.create_fifo("dir/fifo");
+ const path sym_to_fifo = env.create_symlink("dir/fifo", "dir/sym");
+
+ const perms old_perms = status(dir).permissions();
+
+ for (auto p : {dir2, fifo, sym_to_fifo}) {
+ permissions(dir, old_perms);
+ std::error_code dummy_ec = GetTestEC();
+ directory_entry ent(p, dummy_ec);
+ TEST_CHECK(!dummy_ec);
+
+ uintmax_t expect = hard_link_count(p);
+
+ LIBCPP_ONLY(permissions(dir, perms::none));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.hard_link_count());
+ }
+}
+
+TEST_CASE(error_reporting) {
+ using namespace fs;
+
+ scoped_test_env env;
+
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file2", 101);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path sym_in_dir = env.create_symlink("file2", "dir/sym2");
+
+ const perms old_perms = status(dir).permissions();
+
+ // test a file which doesn't exist
+ {
+ directory_entry ent;
+
+ std::error_code ec = GetTestEC();
+ ent.assign(StaticEnv::DNE, ec);
+ TEST_CHECK(ec);
+ TEST_REQUIRE(ent.path() == StaticEnv::DNE);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ExceptionChecker Checker(StaticEnv::DNE,
+ std::errc::no_such_file_or_directory,
+ "directory_entry::hard_link_count");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ }
+ // test a dead symlink
+ {
+ directory_entry ent;
+
+ std::error_code ec = GetTestEC();
+ uintmax_t expect_bad = hard_link_count(StaticEnv::BadSymlink, ec);
+ TEST_CHECK(expect_bad == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ec = GetTestEC();
+ ent.assign(StaticEnv::BadSymlink, ec);
+ TEST_REQUIRE(ent.path() == StaticEnv::BadSymlink);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect_bad);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ExceptionChecker Checker(StaticEnv::BadSymlink,
+ std::errc::no_such_file_or_directory,
+ "directory_entry::hard_link_count");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ }
+ // test a file w/o appropriate permissions.
+ {
+ directory_entry ent;
+ uintmax_t expect_good = hard_link_count(file);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(file, ec);
+ TEST_REQUIRE(ent.path() == file);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(file, std::errc::permission_denied,
+ "hard_link_count");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.hard_link_count());
+ }
+ permissions(dir, old_perms);
+ // test a symlink w/o appropriate permissions.
+ {
+ directory_entry ent;
+ uintmax_t expect_good = hard_link_count(sym_in_dir);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_in_dir, ec);
+ TEST_REQUIRE(ent.path() == sym_in_dir);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
+ "hard_link_count");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.hard_link_count());
+ }
+ permissions(dir, old_perms);
+ // test a symlink to a file w/o appropriate permissions
+ {
+ directory_entry ent;
+ uintmax_t expect_good = hard_link_count(sym_out_of_dir);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_out_of_dir, ec);
+ TEST_REQUIRE(ent.path() == sym_out_of_dir);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied,
+ "hard_link_count");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.hard_link_count(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.hard_link_count());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp
new file mode 100644
index 000000000000..afdd47a513c2
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp
@@ -0,0 +1,215 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// file_time_type last_write_time() const;
+// file_time_type last_write_time(error_code const&) const noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "filesystem_test_helper.hpp"
+#include "rapid-cxx-test.hpp"
+
+TEST_SUITE(directory_entry_obs_testsuite)
+
+TEST_CASE(signatures) {
+ using namespace fs;
+ {
+ const fs::directory_entry e = {};
+ std::error_code ec;
+ static_assert(std::is_same<decltype(e.last_write_time()), file_time_type>::value,
+ "");
+ static_assert(std::is_same<decltype(e.last_write_time(ec)), file_time_type>::value,
+ "");
+ static_assert(noexcept(e.last_write_time()) == false, "");
+ static_assert(noexcept(e.last_write_time(ec)) == true, "");
+ }
+}
+
+TEST_CASE(basic) {
+ using namespace fs;
+
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ const path dir = env.create_dir("dir");
+ const path sym = env.create_symlink("file", "sym");
+
+ {
+ directory_entry ent(file);
+ file_time_type expect = last_write_time(ent);
+
+ // Remove the file to show that the results were already in the cache.
+ LIBCPP_ONLY(remove(file));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect);
+ TEST_CHECK(!ec);
+ }
+ {
+ directory_entry ent(dir);
+ file_time_type expect = last_write_time(ent);
+
+ LIBCPP_ONLY(remove(dir));
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect);
+ TEST_CHECK(!ec);
+ }
+ env.create_file("file", 99);
+ {
+ directory_entry ent(sym);
+ file_time_type expect = last_write_time(sym);
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect);
+ TEST_CHECK(!ec);
+ }
+}
+
+TEST_CASE(error_reporting) {
+ using namespace fs;
+
+ scoped_test_env env;
+
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ const path file_out_of_dir = env.create_file("file2", 101);
+ const path sym_out_of_dir = env.create_symlink("dir/file", "sym");
+ const path sym_in_dir = env.create_symlink("file2", "dir/sym2");
+
+ const perms old_perms = status(dir).permissions();
+
+ // test a file which doesn't exist
+ {
+ directory_entry ent;
+
+ std::error_code ec = GetTestEC();
+ ent.assign(StaticEnv::DNE, ec);
+ TEST_REQUIRE(ent.path() == StaticEnv::DNE);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ExceptionChecker Checker(StaticEnv::DNE,
+ std::errc::no_such_file_or_directory,
+ "directory_entry::last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ }
+ // test a dead symlink
+ {
+ directory_entry ent;
+
+ std::error_code ec = GetTestEC();
+ file_time_type expect_bad = last_write_time(StaticEnv::BadSymlink, ec);
+ TEST_CHECK(expect_bad == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ec = GetTestEC();
+ ent.assign(StaticEnv::BadSymlink, ec);
+ TEST_REQUIRE(ent.path() == StaticEnv::BadSymlink);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect_bad);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+
+ ExceptionChecker Checker(StaticEnv::BadSymlink,
+ std::errc::no_such_file_or_directory,
+ "directory_entry::last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ }
+ // test a file w/o appropriate permissions.
+ {
+ directory_entry ent;
+ file_time_type expect_good = last_write_time(file);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(file, ec);
+ TEST_REQUIRE(ent.path() == file);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(file, std::errc::permission_denied,
+ "last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.last_write_time());
+ }
+ permissions(dir, old_perms);
+ // test a symlink w/o appropriate permissions.
+ {
+ directory_entry ent;
+ file_time_type expect_good = last_write_time(sym_in_dir);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_in_dir, ec);
+ TEST_REQUIRE(ent.path() == sym_in_dir);
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
+ "last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.last_write_time());
+ }
+ permissions(dir, old_perms);
+ // test a symlink to a file w/o appropriate permissions
+ {
+ directory_entry ent;
+ file_time_type expect_good = last_write_time(sym_out_of_dir);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ ent.assign(sym_out_of_dir, ec);
+ TEST_REQUIRE(ent.path() == sym_out_of_dir);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied,
+ "last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+
+ permissions(dir, old_perms);
+ ec = GetTestEC();
+ TEST_CHECK(ent.last_write_time(ec) == expect_good);
+ TEST_CHECK(!ec);
+ TEST_CHECK_NO_THROW(ent.last_write_time());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/path.pass.cpp
index d228a3d92641..2abb13df1f88 100644
--- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/path.pass.cpp
@@ -9,18 +9,17 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_entry
// const path& path() const noexcept;
// operator const path&() const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
-namespace fs = std::experimental::filesystem;
void test_path_method() {
using namespace fs;
diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp
new file mode 100644
index 000000000000..ec654468b9ae
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class directory_entry
+
+// file_status status() const;
+// file_status status(error_code const&) const noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "filesystem_test_helper.hpp"
+#include "rapid-cxx-test.hpp"
+
+TEST_SUITE(directory_entry_status_testsuite)
+
+TEST_CASE(test_basic) {
+ using namespace fs;
+ {
+ const fs::directory_entry e("foo");
+ std::error_code ec;
+ static_assert(std::is_same<decltype(e.status()), fs::file_status>::value, "");
+ static_assert(std::is_same<decltype(e.status(ec)), fs::file_status>::value, "");
+ static_assert(noexcept(e.status()) == false, "");
+ static_assert(noexcept(e.status(ec)) == true, "");
+ }
+ path TestCases[] = {StaticEnv::File, StaticEnv::Dir, StaticEnv::SymlinkToFile,
+ StaticEnv::DNE};
+ for (const auto& p : TestCases) {
+ const directory_entry e(p);
+ std::error_code pec = GetTestEC(), eec = GetTestEC(1);
+ file_status ps = fs::status(p, pec);
+ file_status es = e.status(eec);
+ TEST_CHECK(ps.type() == es.type());
+ TEST_CHECK(ps.permissions() == es.permissions());
+ TEST_CHECK(pec == eec);
+ }
+ for (const auto& p : TestCases) {
+ const directory_entry e(p);
+ file_status ps = fs::status(p);
+ file_status es = e.status();
+ TEST_CHECK(ps.type() == es.type());
+ TEST_CHECK(ps.permissions() == es.permissions());
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp
index 3a99eb671b44..e8850c3a7b15 100644
--- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp
@@ -9,20 +9,23 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_entry
// file_status symlink_status() const;
// file_status symlink_status(error_code&) const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "filesystem_test_helper.hpp"
+#include "rapid-cxx-test.hpp"
-int main() {
+TEST_SUITE(directory_entry_obs_suite)
+
+TEST_CASE(test_signature) {
using namespace fs;
{
const directory_entry e("foo");
@@ -32,19 +35,24 @@ int main() {
static_assert(noexcept(e.symlink_status()) == false, "");
static_assert(noexcept(e.symlink_status(ec)) == true, "");
}
- auto TestFn = [](path const& p) {
+ path TestCases[] = {StaticEnv::File, StaticEnv::Dir, StaticEnv::SymlinkToFile,
+ StaticEnv::DNE};
+ for (const auto& p : TestCases) {
const directory_entry e(p);
- std::error_code pec, eec;
+ std::error_code pec = GetTestEC(), eec = GetTestEC(1);
file_status ps = fs::symlink_status(p, pec);
file_status es = e.symlink_status(eec);
- assert(ps.type() == es.type());
- assert(ps.permissions() == es.permissions());
- assert(pec == eec);
- };
- {
- TestFn(StaticEnv::File);
- TestFn(StaticEnv::Dir);
- TestFn(StaticEnv::SymlinkToFile);
- TestFn(StaticEnv::DNE);
+ TEST_CHECK(ps.type() == es.type());
+ TEST_CHECK(ps.permissions() == es.permissions());
+ TEST_CHECK(pec == eec);
+ }
+ for (const auto& p : TestCases) {
+ const directory_entry e(p);
+ file_status ps = fs::symlink_status(p);
+ file_status es = e.symlink_status();
+ TEST_CHECK(ps.type() == es.type());
+ TEST_CHECK(ps.permissions() == es.permissions());
}
}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp
index 5c4583391e74..ac224ac7ae63 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator(directory_iterator const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_copy_construct_tests)
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp
index 0d5ebf3ebe96..3f08e4024de5 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator& operator=(directory_iterator const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_copy_assign_tests)
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
index 4fd60887b54c..0a33544c547d 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
@@ -18,7 +18,7 @@
// directory_iterator(const path& p, error_code& ec);
// directory_iterator(const path& p, directory_options options, error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -27,7 +27,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_constructor_tests)
@@ -86,7 +86,7 @@ TEST_CASE(test_construction_from_bad_path)
TEST_CASE(access_denied_test_case)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
path const testDir = env.make_env_path("dir1");
path const testFile = testDir / "testFile";
@@ -122,7 +122,7 @@ TEST_CASE(access_denied_test_case)
TEST_CASE(access_denied_to_file_test_case)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
path const testFile = env.make_env_path("file1");
env.create_file(testFile, 42);
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
index 94ace185a6aa..21c4ed3b7237 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator::directory_iterator() noexcept
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
int main() {
{
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp
index 8d888717b101..7ec814b214e2 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator& operator++();
// directory_iterator& increment(error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -26,7 +26,7 @@
#include "filesystem_test_helper.hpp"
#include <iostream>
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_increment_tests)
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp
index f6c94e18eb0e..a2bf2ac9f2c0 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator(directory_iterator&&) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_move_construct_tests)
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp
index 445f05a3c3e1..1c7224344027 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator& operator=(directory_iterator const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -30,7 +30,7 @@
#pragma clang diagnostic ignored "-Wself-move"
#endif
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_move_assign_tests)
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp
index f93a18452189..71e8e55ae034 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
// directory_iterator begin(directory_iterator iter) noexcept;
// directory_iterator end(directory_iterator iter) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -26,7 +26,7 @@
#include "filesystem_test_helper.hpp"
#include <iostream>
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(directory_iterator_begin_end_tests)
diff --git a/test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp
index dad278f43d79..4619083e8c37 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp
+++ b/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
@@ -19,13 +19,12 @@
// typedef ... reference;
// typedef ... iterator_category
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp b/test/std/input.output/filesystems/class.file_status/file_status.cons.pass.cpp
index a744e659f5b5..6676c7b7d6ab 100644
--- a/test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp
+++ b/test/std/input.output/filesystems/class.file_status/file_status.cons.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class file_status
// explicit file_status() noexcept;
// explicit file_status(file_type, perms prms = perms::unknown) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_convertible.hpp"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp b/test/std/input.output/filesystems/class.file_status/file_status.mods.pass.cpp
index 8681b2dc50d6..4cbf2062a1f7 100644
--- a/test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp
+++ b/test/std/input.output/filesystems/class.file_status/file_status.mods.pass.cpp
@@ -9,18 +9,17 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class file_status
// void type(file_type) noexcept;
// void permissions(perms) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp b/test/std/input.output/filesystems/class.file_status/file_status.obs.pass.cpp
index 4113dee453dc..89739b77df57 100644
--- a/test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp
+++ b/test/std/input.output/filesystems/class.file_status/file_status.obs.pass.cpp
@@ -9,18 +9,17 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class file_status
// file_type type() const noexcept;
// perms permissions(p) const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp b/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp
index 68b67ed72803..b7484df5cc78 100644
--- a/test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp
+++ b/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class filesystem_error
@@ -21,13 +21,12 @@
// const path& path1() const noexcept;
// const path& path2() const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
void test_constructors() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp b/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp
index 12330ebb5ca8..b7a0383e0472 100644
--- a/test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -19,7 +19,7 @@
// path(InputIterator first, InputIterator last);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <iterator>
#include <type_traits>
#include <cassert>
@@ -27,7 +27,6 @@
#include "test_macros.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
template <class It>
@@ -84,14 +83,14 @@ void checkBeginEndBasic() {
}
{
path p("//root_name//first_dir////second_dir");
- const path expect[] = {"//root_name", "/", "first_dir", "second_dir"};
+ const path expect[] = {"/", "root_name", "first_dir", "second_dir"};
assert(checkCollectionsEqual(p.begin(), p.end(), std::begin(expect), std::end(expect)));
assert(checkCollectionsEqualBackwards(p.begin(), p.end(), std::begin(expect), std::end(expect)));
}
{
path p("////foo/bar/baz///");
- const path expect[] = {"/", "foo", "bar", "baz", "."};
+ const path expect[] = {"/", "foo", "bar", "baz", ""};
assert(checkCollectionsEqual(p.begin(), p.end(), std::begin(expect), std::end(expect)));
assert(checkCollectionsEqualBackwards(p.begin(), p.end(), std::begin(expect), std::end(expect)));
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
index a6172d1981cf..a02ef18c453d 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -22,7 +22,7 @@
// path& append(InputIterator first, InputIterator last);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <string_view>
#include <cassert>
@@ -31,8 +31,8 @@
#include "test_iterators.h"
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
+#include "verbose_assert.h"
-namespace fs = std::experimental::filesystem;
struct AppendOperatorTestcase {
MultiStringType lhs;
@@ -46,13 +46,22 @@ const AppendOperatorTestcase Cases[] =
{S(""), S(""), S("")}
, {S("p1"), S("p2"), S("p1/p2")}
, {S("p1/"), S("p2"), S("p1/p2")}
- , {S("p1"), S("/p2"), S("p1/p2")}
- , {S("p1/"), S("/p2"), S("p1//p2")}
+ , {S("p1"), S("/p2"), S("/p2")}
+ , {S("p1/"), S("/p2"), S("/p2")}
, {S("p1"), S("\\p2"), S("p1/\\p2")}
, {S("p1\\"), S("p2"), S("p1\\/p2")}
, {S("p1\\"), S("\\p2"), S("p1\\/\\p2")}
- , {S("p1"), S(""), S("p1")}
, {S(""), S("p2"), S("p2")}
+ , {S("/p1"), S("p2"), S("/p1/p2")}
+ , {S("/p1"), S("/p2"), S("/p2")}
+ , {S("/p1/p3"), S("p2"), S("/p1/p3/p2")}
+ , {S("/p1/p3/"), S("p2"), S("/p1/p3/p2")}
+ , {S("/p1/"), S("p2"), S("/p1/p2")}
+ , {S("/p1/p3/"), S("/p2/p4"), S("/p2/p4")}
+ , {S("/"), S(""), S("/")}
+ , {S("/p1"), S("/p2/"), S("/p2/")}
+ , {S("p1"), S(""), S("p1/")}
+ , {S("p1/"), S(""), S("p1/")}
};
@@ -60,7 +69,8 @@ const AppendOperatorTestcase LongLHSCases[] =
{
{S("p1"), S("p2"), S("p1/p2")}
, {S("p1/"), S("p2"), S("p1/p2")}
- , {S("p1"), S("/p2"), S("p1/p2")}
+ , {S("p1"), S("/p2"), S("/p2")}
+ , {S("/p1"), S("p2"), S("/p1/p2")}
};
#undef S
@@ -99,7 +109,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
DisableAllocationGuard g;
LHS /= RHS;
}
- assert(LHS == E);
+ ASSERT_PRED(PathEq, LHS , E);
}
// basic_string_view
{
@@ -109,7 +119,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
DisableAllocationGuard g;
LHS /= RHS;
}
- assert(LHS == E);
+ assert(PathEq(LHS, E));
}
// CharT*
{
@@ -119,7 +129,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
DisableAllocationGuard g;
LHS /= RHS;
}
- assert(LHS == E);
+ assert(PathEq(LHS, E));
}
{
path LHS(L); PathReserve(LHS, ReserveSize);
@@ -128,7 +138,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
DisableAllocationGuard g;
LHS.append(RHS, StrEnd(RHS));
}
- assert(LHS == E);
+ assert(PathEq(LHS, E));
}
// input iterator - For non-native char types, appends needs to copy the
// iterator range into a contiguous block of memory before it can perform the
@@ -144,7 +154,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
if (DisableAllocations) g.requireExactly(0);
LHS /= RHS;
}
- assert(LHS == E);
+ assert(PathEq(LHS, E));
}
{
path LHS(L); PathReserve(LHS, ReserveSize);
@@ -155,7 +165,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
if (DisableAllocations) g.requireExactly(0);
LHS.append(RHS, REnd);
}
- assert(LHS == E);
+ assert(PathEq(LHS, E));
}
}
@@ -172,17 +182,18 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
const Ptr E = TC.expect;
// basic_string
{
- path LHS(L);
+ path Result(L);
Str RHS(R);
- path& Ref = (LHS /= RHS);
- assert(LHS == E);
- assert(&Ref == &LHS);
+ path& Ref = (Result /= RHS);
+ ASSERT_EQ(Result, E)
+ << DISPLAY(L) << DISPLAY(R);
+ assert(&Ref == &Result);
}
{
path LHS(L);
Str RHS(R);
path& Ref = LHS.append(RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
// basic_string_view
@@ -190,14 +201,14 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
path LHS(L);
StrView RHS(R);
path& Ref = (LHS /= RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
{
path LHS(L);
StrView RHS(R);
path& Ref = LHS.append(RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
// Char*
@@ -205,21 +216,22 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
path LHS(L);
Str RHS(R);
path& Ref = (LHS /= RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
{
path LHS(L);
Ptr RHS(R);
path& Ref = LHS.append(RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
{
path LHS(L);
Ptr RHS(R);
path& Ref = LHS.append(RHS, StrEnd(RHS));
- assert(LHS == E);
+ ASSERT_PRED(PathEq, LHS, E)
+ << DISPLAY(L) << DISPLAY(R);
assert(&Ref == &LHS);
}
// iterators
@@ -227,13 +239,13 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
path LHS(L);
InputIter RHS(R);
path& Ref = (LHS /= RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
{
path LHS(L); InputIter RHS(R);
path& Ref = LHS.append(RHS);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
{
@@ -241,7 +253,7 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
InputIter RHS(R);
InputIter REnd(StrEnd(R));
path& Ref = LHS.append(RHS, REnd);
- assert(LHS == E);
+ assert(PathEq(LHS, E));
assert(&Ref == &LHS);
}
}
@@ -305,11 +317,14 @@ int main()
using namespace fs;
for (auto const & TC : Cases) {
{
- path LHS((const char*)TC.lhs);
- path RHS((const char*)TC.rhs);
- path& Ref = (LHS /= RHS);
- assert(LHS == (const char*)TC.expect);
- assert(&Ref == &LHS);
+ const char* LHS_In = TC.lhs;
+ const char* RHS_In = TC.rhs;
+ path LHS(LHS_In);
+ path RHS(RHS_In);
+ path& Res = (LHS /= RHS);
+ ASSERT_PRED(PathEq, Res, (const char*)TC.expect)
+ << DISPLAY(LHS_In) << DISPLAY(RHS_In);
+ assert(&Res == &LHS);
}
doAppendSourceTest<char> (TC);
doAppendSourceTest<wchar_t> (TC);
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/braced_init.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp
index c5da52f65248..fe677c3e6540 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.assign/braced_init.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& operator=(path const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "count_new.hpp"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
index 5c26f8464c12..a0575e649d61 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& operator=(path const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
index 7263424ad252..71fa47d1b9de 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& operator=(path&&) noexcept
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "count_new.hpp"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
index 8c31ef51d944..92eff6e078a0 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -22,7 +22,7 @@
// path& assign(InputIterator first, InputIterator last);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <string_view>
#include <cassert>
@@ -33,7 +33,6 @@
#include "filesystem_test_helper.hpp"
#include <iostream>
-namespace fs = std::experimental::filesystem;
template <class CharT>
void RunTestCase(MultiStringType const& MS) {
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
index 69d08e6eb49a..7791097dcd17 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -26,7 +26,8 @@
//
// size_t hash_value(path const&) noexcept;
-#include <experimental/filesystem>
+
+#include "filesystem_include.hpp"
#include <type_traits>
#include <vector>
#include <cassert>
@@ -35,8 +36,7 @@
#include "test_iterators.h"
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-
-namespace fs = std::experimental::filesystem;
+#include "verbose_assert.h"
struct PathCompareTest {
const char* LHS;
@@ -58,8 +58,9 @@ const PathCompareTest CompareTestCases[] =
{"a/b/c", "b/a/c", -1},
{"a/b", "a/b/c", -1},
{"a/b/c", "a/b", 1},
- {"a/b/", "a/b/.", 0},
- {"a/b//////", "a/b/////.", 0},
+ {"a/b/", "a/b/.", -1},
+ {"a/b/", "a/b", 1},
+ {"a/b//////", "a/b/////.", -1},
{"a/.././b", "a///..//.////b", 0},
{"//foo//bar///baz////", "//foo/bar/baz/", 0}, // duplicate separators
{"///foo/bar", "/foo/bar", 0}, // "///" is not a root directory
@@ -95,8 +96,13 @@ int main()
int ret2 = normalize_ret(p1.compare(R));
int ret3 = normalize_ret(p1.compare(TC.RHS));
int ret4 = normalize_ret(p1.compare(RV));
- assert(ret1 == ret2 && ret1 == ret3 && ret1 == ret4);
- assert(ret1 == E);
+
+ g.release();
+ ASSERT_EQ(ret1, ret2);
+ ASSERT_EQ(ret1, ret3);
+ ASSERT_EQ(ret1, ret4);
+ ASSERT_EQ(ret1, E)
+ << DISPLAY(TC.LHS) << DISPLAY(TC.RHS);
// check signatures
ASSERT_NOEXCEPT(p1.compare(p2));
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
index 76df0e9eef76..03d5134fe090 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -28,7 +28,7 @@
// path& concat(InputIterator first, InputIterator last);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <string>
#include <string_view>
@@ -39,7 +39,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
struct ConcatOperatorTestcase {
MultiStringType lhs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
index 67b8a04049ec..69bdb74159fd 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path(path const&)
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/default.pass.cpp
index f26504616d50..aa4b03e9bc3f 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/default.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path() noexcept
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
index b8ac4b307005..2e8cce22880a 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path(path&&) noexcept
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "count_new.hpp"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
index a04f35af5780..39d63f456e95 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -19,7 +19,7 @@
// path(InputIterator first, InputIterator last);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -28,10 +28,9 @@
#include "min_allocator.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
-template <class CharT>
-void RunTestCase(MultiStringType const& MS) {
+template <class CharT, class ...Args>
+void RunTestCaseImpl(MultiStringType const& MS, Args... args) {
using namespace fs;
const char* Expect = MS;
const CharT* TestPath = MS;
@@ -42,44 +41,52 @@ void RunTestCase(MultiStringType const& MS) {
// StringTypes
{
const std::basic_string<CharT> S(TestPath);
- path p(S);
+ path p(S, args...);
assert(p.native() == Expect);
assert(p.string<CharT>() == TestPath);
assert(p.string<CharT>() == S);
}
{
const std::basic_string_view<CharT> S(TestPath);
- path p(S);
+ path p(S, args...);
assert(p.native() == Expect);
assert(p.string<CharT>() == TestPath);
assert(p.string<CharT>() == S);
}
// Char* pointers
{
- path p(TestPath);
+ path p(TestPath, args...);
assert(p.native() == Expect);
assert(p.string<CharT>() == TestPath);
}
{
- path p(TestPath, TestPathEnd);
+ path p(TestPath, TestPathEnd, args...);
assert(p.native() == Expect);
assert(p.string<CharT>() == TestPath);
}
// Iterators
{
using It = input_iterator<const CharT*>;
- path p(It{TestPath});
+ path p(It{TestPath}, args...);
assert(p.native() == Expect);
assert(p.string<CharT>() == TestPath);
}
{
using It = input_iterator<const CharT*>;
- path p(It{TestPath}, It{TestPathEnd});
+ path p(It{TestPath}, It{TestPathEnd}, args...);
assert(p.native() == Expect);
assert(p.string<CharT>() == TestPath);
}
}
+template <class CharT, class ...Args>
+void RunTestCase(MultiStringType const& MS) {
+ RunTestCaseImpl<CharT>(MS);
+ RunTestCaseImpl<CharT>(MS, fs::path::format::auto_format);
+ RunTestCaseImpl<CharT>(MS, fs::path::format::native_format);
+ RunTestCaseImpl<CharT>(MS, fs::path::format::generic_format);
+}
+
void test_sfinae() {
using namespace fs;
{
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp b/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp
index 7e1fea7d34d2..1a722d7a2a0c 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp
@@ -8,7 +8,7 @@
//
//===----------------------------------------------------------------------===//
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -17,12 +17,12 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
int main ()
{
- std::experimental::filesystem::path c;
+ fs::path c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp
index 267d4932c316..4eb15cd0bf26 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -44,7 +44,7 @@
// iterator end() const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <vector>
#include <cassert>
@@ -53,8 +53,15 @@
#include "test_iterators.h"
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
+#include "assert_checkpoint.h"
+#include "verbose_assert.h"
+
+struct ComparePathExact {
+ bool operator()(std::string const& LHS, std::string const& RHS) const {
+ return LHS == RHS;
+ }
+};
-namespace fs = std::experimental::filesystem;
struct PathDecomposeTestcase
{
std::string raw;
@@ -73,80 +80,89 @@ const PathDecomposeTestcase PathTestCases[] =
, {".", {"."}, "", "", "", ".", "", "."}
, {"..", {".."}, "", "", "", "..", "", ".."}
, {"foo", {"foo"}, "", "", "", "foo", "", "foo"}
- , {"/", {"/"}, "/", "", "/", "", "", "/"}
+ , {"/", {"/"}, "/", "", "/", "", "/", ""}
, {"/foo", {"/", "foo"}, "/", "", "/", "foo", "/", "foo"}
- , {"foo/", {"foo", "."}, "", "", "", "foo/", "foo", "."}
- , {"/foo/", {"/", "foo", "."}, "/", "", "/", "foo/", "/foo", "."}
+ , {"foo/", {"foo", ""}, "", "", "", "foo/", "foo", ""}
+ , {"/foo/", {"/", "foo", ""}, "/", "", "/", "foo/", "/foo", ""}
, {"foo/bar", {"foo","bar"}, "", "", "", "foo/bar", "foo", "bar"}
, {"/foo//bar", {"/","foo","bar"}, "/", "", "/", "foo/bar", "/foo", "bar"}
- , {"//net", {"//net"}, "//net", "//net", "", "", "", "//net"}
- , {"//net/foo", {"//net", "/", "foo"}, "//net/", "//net", "/", "foo", "//net/", "foo"}
- , {"///foo///", {"/", "foo", "."}, "/", "", "/", "foo///", "///foo", "."}
+ , {"//net", {"/", "net"}, "/", "", "/", "net", "/", "net"}
+ , {"//net/foo", {"/", "net", "foo"}, "/", "", "/", "net/foo", "/net", "foo"}
+ , {"///foo///", {"/", "foo", ""}, "/", "", "/", "foo///", "///foo", ""}
, {"///foo///bar", {"/", "foo", "bar"}, "/", "", "/", "foo///bar", "///foo", "bar"}
, {"/.", {"/", "."}, "/", "", "/", ".", "/", "."}
- , {"./", {".", "."}, "", "", "", "./", ".", "."}
+ , {"./", {".", ""}, "", "", "", "./", ".", ""}
, {"/..", {"/", ".."}, "/", "", "/", "..", "/", ".."}
- , {"../", {"..", "."}, "", "", "", "../", "..", "."}
+ , {"../", {"..", ""}, "", "", "", "../", "..", ""}
, {"foo/.", {"foo", "."}, "", "", "", "foo/.", "foo", "."}
, {"foo/..", {"foo", ".."}, "", "", "", "foo/..", "foo", ".."}
- , {"foo/./", {"foo", ".", "."}, "", "", "", "foo/./", "foo/.", "."}
+ , {"foo/./", {"foo", ".", ""}, "", "", "", "foo/./", "foo/.", ""}
, {"foo/./bar", {"foo", ".", "bar"}, "", "", "", "foo/./bar", "foo/.", "bar"}
- , {"foo/../", {"foo", "..", "."}, "", "", "", "foo/../", "foo/..", "."}
+ , {"foo/../", {"foo", "..", ""}, "", "", "", "foo/../", "foo/..", ""}
, {"foo/../bar", {"foo", "..", "bar"}, "", "", "", "foo/../bar", "foo/..", "bar"}
, {"c:", {"c:"}, "", "", "", "c:", "", "c:"}
- , {"c:/", {"c:", "."}, "", "", "", "c:/", "c:", "."}
+ , {"c:/", {"c:", ""}, "", "", "", "c:/", "c:", ""}
, {"c:foo", {"c:foo"}, "", "", "", "c:foo", "", "c:foo"}
, {"c:/foo", {"c:", "foo"}, "", "", "", "c:/foo", "c:", "foo"}
- , {"c:foo/", {"c:foo", "."}, "", "", "", "c:foo/", "c:foo", "."}
- , {"c:/foo/", {"c:", "foo", "."}, "", "", "", "c:/foo/", "c:/foo", "."}
+ , {"c:foo/", {"c:foo", ""}, "", "", "", "c:foo/", "c:foo", ""}
+ , {"c:/foo/", {"c:", "foo", ""}, "", "", "", "c:/foo/", "c:/foo", ""}
, {"c:/foo/bar", {"c:", "foo", "bar"}, "", "", "", "c:/foo/bar", "c:/foo", "bar"}
, {"prn:", {"prn:"}, "", "", "", "prn:", "", "prn:"}
, {"c:\\", {"c:\\"}, "", "", "", "c:\\", "", "c:\\"}
, {"c:\\foo", {"c:\\foo"}, "", "", "", "c:\\foo", "", "c:\\foo"}
, {"c:foo\\", {"c:foo\\"}, "", "", "", "c:foo\\", "", "c:foo\\"}
, {"c:\\foo\\", {"c:\\foo\\"}, "", "", "", "c:\\foo\\", "", "c:\\foo\\"}
- , {"c:\\foo/", {"c:\\foo", "."}, "", "", "", "c:\\foo/", "c:\\foo", "."}
+ , {"c:\\foo/", {"c:\\foo", ""}, "", "", "", "c:\\foo/", "c:\\foo", ""}
, {"c:/foo\\bar", {"c:", "foo\\bar"}, "", "", "", "c:/foo\\bar", "c:", "foo\\bar"}
- , {"//", {"//"}, "//", "//", "", "", "", "//"}
+ , {"//", {"/"}, "/", "", "/", "", "/", ""}
};
void decompPathTest()
{
using namespace fs;
for (auto const & TC : PathTestCases) {
- path p(TC.raw);
- assert(p == TC.raw);
+ CHECKPOINT(TC.raw.c_str());
+ fs::path p(TC.raw);
+ ASSERT(p == TC.raw);
- assert(p.root_path() == TC.root_path);
- assert(p.has_root_path() != TC.root_path.empty());
+ ASSERT_EQ(p.root_path(), TC.root_path);
+ ASSERT_NEQ(p.has_root_path(), TC.root_path.empty());
- assert(p.root_name() == TC.root_name);
- assert(p.has_root_name() != TC.root_name.empty());
+ ASSERT(p.root_name().native().empty())
+ << DISPLAY(p.root_name());
+ ASSERT_EQ(p.root_name(),TC.root_name);
+ ASSERT_NEQ(p.has_root_name(), TC.root_name.empty());
- assert(p.root_directory() == TC.root_directory);
- assert(p.has_root_directory() != TC.root_directory.empty());
+ ASSERT_EQ(p.root_directory(), TC.root_directory);
+ ASSERT_NEQ(p.has_root_directory(), TC.root_directory.empty());
- assert(p.relative_path() == TC.relative_path);
- assert(p.has_relative_path() != TC.relative_path.empty());
+ ASSERT_EQ(p.relative_path(), TC.relative_path);
+ ASSERT_NEQ(p.has_relative_path(), TC.relative_path.empty());
- assert(p.parent_path() == TC.parent_path);
- assert(p.has_parent_path() != TC.parent_path.empty());
+ ASSERT_EQ(p.parent_path(), TC.parent_path);
+ ASSERT_NEQ(p.has_parent_path(), TC.parent_path.empty());
- assert(p.filename() == TC.filename);
- assert(p.has_filename() != TC.filename.empty());
+ ASSERT_EQ(p.filename(), TC.filename);
+ ASSERT_NEQ(p.has_filename(), TC.filename.empty());
- assert(p.is_absolute() == p.has_root_directory());
- assert(p.is_relative() != p.is_absolute());
+ ASSERT_EQ(p.is_absolute(), p.has_root_directory());
+ ASSERT_NEQ(p.is_relative(), p.is_absolute());
+ if (p.empty())
+ ASSERT(p.is_relative());
- assert(checkCollectionsEqual(p.begin(), p.end(),
- TC.elements.begin(), TC.elements.end()));
+ ASSERT_COLLECTION_EQ_COMP(
+ p.begin(), p.end(),
+ TC.elements.begin(), TC.elements.end(),
+ ComparePathExact()
+ );
// check backwards
std::vector<fs::path> Parts;
for (auto it = p.end(); it != p.begin(); )
Parts.push_back(*--it);
- assert(checkCollectionsEqual(Parts.begin(), Parts.end(),
- TC.elements.rbegin(), TC.elements.rend()));
+ ASSERT_COLLECTION_EQ_COMP(Parts.begin(), Parts.end(),
+ TC.elements.rbegin(), TC.elements.rend(),
+ ComparePathExact());
}
}
@@ -164,10 +180,12 @@ const FilenameDecompTestcase FilenameTestCases[] =
{"", "", "", ""}
, {".", ".", ".", ""}
, {"..", "..", "..", ""}
- , {"/", "/", "/", ""}
+ , {"/", "", "", ""}
, {"foo", "foo", "foo", ""}
, {"/foo/bar.txt", "bar.txt", "bar", ".txt"}
, {"foo..txt", "foo..txt", "foo.", ".txt"}
+ , {".profile", ".profile", ".profile", ""}
+ , {".profile.txt", ".profile.txt", ".profile", ".txt"}
};
@@ -175,18 +193,19 @@ void decompFilenameTest()
{
using namespace fs;
for (auto const & TC : FilenameTestCases) {
- path p(TC.raw);
- assert(p == TC.raw);
+ CHECKPOINT(TC.raw.c_str());
+ fs::path p(TC.raw);
+ ASSERT_EQ(p, TC.raw);
ASSERT_NOEXCEPT(p.empty());
- assert(p.filename() == TC.filename);
- assert(p.has_filename() != TC.filename.empty());
+ ASSERT_EQ(p.filename(), TC.filename);
+ ASSERT_NEQ(p.has_filename(), TC.filename.empty());
- assert(p.stem() == TC.stem);
- assert(p.has_stem() != TC.stem.empty());
+ ASSERT_EQ(p.stem(), TC.stem);
+ ASSERT_NEQ(p.has_stem(), TC.stem.empty());
- assert(p.extension() == TC.extension);
- assert(p.has_extension() != TC.extension.empty());
+ ASSERT_EQ(p.extension(), TC.extension);
+ ASSERT_NEQ(p.has_extension(), TC.extension.empty());
}
}
diff --git a/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp
new file mode 100644
index 000000000000..3e2fdd08de15
--- /dev/null
+++ b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp
@@ -0,0 +1,142 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class path
+
+// path lexically_normal() const;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <vector>
+#include <iostream>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "filesystem_test_helper.hpp"
+
+
+int main() {
+ // clang-format off
+ struct {
+ std::string input;
+ std::string expect;
+ } TestCases[] = {
+ {"", ""},
+ {"/a/b/c", "/a/b/c"},
+ {"/a/b//c", "/a/b/c"},
+ {"foo/./bar/..", "foo/"},
+ {"foo/.///bar/../", "foo/"},
+ {"/a/b/", "/a/b/"},
+ {"a/b", "a/b"},
+ {"a/b/.", "a/b/"},
+ {"a/b/./", "a/b/"},
+ {"a/..", "."},
+ {".", "."},
+ {"./", "."},
+ {"./.", "."},
+ {"./..", ".."},
+ {"..", ".."},
+ {"../..", "../.."},
+ {"/../", "/"},
+ {"/../..", "/"},
+ {"/../../", "/"},
+ {"..", ".."},
+ {"../", ".."},
+ {"/a/b/c/../", "/a/b/"},
+ {"/a/b/./", "/a/b/"},
+ {"/a/b/c/../d", "/a/b/d"},
+ {"/a/b/c/../d/", "/a/b/d/"},
+ {"//a/", "/a/"},
+ {"//a/b/", "/a/b/"},
+ {"//a/b/.", "/a/b/"},
+ {"//a/..", "/"},
+ ///===---------------------------------------------------------------===//
+ /// Tests specifically for the clauses under [fs.path.generic]p6
+ ///===---------------------------------------------------------------===//
+ // p1: If the path is empty, stop.
+ {"", ""},
+ // p2: Replace each slash character in the root-name with a preferred
+ // separator.
+ {"NO_ROOT_NAME_ON_LINUX", "NO_ROOT_NAME_ON_LINUX"},
+ // p3: Replace each directory-separator with a preferred-separator.
+ // [ Note: The generic pathname grammar ([fs.path.generic]) defines
+ // directory-separator as one or more slashes and preferred-separators.
+ // — end note ]
+ {"/", "/"},
+ {"//", "/"},
+ {"///", "/"},
+ {"a/b", "a/b"},
+ {"a//b", "a/b"},
+ {"a///b", "a/b"},
+ {"a/b/", "a/b/"},
+ {"a/b//", "a/b/"},
+ {"a/b///", "a/b/"},
+ {"///a////b//////", "/a/b/"},
+ // p4: Remove each dot filename and any immediately following directory
+ // separators
+ {"foo/.", "foo/"},
+ {"foo/./bar/.", "foo/bar/"},
+ {"./foo/././bar/./", "foo/bar/"},
+ {".///foo//.////./bar/.///", "foo/bar/"},
+ // p5: As long as any appear, remove a non-dot-dot filename immediately
+ // followed by a directory-separator and a dot-dot filename, along with
+ // any immediately following directory separator.
+ {"foo/..", "."},
+ {"foo/../", "."},
+ {"foo/bar/..", "foo/"},
+ {"foo/bar/../", "foo/"},
+ {"foo/bar/../..", "."},
+ {"foo/bar/../../", "."},
+ {"foo/bar/baz/../..", "foo/"},
+ {"foo/bar/baz/../../", "foo/"},
+ {"foo/bar/./..", "foo/"},
+ {"foo/bar/./../", "foo/"},
+ // p6: If there is a root-directory, remove all dot-dot filenames and any
+ // directory-separators immediately following them. [ Note: These dot-dot
+ // filenames attempt to refer to nonexistent parent directories. — end note ]
+ {"/..", "/"},
+ {"/../", "/"},
+ {"/foo/../..", "/"},
+ {"/../foo", "/foo"},
+ {"/../foo/../..", "/"},
+ // p7: If the last filename is dot-dot, remove any trailing
+ // directory-separator.
+ {"../", ".."},
+ {"../../", "../.."},
+ {"foo/../bar/../..///", ".."},
+ {"foo/../bar/..//..///../", "../.."},
+ // p8: If the path is empty, add a dot
+ {".", "."},
+ {"./", "."},
+ {"foo/..", "."}
+ };
+ // clang-format on
+ int ID = 0;
+ bool Failed = false;
+ for (auto& TC : TestCases) {
+ ++ID;
+ fs::path p(TC.input);
+ const fs::path output = p.lexically_normal();
+ if (!PathEq(output, TC.expect)) {
+ Failed = true;
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Expected: '" << TC.expect << "'\n";
+ std::cerr << " Output: '" << output.native() << "'";
+ std::cerr << std::endl;
+ }
+ }
+ return Failed;
+}
diff --git a/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp
new file mode 100644
index 000000000000..52c577bc8a71
--- /dev/null
+++ b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class path
+
+// path lexically_relative(const path& p) const;
+// path lexically_proximate(const path& p) const;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <vector>
+#include <iostream>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "filesystem_test_helper.hpp"
+
+
+int main() {
+ // clang-format off
+ struct {
+ std::string input;
+ std::string base;
+ std::string expect;
+ } TestCases[] = {
+ {"", "", "."},
+ {"/", "a", ""},
+ {"a", "/", ""},
+ {"//net", "a", ""},
+ {"a", "//net", ""},
+ {"//net/", "//net", ""},
+ {"//net", "//net/", ".."},
+ {"//base", "a", ""},
+ {"a", "a", "."},
+ {"a/b", "a/b", "."},
+ {"a/b/c/", "a/b/c/", "."},
+ {"//net", "//net", "."},
+ {"//net/", "//net/", "."},
+ {"//net/a/b", "//net/a/b", "."},
+ {"/a/d", "/a/b/c", "../../d"},
+ {"/a/b/c", "/a/d", "../b/c"},
+ {"a/b/c", "a", "b/c"},
+ {"a/b/c", "a/b/c/x/y", "../.."},
+ {"a/b/c", "a/b/c", "."},
+ {"a/b", "c/d", "../../a/b"}
+ };
+ // clang-format on
+ int ID = 0;
+ bool Failed = false;
+ for (auto& TC : TestCases) {
+ ++ID;
+ const fs::path p(TC.input);
+ const fs::path output = p.lexically_relative(TC.base);
+ auto ReportErr = [&](const char* Testing, fs::path const& Output,
+ fs::path const& Expected) {
+ Failed = true;
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Testing: " << Testing << "\n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Base: '" << TC.base << "'\n";
+ std::cerr << " Expected: '" << Expected << "'\n";
+ std::cerr << " Output: '" << Output.native() << "'";
+ std::cerr << std::endl;
+ };
+ if (!PathEq(output, TC.expect))
+ ReportErr("path::lexically_relative", output, TC.expect);
+ const fs::path proximate_output = p.lexically_proximate(TC.base);
+ // [path.gen] lexically_proximate
+ // Returns: If the value of lexically_relative(base) is not an empty path,
+ // return it.Otherwise return *this.
+ const fs::path proximate_expected = output.native().empty() ? p
+ : output;
+ if (!PathEq(proximate_expected, proximate_output))
+ ReportErr("path::lexically_proximate", proximate_output, proximate_expected);
+ }
+ return Failed;
+}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
index 47e94c9a213f..93c49a6ab61f 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -18,7 +18,7 @@
// basic_string<ECharT, Traits, Allocator>
// generic_string(const Allocator& a = Allocator()) const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -28,8 +28,6 @@
#include "min_allocator.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
-
MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
index 81d06843640d..d41ab619a893 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -20,7 +20,7 @@
// std::u32string generic_u32string() const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -30,8 +30,6 @@
#include "min_allocator.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
-
MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
int main()
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp
index 7881c9700d6e..fca642647b85 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// void clear() noexcept
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -24,7 +24,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp
index 559538cf0ec4..ec914b1bc485 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& make_preferred()
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -24,7 +24,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
struct MakePreferredTestcase {
const char* value;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp
index e414202bf8ff..b4019e7f2289 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& remove_filename()
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,8 +23,7 @@
#include "test_iterators.h"
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-
-namespace fs = std::experimental::filesystem;
+#include "verbose_assert.h"
struct RemoveFilenameTestcase {
const char* value;
@@ -34,27 +33,29 @@ struct RemoveFilenameTestcase {
const RemoveFilenameTestcase TestCases[] =
{
{"", ""}
- , {"/", ""}
- , {"//", ""}
- , {"///", ""}
+ , {"/", "/"}
+ , {"//", "//"}
+ , {"///", "///"}
, {"\\", ""}
, {".", ""}
, {"..", ""}
, {"/foo", "/"}
- , {"//foo", ""}
- , {"//foo/", ""}
- , {"//foo///", ""}
- , {"///foo", "/"}
- , {"///foo/", "///foo"}
- , {"/foo/", "/foo"}
- , {"/foo/.", "/foo"}
- , {"/foo/..", "/foo"}
- , {"/foo/////", "/foo"}
+ , {"foo/bar", "foo/"}
+ , {"foo/", "foo/"}
+ , {"//foo", "//"}
+ , {"//foo/", "//foo/"}
+ , {"//foo///", "//foo///"}
+ , {"///foo", "///"}
+ , {"///foo/", "///foo/"}
+ , {"/foo/", "/foo/"}
+ , {"/foo/.", "/foo/"}
+ , {"/foo/..", "/foo/"}
+ , {"/foo/////", "/foo/////"}
, {"/foo\\\\", "/"}
- , {"/foo//\\/", "/foo//\\"}
- , {"///foo", "/"}
+ , {"/foo//\\/", "/foo//\\/"}
+ , {"///foo", "///"}
, {"file.txt", ""}
- , {"bar/../baz/./file.txt", "bar/../baz/."}
+ , {"bar/../baz/./file.txt", "bar/../baz/./"}
};
int main()
@@ -65,16 +66,8 @@ int main()
path p(p_orig);
assert(p == TC.value);
path& Ref = (p.remove_filename());
- assert(p == TC.expect);
+ ASSERT_EQ(p, TC.expect) << DISPLAY(p_orig);
assert(&Ref == &p);
- {
- const path parentp = p_orig.parent_path();
- if (parentp == p_orig.root_name()) {
-
- assert(p.empty());
- } else {
- assert(p == parentp);
- }
- }
+ assert(!p.has_filename());
}
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp
index 98f6e9b88ab8..c118b87142a7 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& replace_extension(path const& p = path())
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -24,7 +24,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
struct ReplaceExtensionTestcase {
const char* value;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp
index 66c97218c833..07cd327728fd 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// path& replace_filename()
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,8 +23,8 @@
#include "test_iterators.h"
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-
-namespace fs = std::experimental::filesystem;
+#include "assert_checkpoint.h"
+#include "verbose_assert.h"
struct ReplaceFilenameTestcase {
const char* value;
@@ -37,9 +37,9 @@ const ReplaceFilenameTestcase TestCases[] =
{"/foo", "/bar", "bar"}
, {"/foo", "/", ""}
, {"foo", "bar", "bar"}
- , {"/", "bar", "bar"}
+ , {"/", "/bar", "bar"}
, {"\\", "bar", "bar"}
- , {"///", "bar", "bar"}
+ , {"///", "///bar", "bar"}
, {"\\\\", "bar", "bar"}
, {"\\/\\", "\\/bar", "bar"}
, {".", "bar", "bar"}
@@ -53,9 +53,11 @@ int main()
using namespace fs;
for (auto const & TC : TestCases) {
path p(TC.value);
- assert(p == TC.value);
+ ASSERT_EQ(p, TC.value);
path& Ref = (p.replace_filename(TC.filename));
- assert(p == TC.expect);
+ ASSERT_EQ(p, TC.expect)
+ << DISPLAY(TC.value)
+ << DISPLAY(TC.filename);
assert(&Ref == &p);
// Tests Effects "as-if": remove_filename() append(filename)
{
@@ -63,7 +65,7 @@ int main()
path replace(TC.filename);
p2.remove_filename();
p2 /= replace;
- assert(p2 == p);
+ ASSERT_EQ(p, p2);
}
}
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp
index 04bbe3751a59..eecfe4252517 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// void swap(path& rhs) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -24,7 +24,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
struct SwapTestcase {
const char* value1;
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp
index 796609432727..e035764d2c22 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp
@@ -10,20 +10,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// const value_type* c_str() const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
int main()
{
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp
index 2a83fef9f9e6..bb0f58cab759 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -20,7 +20,7 @@
// std::u32string u32string() const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -30,7 +30,6 @@
#include "min_allocator.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp
index db1326483776..ca02b8680b04 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// const string_type& native() const noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
int main()
{
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp
index 013d26cdb7f6..4f5f77df4035 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp
@@ -10,20 +10,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
// operator string_type() const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
int main()
{
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp
index e98329735000..744ad4df8171 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -18,7 +18,7 @@
// basic_string<ECharT, Traits, Allocator>
// string(const Allocator& a = Allocator()) const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -28,7 +28,6 @@
#include "min_allocator.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
// the SSO is always triggered for strings of size 2.
MultiStringType shortString = MKSTR("a");
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp
index 9cf37d4cd537..be662fcb16c0 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp
index 58983778446a..09498bf2135a 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp
@@ -9,18 +9,17 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// path operator/(path const&, path const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
// This is mainly tested via the member append functions.
int main()
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp
index 28867432c61d..28867432c61d 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
index b03b8008b622..b03b8008b622 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
index 4853994b4950..96b8286d5e1b 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// template <class Source>
// path u8path(Source const&);
// template <class InputIter>
// path u8path(InputIter, InputIter);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -25,7 +25,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
int main()
{
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
index 4b7ad735c7f8..7902289edd8d 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -22,10 +22,11 @@
// operator>>(basic_istream<charT, traits>& is, path& p)
//
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <sstream>
#include <cassert>
+#include <iostream>
#include "test_macros.h"
#include "test_iterators.h"
@@ -35,6 +36,8 @@
MultiStringType InStr = MKSTR("abcdefg/\"hijklmnop\"/qrstuvwxyz/123456789");
MultiStringType OutStr = MKSTR("\"abcdefg/\\\"hijklmnop\\\"/qrstuvwxyz/123456789\"");
+
+
template <class CharT>
void doIOTest() {
using namespace fs;
@@ -56,10 +59,40 @@ void doIOTest() {
}
}
+namespace impl {
+using namespace fs;
+
+template <class Stream, class Tp, class = decltype(std::declval<Stream&>() << std::declval<Tp&>())>
+std::true_type is_ostreamable_imp(int);
+
+template <class Stream, class Tp>
+std::false_type is_ostreamable_imp(long);
+
+template <class Stream, class Tp, class = decltype(std::declval<Stream&>() >> std::declval<Tp&>())>
+std::true_type is_istreamable_imp(int);
+
+template <class Stream, class Tp>
+std::false_type is_istreamable_imp(long);
+
+
+} // namespace impl
+
+template <class Stream, class Tp>
+struct is_ostreamable : decltype(impl::is_ostreamable_imp<Stream, Tp>(0)) {};
+template <class Stream, class Tp>
+struct is_istreamable : decltype(impl::is_istreamable_imp<Stream, Tp>(0)) {};
+
+void test_LWG2989() {
+ static_assert(!is_ostreamable<decltype(std::cout), std::wstring>::value, "");
+ static_assert(!is_ostreamable<decltype(std::wcout), std::string>::value, "");
+ static_assert(!is_istreamable<decltype(std::cin), std::wstring>::value, "");
+ static_assert(!is_istreamable<decltype(std::wcin), std::string>::value, "");
+}
int main() {
doIOTest<char>();
doIOTest<wchar_t>();
//doIOTest<char16_t>();
//doIOTest<char32_t>();
+ test_LWG2989();
}
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp
index 3a9b48b2669a..65be19fdc4cc 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -27,7 +27,7 @@
// passes.
// XFAIL: *
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <sstream>
#include <cassert>
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp
index 8d180463a577..554b5129cc95 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp
@@ -9,11 +9,11 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void swap(path& lhs, path& rhs) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -21,7 +21,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
// NOTE: this is tested in path.members/path.modifiers via the member swap.
int main()
diff --git a/test/std/experimental/filesystem/class.path/synop.pass.cpp b/test/std/input.output/filesystems/class.path/synop.pass.cpp
index 883feb287d06..875f92fb68a2 100644
--- a/test/std/experimental/filesystem/class.path/synop.pass.cpp
+++ b/test/std/input.output/filesystems/class.path/synop.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class path
@@ -17,13 +17,12 @@
// typedef basic_string<value_type> string_type;
// static constexpr value_type preferred_separator = ...;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp
index 4dbd599e543a..40ce491b718d 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// recursive_recursive_directory_iterator(recursive_recursive_directory_iterator const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_copy_construct_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
index 3e9257eac8fa..00c8c35fc0bf 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// recursive_directory_iterator& operator=(recursive_directory_iterator const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_copy_assign_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
index 1469dae049eb..e02d6679c0eb 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class directory_iterator
@@ -20,7 +20,7 @@
// recursive_directory_iterator(const path& p, directory_options options, error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -29,7 +29,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
using RDI = recursive_directory_iterator;
@@ -87,7 +87,7 @@ TEST_CASE(test_construction_from_bad_path)
TEST_CASE(access_denied_test_case)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
path const testDir = env.make_env_path("dir1");
path const testFile = testDir / "testFile";
@@ -124,7 +124,7 @@ TEST_CASE(access_denied_test_case)
TEST_CASE(access_denied_to_file_test_case)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
path const testFile = env.make_env_path("file1");
env.create_file(testFile, 42);
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp
index 676e6f27c886..9b239c6bf441 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// int depth() const
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_depth_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp
index 387c6145b6a5..799494f1be4d 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// void disable_recursion_pending();
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_disable_recursion_pending_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
index ea81ee25313d..bfc818924d18 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// recursive_directory_iterator& operator++();
// recursive_directory_iterator& increment(error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,9 +24,8 @@
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-#include <iostream>
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_increment_tests)
@@ -141,7 +140,7 @@ TEST_CASE(test_follow_symlinks)
TEST_CASE(access_denied_on_recursion_test_case)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
const path testFiles[] = {
env.create_dir("dir1"),
@@ -240,7 +239,7 @@ TEST_CASE(access_denied_on_recursion_test_case)
// See llvm.org/PR35078
TEST_CASE(test_PR35078)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
const path testFiles[] = {
env.create_dir("dir1"),
@@ -256,8 +255,8 @@ TEST_CASE(test_PR35078)
// Change the permissions so we can no longer iterate
permissions(permDeniedDir,
- perms::remove_perms|perms::group_exec
- |perms::owner_exec|perms::others_exec);
+ perms::group_exec|perms::owner_exec|perms::others_exec,
+ perm_options::remove);
const std::error_code eacess_ec =
std::make_error_code(std::errc::permission_denied);
@@ -304,13 +303,25 @@ TEST_CASE(test_PR35078)
TEST_CHECK(*it == nestedFile);
}
}
+ {
+ bool SeenNestedFile = false;
+ recursive_directory_iterator it = SetupState(false, SeenNestedFile);
+ TEST_REQUIRE(it != endIt);
+ TEST_REQUIRE(*it == nestedDir);
+
+ ExceptionChecker Checker(std::errc::permission_denied,
+ "recursive_directory_iterator::operator++()",
+ format_string("attempting recursion into \"%s\"",
+ nestedDir.native()));
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ++it);
+ }
}
// See llvm.org/PR35078
TEST_CASE(test_PR35078_with_symlink)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
const path testFiles[] = {
env.create_dir("dir1"),
@@ -330,8 +341,8 @@ TEST_CASE(test_PR35078_with_symlink)
// Change the permissions so we can no longer iterate
permissions(permDeniedDir,
- perms::remove_perms|perms::group_exec
- |perms::owner_exec|perms::others_exec);
+ perms::group_exec|perms::owner_exec|perms::others_exec,
+ perm_options::remove);
const std::error_code eacess_ec =
std::make_error_code(std::errc::permission_denied);
@@ -347,7 +358,6 @@ TEST_CASE(test_PR35078_with_symlink)
Opts |= directory_options::follow_directory_symlink;
recursive_directory_iterator it(startDir, Opts, ec);
while (!ec && it != endIt && *it != symDir) {
- std::cout << *it << std::endl;
if (*it == nestedFile)
SeenFile3 = true;
it.increment(ec);
@@ -395,7 +405,7 @@ TEST_CASE(test_PR35078_with_symlink)
// See llvm.org/PR35078
TEST_CASE(test_PR35078_with_symlink_file)
{
- using namespace std::experimental::filesystem;
+ using namespace fs;
scoped_test_env env;
const path testFiles[] = {
env.create_dir("dir1"),
@@ -415,8 +425,8 @@ TEST_CASE(test_PR35078_with_symlink_file)
// Change the permissions so we can no longer iterate
permissions(permDeniedDir,
- perms::remove_perms|perms::group_exec
- |perms::owner_exec|perms::others_exec);
+ perms::group_exec|perms::owner_exec|perms::others_exec,
+ perm_options::remove);
const std::error_code eacess_ec =
std::make_error_code(std::errc::permission_denied);
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp
index 16dde66d216e..e258c45e343d 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// recursive_directory_iterator(recursive_directory_iterator&&) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_move_construct_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp
index 915d00267a82..61bb8724bde0 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// recursive_directory_iterator& operator=(recursive_directory_iterator const&);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -30,7 +30,7 @@
#pragma clang diagnostic ignored "-Wself-move"
#endif
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_move_assign_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp
index befa30484c0c..fe6ce5ff36e6 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// void pop();
// void pop(error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_pop_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
index 5a3bdd9d482b..662c11446a26 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// bool recursion_pending() const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_recursion_pending_tests)
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp
index ca5117f0e32f..04bc2dd1d96b 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp
+++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// class recursive_directory_iterator
// recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
// recursive_directory_iterator end(recursive_directory_iterator iter) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <set>
#include <cassert>
@@ -26,7 +26,7 @@
#include "filesystem_test_helper.hpp"
#include <iostream>
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(recursive_directory_iterator_begin_end_tests)
diff --git a/test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp b/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp
index 77b136f3fcad..77b136f3fcad 100644
--- a/test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp
+++ b/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp
diff --git a/test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
index 22f0cb845a72..75477309faeb 100644
--- a/test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp
+++ b/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
@@ -9,18 +9,17 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// enum class copy_options;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "check_bitmask_types.hpp"
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
constexpr fs::copy_options ME(int val) { return static_cast<fs::copy_options>(val); }
diff --git a/test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp
index 7dbf7b2887e8..db40f6de91bb 100644
--- a/test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp
+++ b/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp
@@ -9,11 +9,11 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// enum class directory_options;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include <sys/stat.h>
@@ -21,7 +21,6 @@
#include "test_macros.h"
#include "check_bitmask_types.hpp"
-namespace fs = std::experimental::filesystem;
constexpr fs::directory_options ME(int val) { return static_cast<fs::directory_options>(val); }
diff --git a/test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
index ab94ad2877aa..899ab682042f 100644
--- a/test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp
+++ b/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
@@ -9,17 +9,16 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// enum class file_type;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include "test_macros.h"
-namespace fs = std::experimental::filesystem;
constexpr fs::file_type ME(int val) { return static_cast<fs::file_type>(val); }
diff --git a/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
new file mode 100644
index 000000000000..d4ec48e8480a
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// class path;
+// enum class format;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main() {
+ typedef fs::path::format E;
+ static_assert(std::is_enum<E>::value, "");
+
+ // Check that E is a scoped enum by checking for conversions.
+ typedef std::underlying_type<E>::type UT;
+ static_assert(!std::is_convertible<E, UT>::value, "");
+
+ LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char>::value, "")); // Implementation detail
+
+ static_assert(
+ E::auto_format != E::native_format &&
+ E::auto_format != E::generic_format &&
+ E::native_format != E::generic_format,
+ "Expected enumeration values are not unique");
+}
diff --git a/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp
new file mode 100644
index 000000000000..5af504530def
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// enum class perm_options;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+#include <sys/stat.h>
+
+#include "test_macros.h"
+#include "check_bitmask_types.hpp"
+
+
+constexpr fs::perm_options ME(int val) {
+ return static_cast<fs::perm_options>(val);
+}
+
+int main() {
+ typedef fs::perm_options E;
+ static_assert(std::is_enum<E>::value, "");
+
+ // Check that E is a scoped enum by checking for conversions.
+ typedef std::underlying_type<E>::type UT;
+ static_assert(!std::is_convertible<E, UT>::value, "");
+
+ static_assert(std::is_same<UT, unsigned char >::value, ""); // Implementation detail
+
+ typedef check_bitmask_type<E, E::replace, E::nofollow> BitmaskTester;
+ assert(BitmaskTester::check());
+
+ static_assert(
+ E::replace == ME(1) &&
+ E::add == ME(2) &&
+ E::remove == ME(4) &&
+ E::nofollow == ME(8),
+ "Expected enumeration values do not match");
+}
diff --git a/test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp
index c0b14ba4b9b9..9f2e4e214be3 100644
--- a/test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp
+++ b/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp
@@ -9,11 +9,11 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// enum class perms;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
#include <sys/stat.h>
@@ -21,7 +21,6 @@
#include "test_macros.h"
#include "check_bitmask_types.hpp"
-namespace fs = std::experimental::filesystem;
constexpr fs::perms ME(int val) { return static_cast<fs::perms>(val); }
@@ -60,9 +59,6 @@ int main() {
E::set_gid == ME(02000) &&
E::sticky_bit == ME(01000) &&
E::mask == ME(07777) &&
- E::unknown == ME(0xFFFF) &&
- E::add_perms == ME(0x10000) &&
- E::remove_perms == ME(0x20000) &&
- E::symlink_nofollow == ME(0x40000),
+ E::unknown == ME(0xFFFF),
"Expected enumeration values do not match");
}
diff --git a/test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp b/test/std/input.output/filesystems/fs.error.report/tested_elsewhere.pass.cpp
index b58f5c55b643..b58f5c55b643 100644
--- a/test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp
+++ b/test/std/input.output/filesystems/fs.error.report/tested_elsewhere.pass.cpp
diff --git a/test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp b/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp
index 447fb46e840b..157083a30949 100644
--- a/test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp
+++ b/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp
@@ -9,23 +9,38 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// typedef TrivialClock file_time_type;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <chrono>
#include <type_traits>
+#include "test_macros.h"
+
// system_clock is used because it meets the requirements of TrivialClock,
// and the resolution and range of system_clock should match the operating
// system's file time type.
-typedef std::chrono::system_clock ExpectedClock;
-typedef std::chrono::time_point<ExpectedClock> ExpectedTimePoint;
+
+void test_trivial_clock() {
+ using namespace fs;
+ using Clock = file_time_type::clock;
+ ASSERT_NOEXCEPT(Clock::now());
+ ASSERT_SAME_TYPE(decltype(Clock::now()), file_time_type);
+ ASSERT_SAME_TYPE(Clock::time_point, file_time_type);
+ volatile auto* odr_use = &Clock::is_steady;
+ ((void)odr_use);
+}
+
+void test_time_point_resolution_and_range() {
+ using namespace fs;
+ using Dur = file_time_type::duration;
+ using Period = Dur::period;
+ ASSERT_SAME_TYPE(Period, std::nano);
+}
int main() {
- static_assert(std::is_same<
- std::experimental::filesystem::file_time_type,
- ExpectedTimePoint
- >::value, "");
+ test_trivial_clock();
+ test_time_point_resolution_and_range();
}
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
new file mode 100644
index 000000000000..b2a5794a5dd5
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// path absolute(const path& p, const path& base=current_path());
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+using namespace fs;
+
+TEST_SUITE(filesystem_absolute_path_test_suite)
+
+TEST_CASE(absolute_signature_test)
+{
+ const path p; ((void)p);
+ std::error_code ec;
+ ASSERT_NOT_NOEXCEPT(absolute(p));
+ ASSERT_NOT_NOEXCEPT(absolute(p, ec));
+}
+
+
+TEST_CASE(basic_test)
+{
+ const fs::path cwd = fs::current_path();
+ const struct {
+ std::string input;
+ std::string expect;
+ } TestCases [] = {
+ {"", cwd / ""},
+ {"foo", cwd / "foo"},
+ {"foo/", cwd / "foo/"},
+ {"/already_absolute", "/already_absolute"}
+ };
+ for (auto& TC : TestCases) {
+ std::error_code ec = GetTestEC();
+ const path ret = absolute(TC.input, ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(ret.is_absolute());
+ TEST_CHECK(PathEq(ret, TC.expect));
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
index 407f5b111a83..eb10d9816c6b 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
@@ -9,13 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
-// path canonical(const path& p, const path& base = current_path());
+// path canonical(const path& p);
// path canonical(const path& p, error_code& ec);
-// path canonical(const path& p, const path& base, error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +22,16 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
+
+struct CWDGuard {
+ path OldCWD;
+ CWDGuard() : OldCWD(fs::current_path()) { }
+ ~CWDGuard() { fs::current_path(OldCWD); }
+
+ CWDGuard(CWDGuard const&) = delete;
+ CWDGuard& operator=(CWDGuard const&) = delete;
+};
TEST_SUITE(filesystem_canonical_path_test_suite)
@@ -32,15 +40,14 @@ TEST_CASE(signature_test)
const path p; ((void)p);
std::error_code ec; ((void)ec);
ASSERT_NOT_NOEXCEPT(canonical(p));
- ASSERT_NOT_NOEXCEPT(canonical(p, p));
ASSERT_NOT_NOEXCEPT(canonical(p, ec));
- ASSERT_NOT_NOEXCEPT(canonical(p, p, ec));
}
// There are 4 cases is the proposal for absolute path.
// Each scope tests one of the cases.
TEST_CASE(test_canonical)
{
+ CWDGuard guard;
// has_root_name() && has_root_directory()
const path Root = StaticEnv::Root;
const path RootName = Root.filename();
@@ -65,54 +72,51 @@ TEST_CASE(test_canonical)
{ SymlinkName, StaticEnv::File, StaticEnv::Root}
};
for (auto& TC : testCases) {
- std::error_code ec;
- const path ret = canonical(TC.p, TC.base, ec);
+ std::error_code ec = GetTestEC();
+ fs::current_path(TC.base);
+ const path ret = canonical(TC.p, ec);
TEST_REQUIRE(!ec);
- const path ret2 = canonical(TC.p, TC.base);
- TEST_CHECK(ret == TC.expect);
- TEST_CHECK(ret == ret2);
+ const path ret2 = canonical(TC.p);
+ TEST_CHECK(PathEq(ret, TC.expect));
+ TEST_CHECK(PathEq(ret, ret2));
TEST_CHECK(ret.is_absolute());
}
}
TEST_CASE(test_dne_path)
{
- std::error_code ec;
+ std::error_code ec = GetTestEC();
{
const path ret = canonical(StaticEnv::DNE, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(ret == path{});
- }
- ec.clear();
- {
- const path ret = canonical(StaticEnv::DNE, StaticEnv::Root, ec);
+ TEST_CHECK(ec != GetTestEC());
TEST_REQUIRE(ec);
TEST_CHECK(ret == path{});
}
{
TEST_CHECK_THROW(filesystem_error, canonical(StaticEnv::DNE));
- TEST_CHECK_THROW(filesystem_error, canonical(StaticEnv::DNE, StaticEnv::Root));
}
}
TEST_CASE(test_exception_contains_paths)
{
#ifndef TEST_HAS_NO_EXCEPTIONS
+ CWDGuard guard;
const path p = "blabla/dne";
- const path base = StaticEnv::Root;
try {
- canonical(p, base);
+ canonical(p);
TEST_REQUIRE(false);
} catch (filesystem_error const& err) {
TEST_CHECK(err.path1() == p);
- TEST_CHECK(err.path2() == base);
+ // libc++ provides the current path as the second path in the exception
+ LIBCPP_ONLY(TEST_CHECK(err.path2() == current_path()));
}
+ fs::current_path(StaticEnv::Dir);
try {
canonical(p);
TEST_REQUIRE(false);
} catch (filesystem_error const& err) {
TEST_CHECK(err.path1() == p);
- TEST_CHECK(err.path2() == current_path());
+ LIBCPP_ONLY(TEST_CHECK(err.path2() == StaticEnv::Dir));
}
#endif
}
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
index 8f44e0d5a23b..ba579d0af641 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void copy(const path& from, const path& to);
// void copy(const path& from, const path& to, error_code& ec);
@@ -17,7 +17,7 @@
// void copy(const path& from, const path& to, copy_options options,
// error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cstddef>
#include <cassert>
@@ -26,8 +26,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
using CO = fs::copy_options;
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
new file mode 100644
index 000000000000..a67b431fbc80
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
@@ -0,0 +1,189 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// bool copy_file(const path& from, const path& to);
+// bool copy_file(const path& from, const path& to, error_code& ec) noexcept;
+// bool copy_file(const path& from, const path& to, copy_options options);
+// bool copy_file(const path& from, const path& to, copy_options options,
+// error_code& ec) noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <chrono>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+#include <iostream>
+
+using namespace fs;
+
+using CO = fs::copy_options;
+
+TEST_SUITE(filesystem_copy_file_test_suite)
+
+TEST_CASE(test_signatures) {
+ const path p;
+ ((void)p);
+ const copy_options opts{};
+ ((void)opts);
+ std::error_code ec;
+ ((void)ec);
+ ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p)), bool);
+ ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts)), bool);
+ ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, ec)), bool);
+ ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts, ec)), bool);
+ ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p));
+ ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts));
+ ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, ec));
+ ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts, ec));
+}
+
+TEST_CASE(test_error_reporting) {
+
+ scoped_test_env env;
+ const path file = env.create_file("file1", 42);
+ const path file2 = env.create_file("file2", 55);
+ const path non_regular_file = env.create_fifo("non_reg");
+ const path dne = env.make_env_path("dne");
+
+ { // exists(to) && equivalent(to, from)
+ std::error_code ec;
+ TEST_CHECK(fs::copy_file(file, file, copy_options::overwrite_existing,
+ ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
+ ExceptionChecker Checker(file, file, std::errc::file_exists, "copy_file");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing));
+
+ }
+ { // exists(to) && !(skip_existing | overwrite_existing | update_existing)
+ std::error_code ec;
+ TEST_CHECK(fs::copy_file(file, file2, ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
+ ExceptionChecker Checker(file, file, std::errc::file_exists, "copy_file");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing));
+
+ }
+}
+
+TEST_CASE(non_regular_file_test) {
+ scoped_test_env env;
+ const path fifo = env.create_fifo("fifo");
+ const path dest = env.make_env_path("dest");
+ const path file = env.create_file("file", 42);
+
+ {
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::not_supported));
+ TEST_CHECK(!exists(dest));
+ }
+ {
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing,
+ ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::not_supported));
+ TEST_CHECK(is_fifo(fifo));
+ }
+
+}
+
+TEST_CASE(test_attributes_get_copied) {
+ scoped_test_env env;
+ const path file = env.create_file("file1", 42);
+ const path dest = env.make_env_path("file2");
+ auto st = status(file);
+ perms new_perms = perms::owner_read;
+ permissions(file, new_perms);
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(file, dest, ec) == true);
+ TEST_CHECK(!ec);
+ auto new_st = status(dest);
+ TEST_CHECK(new_st.permissions() == new_perms);
+}
+
+TEST_CASE(copy_dir_test) {
+ scoped_test_env env;
+ const path file = env.create_file("file1", 42);
+ const path dest = env.create_dir("dir1");
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(fs::copy_file(file, dest, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+ ec = GetTestEC();
+ TEST_CHECK(fs::copy_file(dest, file, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+}
+
+TEST_CASE(copy_file) {
+ scoped_test_env env;
+ const path file = env.create_file("file1", 42);
+
+ { // !exists(to)
+ const path dest = env.make_env_path("dest1");
+ std::error_code ec = GetTestEC();
+
+ TEST_REQUIRE(fs::copy_file(file, dest, ec) == true);
+ TEST_CHECK(!ec);
+ TEST_CHECK(file_size(dest) == 42);
+ }
+ { // exists(to) && overwrite_existing
+ const path dest = env.create_file("dest2", 55);
+ permissions(dest, perms::all);
+ permissions(file,
+ perms::group_write | perms::owner_write | perms::others_write,
+ perm_options::remove);
+
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(file, dest, copy_options::overwrite_existing,
+ ec) == true);
+ TEST_CHECK(!ec);
+ TEST_CHECK(file_size(dest) == 42);
+ TEST_CHECK(status(dest).permissions() == status(file).permissions());
+ }
+ { // exists(to) && update_existing
+ using Sec = std::chrono::seconds;
+ const path older = env.create_file("older_file", 1);
+
+ SleepFor(Sec(2));
+ const path from = env.create_file("update_from", 55);
+
+ SleepFor(Sec(2));
+ const path newer = env.create_file("newer_file", 2);
+
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(
+ fs::copy_file(from, older, copy_options::update_existing, ec) == true);
+ TEST_CHECK(!ec);
+ TEST_CHECK(file_size(older) == 55);
+
+ TEST_REQUIRE(
+ fs::copy_file(from, newer, copy_options::update_existing, ec) == false);
+ TEST_CHECK(!ec);
+ TEST_CHECK(file_size(newer) == 2);
+ }
+ { // skip_existing
+ const path file2 = env.create_file("file2", 55);
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(file, file2, copy_options::skip_existing, ec) ==
+ false);
+ TEST_CHECK(!ec);
+ TEST_CHECK(file_size(file2) == 55);
+ }
+}
+
+
+TEST_SUITE_END()
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
new file mode 100644
index 000000000000..61733d526e32
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
@@ -0,0 +1,99 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// REQUIRES: long_tests
+
+// <filesystem>
+
+// bool copy_file(const path& from, const path& to);
+// bool copy_file(const path& from, const path& to, error_code& ec) noexcept;
+// bool copy_file(const path& from, const path& to, copy_options options);
+// bool copy_file(const path& from, const path& to, copy_options options,
+// error_code& ec) noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <chrono>
+#include <cassert>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+using namespace fs;
+
+TEST_SUITE(filesystem_copy_file_test_suite)
+
+static std::string random_hex_chars(uintmax_t size) {
+ std::string data;
+ data.reserve(size);
+ for (uintmax_t I = 0; I < size; ++I)
+ data.push_back(random_utils::random_hex_char());
+ return data;
+}
+
+// This test is intended to test 'sendfile's 2gb limit for a single call, and
+// to ensure that libc++ correctly copies files larger than that limit.
+// However it requires allocating ~5GB of filesystem space. This might not
+// be acceptable on all systems.
+TEST_CASE(large_file) {
+ using namespace fs;
+ constexpr uintmax_t sendfile_size_limit = 2147479552ull;
+ constexpr uintmax_t additional_size = 1024;
+ constexpr uintmax_t test_file_size = sendfile_size_limit + additional_size;
+ static_assert(test_file_size > sendfile_size_limit, "");
+
+ scoped_test_env env;
+
+ // Check that we have more than sufficient room to create the files needed
+ // to perform the test.
+ if (space(env.test_root).available < 3 * test_file_size) {
+ TEST_UNSUPPORTED();
+ }
+
+ // Use python to create a file right at the size limit.
+ const path file = env.create_file("source", sendfile_size_limit);
+ // Create some random data that looks different than the data before the
+ // size limit.
+ const std::string additional_data = random_hex_chars(additional_size);
+ // Append this known data to the end of the source file.
+ {
+ std::ofstream outf(file.native(), std::ios_base::app);
+ TEST_REQUIRE(outf.good());
+ outf << additional_data;
+ TEST_REQUIRE(outf);
+ }
+ TEST_REQUIRE(file_size(file) == test_file_size);
+ const path dest = env.make_env_path("dest");
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(copy_file(file, dest, ec));
+ TEST_CHECK(!ec);
+
+ TEST_REQUIRE(is_regular_file(dest));
+ TEST_CHECK(file_size(dest) == test_file_size);
+
+ // Read the data from the end of the destination file, and ensure it matches
+ // the data at the end of the source file.
+ std::string out_data;
+ out_data.reserve(additional_size);
+ {
+ std::ifstream dest_file(dest.native());
+ TEST_REQUIRE(dest_file);
+ dest_file.seekg(sendfile_size_limit);
+ TEST_REQUIRE(dest_file);
+ dest_file >> out_data;
+ TEST_CHECK(dest_file.eof());
+ }
+ TEST_CHECK(out_data.size() == additional_data.size());
+ TEST_CHECK(out_data == additional_data);
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
index fe4729806772..ee4a9ed4bc5c 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void copy_symlink(const path& existing_symlink, const path& new_symlink);
// void copy_symlink(const path& existing_symlink, const path& new_symlink,
// error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,8 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_copy_symlink_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
index ba060254956f..6b651dfb01e0 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool create_directories(const path& p);
// bool create_directories(const path& p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -22,8 +22,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_create_directories_test_suite)
@@ -34,7 +33,7 @@ TEST_CASE(test_signatures)
ASSERT_SAME_TYPE(decltype(fs::create_directories(p)), bool);
ASSERT_SAME_TYPE(decltype(fs::create_directories(p, ec)), bool);
ASSERT_NOT_NOEXCEPT(fs::create_directories(p));
- ASSERT_NOEXCEPT(fs::create_directories(p, ec));
+ ASSERT_NOT_NOEXCEPT(fs::create_directories(p, ec));
}
TEST_CASE(create_existing_directory)
@@ -67,4 +66,36 @@ TEST_CASE(create_directories_multi_level)
TEST_CHECK(is_directory(dir));
}
+TEST_CASE(create_directory_symlinks) {
+ scoped_test_env env;
+ const path root = env.create_dir("dir");
+ const path sym_dest_dead = env.make_env_path("dead");
+ const path dead_sym = env.create_symlink(sym_dest_dead, "dir/sym_dir");
+ const path target = env.make_env_path("dir/sym_dir/foo");
+ {
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(create_directories(target, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(!exists(sym_dest_dead));
+ TEST_CHECK(!exists(dead_sym));
+ }
+}
+
+
+TEST_CASE(create_directory_through_symlinks) {
+ scoped_test_env env;
+ const path root = env.create_dir("dir");
+ const path sym_dir = env.create_symlink(root, "sym_dir");
+ const path target = env.make_env_path("sym_dir/foo");
+ const path resolved_target = env.make_env_path("dir/foo");
+ TEST_REQUIRE(is_directory(sym_dir));
+ {
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(create_directories(target, ec) == true);
+ TEST_CHECK(!ec);
+ TEST_CHECK(is_directory(target));
+ TEST_CHECK(is_directory(resolved_target));
+ }
+}
+
TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
index 5fce217bc49e..e73e21ffb446 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool create_directory(const path& p);
// bool create_directory(const path& p, error_code& ec) noexcept;
// bool create_directory(const path& p, const path& attr);
// bool create_directory(const path& p, const path& attr, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -27,8 +27,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
fs::perms read_umask() {
mode_t old_mask = umask(0);
@@ -95,9 +94,9 @@ TEST_CASE(dest_is_file)
{
scoped_test_env env;
const path file = env.create_file("file", 42);
- std::error_code ec;
+ std::error_code ec = GetTestEC();
TEST_CHECK(fs::create_directory(file, ec) == false);
- TEST_CHECK(ec);
+ TEST_CHECK(!ec);
TEST_CHECK(is_regular_file(file));
}
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
index c32bdd2d1928..f013bbb203b5 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool create_directory(const path& p, const path& attr);
// bool create_directory(const path& p, const path& attr, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -22,8 +22,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_create_directory_test_suite)
@@ -61,7 +60,7 @@ TEST_CASE(create_directory_one_level)
{
scoped_test_env env;
// Remove setgid which mkdir would inherit
- permissions(env.test_root, perms::remove_perms | perms::set_gid);
+ permissions(env.test_root, perms::set_gid, perm_options::remove);
const path dir = env.make_env_path("dir1");
const path attr_dir = env.create_dir("dir2");
@@ -83,9 +82,9 @@ TEST_CASE(create_directory_multi_level)
const path dir = env.make_env_path("dir1/dir2");
const path dir1 = env.make_env_path("dir1");
const path attr_dir = env.create_dir("attr_dir");
- std::error_code ec;
+ std::error_code ec = GetTestEC();
TEST_CHECK(fs::create_directory(dir, attr_dir, ec) == false);
- TEST_CHECK(ec);
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
TEST_CHECK(!is_directory(dir));
TEST_CHECK(!is_directory(dir1));
}
@@ -95,10 +94,39 @@ TEST_CASE(dest_is_file)
scoped_test_env env;
const path file = env.create_file("file", 42);
const path attr_dir = env.create_dir("attr_dir");
- std::error_code ec;
+ std::error_code ec = GetTestEC();
TEST_CHECK(fs::create_directory(file, attr_dir, ec) == false);
- TEST_CHECK(ec);
+ TEST_CHECK(!ec);
TEST_CHECK(is_regular_file(file));
}
+TEST_CASE(attr_dir_is_invalid) {
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ const path dest = env.make_env_path("dir");
+ const path dne = env.make_env_path("dne");
+ {
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(create_directory(dest, file, ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
+ }
+ TEST_REQUIRE(!exists(dest));
+ {
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(create_directory(dest, dne, ec) == false);
+ TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
+ }
+}
+
+TEST_CASE(dest_is_symlink) {
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path sym = env.create_symlink("dne_sym", "dne_sym_name");
+ {
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(create_directory(sym, dir, ec) == false);
+ TEST_CHECK(!ec);
+ }
+}
+
TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
index 85a3b6cb3465..f1d9ff04190a 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
@@ -9,21 +9,20 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void create_directory_symlink(const path& existing_symlink, const path& new_symlink);
// void create_directory_symlink(const path& existing_symlink, const path& new_symlink,
// error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <cassert>
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_create_directory_symlink_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
index 7aefece46a4a..f1ffc74c2577 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
@@ -9,20 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void create_hard_link(const path& existing_symlink, const path& new_symlink);
// void create_hard_link(const path& existing_symlink, const path& new_symlink,
// error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_create_hard_link_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
index d261d987a1ee..e69aae186ceb 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
@@ -9,21 +9,20 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void create_symlink(const path& existing_symlink, const path& new_symlink);
// void create_symlink(const path& existing_symlink, const path& new_symlink,
// error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <cassert>
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_create_symlink_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
index 9d004ab854c1..dd3736e089db 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
@@ -9,14 +9,14 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// path current_path();
// path current_path(error_code& ec);
// void current_path(path const&);
// void current_path(path const&, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_current_path_path_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
index a3591e0267e6..392f66c6defe 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool equivalent(path const& lhs, path const& rhs);
// bool equivalent(path const& lhs, path const& rhs, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -22,7 +22,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(equivalent_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp
index 2b9f57e7e954..916052b74830 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool exists(file_status s) noexcept
// bool exists(path const& p);
// bool exists(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(exists_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp
index 460e42dd1c3f..60e0042cf353 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// uintmax_t file_size(const path& p);
// uintmax_t file_size(const path& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -22,7 +22,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(file_size_test_suite)
@@ -62,17 +62,23 @@ TEST_CASE(symlink_test_case)
TEST_CASE(file_size_error_cases)
{
- const path testCases[] = {
- StaticEnv::Dir,
- StaticEnv::SymlinkToDir,
- StaticEnv::BadSymlink,
- StaticEnv::DNE
- };
+ struct {
+ path p;
+ std::errc expected_err;
+ } TestCases[] = {
+ {StaticEnv::Dir, std::errc::is_a_directory},
+ {StaticEnv::SymlinkToDir, std::errc::is_a_directory},
+ {StaticEnv::BadSymlink, std::errc::no_such_file_or_directory},
+ {StaticEnv::DNE, std::errc::no_such_file_or_directory},
+ {"", std::errc::no_such_file_or_directory}};
const uintmax_t expect = static_cast<uintmax_t>(-1);
- for (auto& TC : testCases) {
- std::error_code ec;
- TEST_CHECK(file_size(TC, ec) == expect);
- TEST_CHECK(ec);
+ for (auto& TC : TestCases) {
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(file_size(TC.p, ec) == expect);
+ TEST_CHECK(ErrorIs(ec, TC.expected_err));
+
+ ExceptionChecker Checker(TC.p, TC.expected_err, "file_size");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, file_size(TC.p));
}
}
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
index 6b542a5b67a5..2e9704a3dbea 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// uintmax_t hard_link_count(const path& p);
// uintmax_t hard_link_count(const path& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -22,7 +22,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(hard_link_count_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp
index dee28aa5be61..36f1d6bbd915 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_block_file(file_status s) noexcept
// bool is_block_file(path const& p);
// bool is_block_file(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_block_file_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp
index 2de42bf20975..b0c3fe542f37 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_character_file(file_status s) noexcept
// bool is_character_file(path const& p);
// bool is_character_file(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_character_file_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp
index d6ecb1a1e684..bb578b9cfa0c 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_directory(file_status s) noexcept
// bool is_directory(path const& p);
// bool is_directory(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_directory_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
index 2da163c33471..cd4dd174852e 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_empty(path const& p);
// bool is_empty(path const& p, std::error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -22,7 +22,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_empty_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp
index 44892f65d86e..3c86dc0e7c26 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_fifo(file_status s) noexcept
// bool is_fifo(path const& p);
// bool is_fifo(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_fifo_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp
index e86b66b4ea64..a2134c7c1dbe 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_other(file_status s) noexcept
// bool is_other(path const& p);
// bool is_other(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_other_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp
index be68dcfc35de..0c34886355b4 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_regular_file(file_status s) noexcept
// bool is_regular_file(path const& p);
// bool is_regular_file(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_regular_file_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp
index 49fd402eb546..7273c6c2e5ce 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_socket(file_status s) noexcept
// bool is_socket(path const& p);
// bool is_socket(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_socket_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp
index 3de002978683..e1ac98a80d0b 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp
@@ -9,13 +9,13 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool is_symlink(file_status s) noexcept
// bool is_symlink(path const& p);
// bool is_symlink(path const& p, std::error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -23,7 +23,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(is_symlink_test_suite)
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
new file mode 100644
index 000000000000..bc77f3f6351b
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
@@ -0,0 +1,594 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// file_time_type last_write_time(const path& p);
+// file_time_type last_write_time(const path& p, std::error_code& ec) noexcept;
+// void last_write_time(const path& p, file_time_type new_time);
+// void last_write_time(const path& p, file_time_type new_type,
+// std::error_code& ec) noexcept;
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <chrono>
+#include <fstream>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+#include <sys/stat.h>
+#include <iostream>
+
+#include <fcntl.h>
+#include <sys/time.h>
+
+using namespace fs;
+
+using TimeSpec = struct ::timespec;
+using StatT = struct ::stat;
+
+using Sec = std::chrono::duration<file_time_type::rep>;
+using Hours = std::chrono::hours;
+using Minutes = std::chrono::minutes;
+using MicroSec = std::chrono::duration<file_time_type::rep, std::micro>;
+using NanoSec = std::chrono::duration<file_time_type::rep, std::nano>;
+using std::chrono::duration_cast;
+
+#if defined(__APPLE__)
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
+TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
+#else
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
+TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
+#endif
+
+bool ConvertToTimeSpec(TimeSpec& ts, file_time_type ft) {
+ using SecFieldT = decltype(TimeSpec::tv_sec);
+ using NSecFieldT = decltype(TimeSpec::tv_nsec);
+ using SecLim = std::numeric_limits<SecFieldT>;
+ using NSecLim = std::numeric_limits<NSecFieldT>;
+
+ auto secs = duration_cast<Sec>(ft.time_since_epoch());
+ auto nsecs = duration_cast<NanoSec>(ft.time_since_epoch() - secs);
+ if (nsecs.count() < 0) {
+ if (Sec::min().count() > SecLim::min()) {
+ secs += Sec(1);
+ nsecs -= Sec(1);
+ } else {
+ nsecs = NanoSec(0);
+ }
+ }
+ if (SecLim::max() < secs.count() || SecLim::min() > secs.count())
+ return false;
+ if (NSecLim::max() < nsecs.count() || NSecLim::min() > nsecs.count())
+ return false;
+ ts.tv_sec = secs.count();
+ ts.tv_nsec = nsecs.count();
+ return true;
+}
+
+bool ConvertFromTimeSpec(file_time_type& ft, TimeSpec ts) {
+ auto secs_part = duration_cast<file_time_type::duration>(Sec(ts.tv_sec));
+ if (duration_cast<Sec>(secs_part).count() != ts.tv_sec)
+ return false;
+ auto subsecs = duration_cast<file_time_type::duration>(NanoSec(ts.tv_nsec));
+ auto dur = secs_part + subsecs;
+ if (dur < secs_part && subsecs.count() >= 0)
+ return false;
+ ft = file_time_type(dur);
+ return true;
+}
+
+bool CompareTimeExact(TimeSpec ts, TimeSpec ts2) {
+ return ts2.tv_sec == ts.tv_sec && ts2.tv_nsec == ts.tv_nsec;
+}
+bool CompareTimeExact(file_time_type ft, TimeSpec ts) {
+ TimeSpec ts2 = {};
+ if (!ConvertToTimeSpec(ts2, ft))
+ return false;
+ return CompareTimeExact(ts, ts2);
+}
+bool CompareTimeExact(TimeSpec ts, file_time_type ft) {
+ return CompareTimeExact(ft, ts);
+}
+
+struct Times {
+ TimeSpec access, write;
+};
+
+Times GetTimes(path const& p) {
+ using Clock = file_time_type::clock;
+ StatT st;
+ if (::stat(p.c_str(), &st) == -1) {
+ std::error_code ec(errno, std::generic_category());
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ throw ec;
+#else
+ std::cerr << ec.message() << std::endl;
+ std::exit(EXIT_FAILURE);
+#endif
+ }
+ return {extract_atime(st), extract_mtime(st)};
+}
+
+TimeSpec LastAccessTime(path const& p) { return GetTimes(p).access; }
+
+TimeSpec LastWriteTime(path const& p) { return GetTimes(p).write; }
+
+std::pair<TimeSpec, TimeSpec> GetSymlinkTimes(path const& p) {
+ using Clock = file_time_type::clock;
+ StatT st;
+ if (::lstat(p.c_str(), &st) == -1) {
+ std::error_code ec(errno, std::generic_category());
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ throw ec;
+#else
+ std::cerr << ec.message() << std::endl;
+ std::exit(EXIT_FAILURE);
+#endif
+ }
+ return {extract_atime(st), extract_mtime(st)};
+}
+
+namespace {
+
+// In some configurations, the comparison is tautological and the test is valid.
+// We disable the warning so that we can actually test it regardless. Also, that
+// diagnostic is pretty new, so also don't fail if old clang does not support it
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wtautological-constant-compare"
+#endif
+
+static const bool SupportsNegativeTimes = [] {
+ using namespace std::chrono;
+ std::error_code ec;
+ TimeSpec old_write_time, new_write_time;
+ { // WARNING: Do not assert in this scope.
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ old_write_time = LastWriteTime(file);
+ file_time_type tp(seconds(-5));
+ fs::last_write_time(file, tp, ec);
+ new_write_time = LastWriteTime(file);
+ }
+
+ return !ec && new_write_time.tv_sec < 0;
+}();
+
+static const bool SupportsMaxTime = [] {
+ using namespace std::chrono;
+ TimeSpec max_ts = {};
+ if (!ConvertToTimeSpec(max_ts, file_time_type::max()))
+ return false;
+
+ std::error_code ec;
+ TimeSpec old_write_time, new_write_time;
+ { // WARNING: Do not assert in this scope.
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ old_write_time = LastWriteTime(file);
+ file_time_type tp = file_time_type::max();
+ fs::last_write_time(file, tp, ec);
+ new_write_time = LastWriteTime(file);
+ }
+ return !ec && new_write_time.tv_sec > max_ts.tv_sec - 1;
+}();
+
+static const bool SupportsMinTime = [] {
+ using namespace std::chrono;
+ TimeSpec min_ts = {};
+ if (!ConvertToTimeSpec(min_ts, file_time_type::min()))
+ return false;
+ std::error_code ec;
+ TimeSpec old_write_time, new_write_time;
+ { // WARNING: Do not assert in this scope.
+ scoped_test_env env;
+ const path file = env.create_file("file", 42);
+ old_write_time = LastWriteTime(file);
+ file_time_type tp = file_time_type::min();
+ fs::last_write_time(file, tp, ec);
+ new_write_time = LastWriteTime(file);
+ }
+ return !ec && new_write_time.tv_sec < min_ts.tv_sec + 1;
+}();
+
+static const bool SupportsNanosecondRoundTrip = [] {
+ NanoSec ns(3);
+ static_assert(std::is_same<file_time_type::period, std::nano>::value, "");
+
+ // Test that the system call we use to set the times also supports nanosecond
+ // resolution. (utimes does not)
+ file_time_type ft(ns);
+ {
+ scoped_test_env env;
+ const path p = env.create_file("file", 42);
+ last_write_time(p, ft);
+ return last_write_time(p) == ft;
+ }
+}();
+
+// The HFS+ filesystem (used by default before macOS 10.13) stores timestamps at
+// a 1-second granularity, and APFS (now the default) at a 1 nanosecond granularity.
+// 1-second granularity is also the norm on many of the supported filesystems
+// on Linux as well.
+static const bool WorkaroundStatTruncatesToSeconds = [] {
+ MicroSec micros(3);
+ static_assert(std::is_same<file_time_type::period, std::nano>::value, "");
+
+ file_time_type ft(micros);
+ {
+ scoped_test_env env;
+ const path p = env.create_file("file", 42);
+ if (LastWriteTime(p).tv_nsec != 0)
+ return false;
+ last_write_time(p, ft);
+ return last_write_time(p) != ft && LastWriteTime(p).tv_nsec == 0;
+ }
+}();
+
+static const bool SupportsMinRoundTrip = [] {
+ TimeSpec ts = {};
+ if (!ConvertToTimeSpec(ts, file_time_type::min()))
+ return false;
+ file_time_type min_val = {};
+ if (!ConvertFromTimeSpec(min_val, ts))
+ return false;
+ return min_val == file_time_type::min();
+}();
+
+} // end namespace
+
+static bool CompareTime(TimeSpec t1, TimeSpec t2) {
+ if (SupportsNanosecondRoundTrip)
+ return CompareTimeExact(t1, t2);
+ if (t1.tv_sec != t2.tv_sec)
+ return false;
+
+ auto diff = std::abs(t1.tv_nsec - t2.tv_nsec);
+ if (WorkaroundStatTruncatesToSeconds)
+ return diff < duration_cast<NanoSec>(Sec(1)).count();
+ return diff < duration_cast<NanoSec>(MicroSec(1)).count();
+}
+
+static bool CompareTime(file_time_type t1, TimeSpec t2) {
+ TimeSpec ts1 = {};
+ if (!ConvertToTimeSpec(ts1, t1))
+ return false;
+ return CompareTime(ts1, t2);
+}
+
+static bool CompareTime(TimeSpec t1, file_time_type t2) {
+ return CompareTime(t2, t1);
+}
+
+static bool CompareTime(file_time_type t1, file_time_type t2) {
+ auto min_secs = duration_cast<Sec>(file_time_type::min().time_since_epoch());
+ bool IsMin =
+ t1.time_since_epoch() < min_secs || t2.time_since_epoch() < min_secs;
+
+ if (SupportsNanosecondRoundTrip && (!IsMin || SupportsMinRoundTrip))
+ return t1 == t2;
+ if (IsMin) {
+ return duration_cast<Sec>(t1.time_since_epoch()) ==
+ duration_cast<Sec>(t2.time_since_epoch());
+ }
+ file_time_type::duration dur;
+ if (t1 > t2)
+ dur = t1 - t2;
+ else
+ dur = t2 - t1;
+ if (WorkaroundStatTruncatesToSeconds)
+ return duration_cast<Sec>(dur).count() == 0;
+ return duration_cast<MicroSec>(dur).count() == 0;
+}
+
+// Check if a time point is representable on a given filesystem. Check that:
+// (A) 'tp' is representable as a time_t
+// (B) 'tp' is non-negative or the filesystem supports negative times.
+// (C) 'tp' is not 'file_time_type::max()' or the filesystem supports the max
+// value.
+// (D) 'tp' is not 'file_time_type::min()' or the filesystem supports the min
+// value.
+inline bool TimeIsRepresentableByFilesystem(file_time_type tp) {
+ TimeSpec ts = {};
+ if (!ConvertToTimeSpec(ts, tp))
+ return false;
+ else if (tp.time_since_epoch().count() < 0 && !SupportsNegativeTimes)
+ return false;
+ else if (tp == file_time_type::max() && !SupportsMaxTime)
+ return false;
+ else if (tp == file_time_type::min() && !SupportsMinTime)
+ return false;
+ return true;
+}
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+// Create a sub-second duration using the smallest period the filesystem supports.
+file_time_type::duration SubSec(long long val) {
+ using SubSecT = file_time_type::duration;
+ if (SupportsNanosecondRoundTrip) {
+ return duration_cast<SubSecT>(NanoSec(val));
+ } else {
+ return duration_cast<SubSecT>(MicroSec(val));
+ }
+}
+
+TEST_SUITE(last_write_time_test_suite)
+
+TEST_CASE(signature_test)
+{
+ const file_time_type t;
+ const path p; ((void)p);
+ std::error_code ec; ((void)ec);
+ ASSERT_SAME_TYPE(decltype(last_write_time(p)), file_time_type);
+ ASSERT_SAME_TYPE(decltype(last_write_time(p, ec)), file_time_type);
+ ASSERT_SAME_TYPE(decltype(last_write_time(p, t)), void);
+ ASSERT_SAME_TYPE(decltype(last_write_time(p, t, ec)), void);
+ ASSERT_NOT_NOEXCEPT(last_write_time(p));
+ ASSERT_NOT_NOEXCEPT(last_write_time(p, t));
+ ASSERT_NOEXCEPT(last_write_time(p, ec));
+ ASSERT_NOEXCEPT(last_write_time(p, t, ec));
+}
+
+TEST_CASE(read_last_write_time_static_env_test)
+{
+ using C = file_time_type::clock;
+ file_time_type min = file_time_type::min();
+ {
+ file_time_type ret = last_write_time(StaticEnv::File);
+ TEST_CHECK(ret != min);
+ TEST_CHECK(ret < C::now());
+ TEST_CHECK(CompareTime(ret, LastWriteTime(StaticEnv::File)));
+
+ file_time_type ret2 = last_write_time(StaticEnv::SymlinkToFile);
+ TEST_CHECK(CompareTime(ret, ret2));
+ TEST_CHECK(CompareTime(ret2, LastWriteTime(StaticEnv::SymlinkToFile)));
+ }
+ {
+ file_time_type ret = last_write_time(StaticEnv::Dir);
+ TEST_CHECK(ret != min);
+ TEST_CHECK(ret < C::now());
+ TEST_CHECK(CompareTime(ret, LastWriteTime(StaticEnv::Dir)));
+
+ file_time_type ret2 = last_write_time(StaticEnv::SymlinkToDir);
+ TEST_CHECK(CompareTime(ret, ret2));
+ TEST_CHECK(CompareTime(ret2, LastWriteTime(StaticEnv::SymlinkToDir)));
+ }
+}
+
+TEST_CASE(get_last_write_time_dynamic_env_test)
+{
+ using Clock = file_time_type::clock;
+ using Sec = std::chrono::seconds;
+ scoped_test_env env;
+
+ const path file = env.create_file("file", 42);
+ const path dir = env.create_dir("dir");
+
+ const auto file_times = GetTimes(file);
+ const TimeSpec file_write_time = file_times.write;
+ const auto dir_times = GetTimes(dir);
+ const TimeSpec dir_write_time = dir_times.write;
+
+ file_time_type ftime = last_write_time(file);
+ TEST_CHECK(Clock::to_time_t(ftime) == file_write_time.tv_sec);
+ TEST_CHECK(CompareTime(ftime, file_write_time));
+
+ file_time_type dtime = last_write_time(dir);
+ TEST_CHECK(Clock::to_time_t(dtime) == dir_write_time.tv_sec);
+ TEST_CHECK(CompareTime(dtime, dir_write_time));
+
+ SleepFor(Sec(2));
+
+ // update file and add a file to the directory. Make sure the times increase.
+ std::ofstream of(file, std::ofstream::app);
+ of << "hello";
+ of.close();
+ env.create_file("dir/file1", 1);
+
+ file_time_type ftime2 = last_write_time(file);
+ file_time_type dtime2 = last_write_time(dir);
+
+ TEST_CHECK(ftime2 > ftime);
+ TEST_CHECK(dtime2 > dtime);
+ TEST_CHECK(CompareTime(LastWriteTime(file), ftime2));
+ TEST_CHECK(CompareTime(LastWriteTime(dir), dtime2));
+}
+
+
+TEST_CASE(set_last_write_time_dynamic_env_test)
+{
+ using Clock = file_time_type::clock;
+ scoped_test_env env;
+
+ const path file = env.create_file("file", 42);
+ const path dir = env.create_dir("dir");
+ const auto now = Clock::now();
+ const file_time_type epoch_time = now - now.time_since_epoch();
+
+ const file_time_type future_time = now + Hours(3) + Sec(42) + SubSec(17);
+ const file_time_type past_time = now - Minutes(3) - Sec(42) - SubSec(17);
+ const file_time_type before_epoch_time =
+ epoch_time - Minutes(3) - Sec(42) - SubSec(17);
+ // FreeBSD has a bug in their utimes implementation where the time is not update
+ // when the number of seconds is '-1'.
+#if defined(__FreeBSD__)
+ const file_time_type just_before_epoch_time =
+ epoch_time - Sec(2) - SubSec(17);
+#else
+ const file_time_type just_before_epoch_time = epoch_time - SubSec(17);
+#endif
+
+ struct TestCase {
+ const char * case_name;
+ path p;
+ file_time_type new_time;
+ } cases[] = {
+ {"file, epoch_time", file, epoch_time},
+ {"dir, epoch_time", dir, epoch_time},
+ {"file, future_time", file, future_time},
+ {"dir, future_time", dir, future_time},
+ {"file, past_time", file, past_time},
+ {"dir, past_time", dir, past_time},
+ {"file, before_epoch_time", file, before_epoch_time},
+ {"dir, before_epoch_time", dir, before_epoch_time},
+ {"file, just_before_epoch_time", file, just_before_epoch_time},
+ {"dir, just_before_epoch_time", dir, just_before_epoch_time}
+ };
+ for (const auto& TC : cases) {
+ std::cerr << "Test Case = " << TC.case_name << "\n";
+ const auto old_times = GetTimes(TC.p);
+ file_time_type old_time;
+ TEST_REQUIRE(ConvertFromTimeSpec(old_time, old_times.write));
+
+ std::error_code ec = GetTestEC();
+ last_write_time(TC.p, TC.new_time, ec);
+ TEST_CHECK(!ec);
+
+ ec = GetTestEC();
+ file_time_type got_time = last_write_time(TC.p, ec);
+ TEST_REQUIRE(!ec);
+
+ if (TimeIsRepresentableByFilesystem(TC.new_time)) {
+ TEST_CHECK(got_time != old_time);
+ TEST_CHECK(CompareTime(got_time, TC.new_time));
+ TEST_CHECK(CompareTime(LastAccessTime(TC.p), old_times.access));
+ }
+ }
+}
+
+TEST_CASE(last_write_time_symlink_test)
+{
+ using Clock = file_time_type::clock;
+
+ scoped_test_env env;
+
+ const path file = env.create_file("file", 42);
+ const path sym = env.create_symlink("file", "sym");
+
+ const file_time_type new_time = Clock::now() + Hours(3);
+
+ const auto old_times = GetTimes(sym);
+ const auto old_sym_times = GetSymlinkTimes(sym);
+
+ std::error_code ec = GetTestEC();
+ last_write_time(sym, new_time, ec);
+ TEST_CHECK(!ec);
+
+ file_time_type got_time = last_write_time(sym);
+ TEST_CHECK(!CompareTime(got_time, old_times.write));
+ if (!WorkaroundStatTruncatesToSeconds) {
+ TEST_CHECK(got_time == new_time);
+ } else {
+ TEST_CHECK(CompareTime(got_time, new_time));
+ }
+
+ TEST_CHECK(CompareTime(LastWriteTime(file), new_time));
+ TEST_CHECK(CompareTime(LastAccessTime(sym), old_times.access));
+ std::pair<TimeSpec, TimeSpec> sym_times = GetSymlinkTimes(sym);
+ TEST_CHECK(CompareTime(sym_times.first, old_sym_times.first));
+ TEST_CHECK(CompareTime(sym_times.second, old_sym_times.second));
+}
+
+
+TEST_CASE(test_write_min_time)
+{
+ using Clock = file_time_type::clock;
+ scoped_test_env env;
+ const path p = env.create_file("file", 42);
+ const file_time_type old_time = last_write_time(p);
+ file_time_type new_time = file_time_type::min();
+
+ std::error_code ec = GetTestEC();
+ last_write_time(p, new_time, ec);
+ file_time_type tt = last_write_time(p);
+
+ if (TimeIsRepresentableByFilesystem(new_time)) {
+ TEST_CHECK(!ec);
+ TEST_CHECK(CompareTime(tt, new_time));
+
+ last_write_time(p, old_time);
+ new_time = file_time_type::min() + SubSec(1);
+
+ ec = GetTestEC();
+ last_write_time(p, new_time, ec);
+ tt = last_write_time(p);
+
+ if (TimeIsRepresentableByFilesystem(new_time)) {
+ TEST_CHECK(!ec);
+ TEST_CHECK(CompareTime(tt, new_time));
+ } else {
+ TEST_CHECK(ErrorIs(ec, std::errc::value_too_large));
+ TEST_CHECK(tt == old_time);
+ }
+ } else {
+ TEST_CHECK(ErrorIs(ec, std::errc::value_too_large));
+ TEST_CHECK(tt == old_time);
+ }
+}
+
+TEST_CASE(test_write_max_time) {
+ using Clock = file_time_type::clock;
+ using Sec = std::chrono::seconds;
+ using Hours = std::chrono::hours;
+
+ scoped_test_env env;
+ const path p = env.create_file("file", 42);
+ const file_time_type old_time = last_write_time(p);
+ file_time_type new_time = file_time_type::max();
+
+ std::error_code ec = GetTestEC();
+ last_write_time(p, new_time, ec);
+ file_time_type tt = last_write_time(p);
+
+ if (TimeIsRepresentableByFilesystem(new_time)) {
+ TEST_CHECK(!ec);
+ TEST_CHECK(CompareTime(tt, new_time));
+ } else {
+ TEST_CHECK(ErrorIs(ec, std::errc::value_too_large));
+ TEST_CHECK(tt == old_time);
+ }
+}
+
+TEST_CASE(test_value_on_failure)
+{
+ const path p = StaticEnv::DNE;
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(last_write_time(p, ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+}
+
+TEST_CASE(test_exists_fails)
+{
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file = env.create_file("dir/file", 42);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(last_write_time(file, ec) == file_time_type::min());
+ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+
+ ExceptionChecker Checker(file, std::errc::permission_denied,
+ "last_write_time");
+ TEST_CHECK_THROW_RESULT(filesystem_error, Checker, last_write_time(file));
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
index 794aeb992640..cbe2b2d09fb3 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
@@ -9,20 +9,22 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
-// void permissions(const path& p, perms prms);
+// void permissions(const path& p, perms prms,
+// perm_options opts = perm_options::replace);
// void permissions(const path& p, perms prms, std::error_code& ec) noexcept;
+// void permissions(const path& p, perms prms, perm_options opts, std::error_code);
-#include <experimental/filesystem>
+
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
using PR = fs::perms;
@@ -31,17 +33,19 @@ TEST_SUITE(filesystem_permissions_test_suite)
TEST_CASE(test_signatures)
{
const path p; ((void)p);
- const perms opts{}; ((void)opts);
+ const perms pr{}; ((void)pr);
+ const perm_options opts{}; ((void)opts);
std::error_code ec; ((void)ec);
- ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts));
- // Not noexcept because of narrow contract
- LIBCPP_ONLY(
- ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts, ec)));
+ ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr));
+ ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts));
+ ASSERT_NOEXCEPT(fs::permissions(p, pr, ec));
+ ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec));
}
TEST_CASE(test_error_reporting)
{
- auto checkThrow = [](path const& f, fs::perms opts, const std::error_code& ec)
+ auto checkThrow = [](path const& f, fs::perms opts,
+ const std::error_code& ec)
{
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
@@ -62,15 +66,17 @@ TEST_CASE(test_error_reporting)
const path dne = env.make_env_path("dne");
const path dne_sym = env.create_symlink(dne, "dne_sym");
{ // !exists
- std::error_code ec;
+ std::error_code ec = GetTestEC();
fs::permissions(dne, fs::perms{}, ec);
TEST_REQUIRE(ec);
+ TEST_CHECK(ec != GetTestEC());
TEST_CHECK(checkThrow(dne, fs::perms{}, ec));
}
{
- std::error_code ec;
+ std::error_code ec = GetTestEC();
fs::permissions(dne_sym, fs::perms{}, ec);
TEST_REQUIRE(ec);
+ TEST_CHECK(ec != GetTestEC());
TEST_CHECK(checkThrow(dne_sym, fs::perms{}, ec));
}
}
@@ -82,42 +88,54 @@ TEST_CASE(basic_permissions_test)
const path dir = env.create_dir("dir1");
const path file_for_sym = env.create_file("file2", 42);
const path sym = env.create_symlink(file_for_sym, "sym");
- const perms AP = perms::add_perms;
- const perms RP = perms::remove_perms;
- const perms NF = perms::symlink_nofollow;
+ const perm_options AP = perm_options::add;
+ const perm_options RP = perm_options::remove;
+ const perm_options NF = perm_options::nofollow;
struct TestCase {
path p;
perms set_perms;
perms expected;
+ perm_options opts;
+ TestCase(path xp, perms xperms, perms xexpect,
+ perm_options xopts = perm_options::replace)
+ : p(xp), set_perms(xperms), expected(xexpect), opts(xopts) {}
} cases[] = {
// test file
{file, perms::none, perms::none},
{file, perms::owner_all, perms::owner_all},
- {file, perms::group_all | AP, perms::owner_all | perms::group_all},
- {file, perms::group_all | RP, perms::owner_all},
+ {file, perms::group_all, perms::owner_all | perms::group_all, AP},
+ {file, perms::group_all, perms::owner_all, RP},
// test directory
{dir, perms::none, perms::none},
{dir, perms::owner_all, perms::owner_all},
- {dir, perms::group_all | AP, perms::owner_all | perms::group_all},
- {dir, perms::group_all | RP, perms::owner_all},
+ {dir, perms::group_all, perms::owner_all | perms::group_all, AP},
+ {dir, perms::group_all, perms::owner_all, RP},
// test symlink without symlink_nofollow
{sym, perms::none, perms::none},
{sym, perms::owner_all, perms::owner_all},
- {sym, perms::group_all | AP, perms::owner_all | perms::group_all},
- {sym, perms::group_all | RP , perms::owner_all},
+ {sym, perms::group_all, perms::owner_all | perms::group_all, AP},
+ {sym, perms::group_all, perms::owner_all, RP},
// test non-symlink with symlink_nofollow. The last test on file/dir
// will have set their permissions to perms::owner_all
- {file, perms::group_all | AP | NF, perms::owner_all | perms::group_all},
- {dir, perms::group_all | AP | NF, perms::owner_all | perms::group_all}
+ {file, perms::group_all, perms::owner_all | perms::group_all, AP | NF},
+ {dir, perms::group_all, perms::owner_all | perms::group_all, AP | NF}
};
for (auto const& TC : cases) {
TEST_CHECK(status(TC.p).permissions() != TC.expected);
- // Set the error code to ensure it's cleared.
- std::error_code ec = std::make_error_code(std::errc::bad_address);
- permissions(TC.p, TC.set_perms, ec);
- TEST_CHECK(!ec);
- auto pp = status(TC.p).permissions();
- TEST_CHECK(pp == TC.expected);
+ {
+ std::error_code ec = GetTestEC();
+ permissions(TC.p, TC.set_perms, TC.opts, ec);
+ TEST_CHECK(!ec);
+ auto pp = status(TC.p).permissions();
+ TEST_CHECK(pp == TC.expected);
+ }
+ if (TC.opts == perm_options::replace) {
+ std::error_code ec = GetTestEC();
+ permissions(TC.p, TC.set_perms, ec);
+ TEST_CHECK(!ec);
+ auto pp = status(TC.p).permissions();
+ TEST_CHECK(pp == TC.expected);
+ }
}
}
@@ -131,10 +149,14 @@ TEST_CASE(test_no_resolve_symlink_on_symlink)
struct TestCase {
perms set_perms;
perms expected; // only expected on platform that support symlink perms.
+ perm_options opts = perm_options::replace;
+ TestCase(perms xperms, perms xexpect,
+ perm_options xopts = perm_options::replace)
+ : set_perms(xperms), expected(xexpect), opts(xopts) {}
} cases[] = {
{perms::owner_all, perms::owner_all},
- {perms::group_all | perms::add_perms, perms::owner_all | perms::group_all},
- {perms::owner_all | perms::remove_perms, perms::group_all},
+ {perms::group_all, perms::owner_all | perms::group_all, perm_options::add},
+ {perms::owner_all, perms::group_all, perm_options::remove},
};
for (auto const& TC : cases) {
#if defined(__APPLE__) || defined(__FreeBSD__)
@@ -149,8 +171,8 @@ TEST_CASE(test_no_resolve_symlink_on_symlink)
const auto expected_link_perms = symlink_status(sym).permissions();
std::error_code expected_ec = std::make_error_code(std::errc::operation_not_supported);
#endif
- std::error_code ec = std::make_error_code(std::errc::bad_address);
- permissions(sym, TC.set_perms | perms::symlink_nofollow, ec);
+ std::error_code ec = GetTestEC();
+ permissions(sym, TC.set_perms, TC.opts | perm_options::nofollow, ec);
TEST_CHECK(ec == expected_ec);
TEST_CHECK(status(file).permissions() == file_perms);
TEST_CHECK(symlink_status(sym).permissions() == expected_link_perms);
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
new file mode 100644
index 000000000000..5f7b30dd60b9
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// path proximate(const path& p, error_code &ec)
+// path proximate(const path& p, const path& base = current_path())
+// path proximate(const path& p, const path& base, error_code& ec);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <vector>
+#include <iostream>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+
+static int count_path_elems(const fs::path& p) {
+ int count = 0;
+ for (auto& elem : p) {
+ if (elem != "/" && elem != "")
+ ++count;
+ }
+ return count;
+}
+
+TEST_SUITE(filesystem_proximate_path_test_suite)
+
+
+TEST_CASE(signature_test)
+{
+ using fs::path;
+ const path p; ((void)p);
+ std::error_code ec; ((void)ec);
+ ASSERT_NOT_NOEXCEPT(proximate(p));
+ ASSERT_NOT_NOEXCEPT(proximate(p, p));
+ ASSERT_NOT_NOEXCEPT(proximate(p, ec));
+ ASSERT_NOT_NOEXCEPT(proximate(p, p, ec));
+}
+
+TEST_CASE(basic_test) {
+ using fs::path;
+ const path cwd = fs::current_path();
+ const path parent_cwd = cwd.parent_path();
+ const path curdir = cwd.filename();
+ TEST_REQUIRE(!cwd.native().empty());
+ int cwd_depth = count_path_elems(cwd);
+ path dot_dot_to_root;
+ for (int i=0; i < cwd_depth; ++i)
+ dot_dot_to_root /= "..";
+ path relative_cwd = cwd.native().substr(1);
+ // clang-format off
+ struct {
+ std::string input;
+ std::string base;
+ std::string expect;
+ } TestCases[] = {
+ {"", "", "."},
+ {cwd, "a", ".."},
+ {parent_cwd, "a", "../.."},
+ {"a", cwd, "a"},
+ {"a", parent_cwd, "fs.op.proximate/a"},
+ {"/", "a", dot_dot_to_root / ".."},
+ {"/", "a/b", dot_dot_to_root / "../.."},
+ {"/", "a/b/", dot_dot_to_root / "../../.."},
+ {"a", "/", relative_cwd / "a"},
+ {"a/b", "/", relative_cwd / "a/b"},
+ {"a", "/net", ".." / relative_cwd / "a"},
+ {"//foo/", "//foo", "/foo/"},
+ {"//foo", "//foo/", ".."},
+ {"//foo", "//foo", "."},
+ {"//foo/", "//foo/", "."},
+ {"//base", "a", dot_dot_to_root / "../base"},
+ {"a", "a", "."},
+ {"a/b", "a/b", "."},
+ {"a/b/c/", "a/b/c/", "."},
+ {"//foo/a/b", "//foo/a/b", "."},
+ {"/a/d", "/a/b/c", "../../d"},
+ {"/a/b/c", "/a/d", "../b/c"},
+ {"a/b/c", "a", "b/c"},
+ {"a/b/c", "a/b/c/x/y", "../.."},
+ {"a/b/c", "a/b/c", "."},
+ {"a/b", "c/d", "../../a/b"}
+ };
+ // clang-format on
+ int ID = 0;
+ for (auto& TC : TestCases) {
+ ++ID;
+ std::error_code ec = GetTestEC();
+ fs::path p(TC.input);
+ const fs::path output = fs::proximate(p, TC.base, ec);
+ if (ec) {
+ TEST_CHECK(!ec);
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Base: '" << TC.base << "'\n";
+ std::cerr << " Expected: '" << TC.expect << "'\n";
+
+ std::cerr << std::endl;
+ } else if (!PathEq(output, TC.expect)) {
+ TEST_CHECK(PathEq(output, TC.expect));
+
+ const path canon_input = fs::weakly_canonical(TC.input);
+ const path canon_base = fs::weakly_canonical(TC.base);
+ const path lexically_p = canon_input.lexically_proximate(canon_base);
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Base: '" << TC.base << "'\n";
+ std::cerr << " Expected: '" << TC.expect << "'\n";
+ std::cerr << " Output: '" << output.native() << "'\n";
+ std::cerr << " Lex Prox: '" << lexically_p.native() << "'\n";
+ std::cerr << " Canon Input: " << canon_input << "\n";
+ std::cerr << " Canon Base: " << canon_base << "\n";
+
+ std::cerr << std::endl;
+ }
+ }
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
index d69e95ce5d5c..43dfec8347ac 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// path read_symlink(const path& p);
// path read_symlink(const path& p, error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_read_symlink_test_suite)
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
new file mode 100644
index 000000000000..e240c6496755
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// path proximate(const path& p, error_code &ec)
+// path proximate(const path& p, const path& base = current_path())
+// path proximate(const path& p, const path& base, error_code& ec);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <vector>
+#include <iostream>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "rapid-cxx-test.hpp"
+#include "filesystem_test_helper.hpp"
+
+
+TEST_SUITE(filesystem_proximate_path_test_suite)
+
+TEST_CASE(test_signature) {
+
+}
+int main() {
+ // clang-format off
+ struct {
+ std::string input;
+ std::string expect;
+ } TestCases[] = {
+ {"", fs::current_path()},
+ {".", fs::current_path()},
+ {StaticEnv::File, StaticEnv::File},
+ {StaticEnv::Dir, StaticEnv::Dir},
+ {StaticEnv::SymlinkToDir, StaticEnv::Dir},
+ {StaticEnv::SymlinkToDir / "dir2/.", StaticEnv::Dir / "dir2"},
+ // FIXME? If the trailing separator occurs in a part of the path that exists,
+ // it is ommitted. Otherwise it is added to the end of the result.
+ {StaticEnv::SymlinkToDir / "dir2/./", StaticEnv::Dir / "dir2"},
+ {StaticEnv::SymlinkToDir / "dir2/DNE/./", StaticEnv::Dir / "dir2/DNE/"},
+ {StaticEnv::SymlinkToDir / "dir2", StaticEnv::Dir2},
+ {StaticEnv::SymlinkToDir / "dir2/../dir2/DNE/..", StaticEnv::Dir2 / ""},
+ {StaticEnv::SymlinkToDir / "dir2/dir3/../DNE/DNE2", StaticEnv::Dir2 / "DNE/DNE2"},
+ {StaticEnv::Dir / "../dir1", StaticEnv::Dir},
+ {StaticEnv::Dir / "./.", StaticEnv::Dir},
+ {StaticEnv::Dir / "DNE/../foo", StaticEnv::Dir / "foo"}
+ };
+ // clang-format on
+ int ID = 0;
+ bool Failed = false;
+ for (auto& TC : TestCases) {
+ ++ID;
+ fs::path p(TC.input);
+ const fs::path output = fs::weakly_canonical(p);
+ if (output != TC.expect) {
+ Failed = true;
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Expected: '" << TC.expect << "'\n";
+ std::cerr << " Output: '" << output.native() << "'";
+ std::cerr << std::endl;
+ }
+ }
+ return Failed;
+}
+
+TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp
index f7ce8a30e64e..37b47f1517b9 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool remove(const path& p);
// bool remove(const path& p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_remove_test_suite)
@@ -61,17 +60,29 @@ TEST_CASE(test_error_reporting)
const path file_in_bad_dir = env.create_file(bad_perms_dir / "file", 42);
permissions(bad_perms_dir, perms::none);
const path testCases[] = {
- "",
- env.make_env_path("dne"),
non_empty_dir,
file_in_bad_dir,
};
for (auto& p : testCases) {
std::error_code ec;
+
TEST_CHECK(!fs::remove(p, ec));
TEST_CHECK(ec);
TEST_CHECK(checkThrow(p, ec));
}
+
+ // PR#35780
+ const path testCasesNonexistant[] = {
+ "",
+ env.make_env_path("dne")
+ };
+
+ for (auto& p : testCasesNonexistant) {
+ std::error_code ec;
+
+ TEST_CHECK(!fs::remove(p, ec));
+ TEST_CHECK(!ec);
+ }
}
TEST_CASE(basic_remove_test)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
index b84c18c1da06..0f015c387bf8 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// uintmax_t remove_all(const path& p);
// uintmax_t remove_all(const path& p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_remove_all_test_suite)
@@ -33,7 +32,7 @@ TEST_CASE(test_signatures)
ASSERT_SAME_TYPE(decltype(fs::remove_all(p, ec)), std::uintmax_t);
ASSERT_NOT_NOEXCEPT(fs::remove_all(p));
- ASSERT_NOEXCEPT(fs::remove_all(p, ec));
+ ASSERT_NOT_NOEXCEPT(fs::remove_all(p, ec));
}
TEST_CASE(test_error_reporting)
@@ -64,16 +63,28 @@ TEST_CASE(test_error_reporting)
permissions(bad_perms_file, perms::none);
const path testCases[] = {
- env.make_env_path("dne"),
file_in_bad_dir
};
const auto BadRet = static_cast<std::uintmax_t>(-1);
for (auto& p : testCases) {
std::error_code ec;
+
TEST_CHECK(fs::remove_all(p, ec) == BadRet);
TEST_CHECK(ec);
TEST_CHECK(checkThrow(p, ec));
}
+
+ // PR#35780
+ const path testCasesNonexistant[] = {
+ "",
+ env.make_env_path("dne")
+ };
+ for (auto &p : testCasesNonexistant) {
+ std::error_code ec;
+
+ TEST_CHECK(fs::remove_all(p, ec) == 0);
+ TEST_CHECK(!ec);
+ }
}
TEST_CASE(basic_remove_all_test)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
index e265c7af6b10..e2ebdc61f650 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void rename(const path& old_p, const path& new_p);
// void rename(const path& old_p, const path& new_p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_rename_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
index f7c2ee14e83a..1a2df47e68cb 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
@@ -9,19 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// void resize_file(const path& p, uintmax_t new_size);
// void resize_file(const path& p, uintmax_t new_size, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
-namespace fs = std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_resize_file_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
index 8f241810fc7d..2c2e75af66a7 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
@@ -9,19 +9,19 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// space_info space(const path& p);
// space_info space(const path& p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <sys/statvfs.h>
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
bool EqualDelta(std::uintmax_t x, std::uintmax_t y, std::uintmax_t delta) {
if (x >= y) {
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
index fdc3d2b4a61f..ab72f2e5dcd8 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
@@ -9,18 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// file_status status(const path& p);
// file_status status(const path& p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_status_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp
index 169c5be9d9a8..d74ced643f3b 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp
@@ -9,11 +9,11 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// bool status_known(file_status s) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
@@ -21,7 +21,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(status_known_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
index 647504f6e1a4..fac630da1088 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
@@ -9,18 +9,18 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// file_status symlink_status(const path& p);
// file_status symlink_status(const path& p, error_code& ec) noexcept;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include "test_macros.h"
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
TEST_SUITE(filesystem_symlink_status_test_suite)
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
index 021dd7fc8160..523e429cf79f 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
@@ -9,12 +9,12 @@
// UNSUPPORTED: c++98, c++03
-// <experimental/filesystem>
+// <filesystem>
// path temp_directory_path();
// path temp_directory_path(error_code& ec);
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <memory>
#include <cstdlib>
#include <cstring>
@@ -24,7 +24,7 @@
#include "rapid-cxx-test.hpp"
#include "filesystem_test_helper.hpp"
-using namespace std::experimental::filesystem;
+using namespace fs;
void PutEnv(std::string var, std::string value) {
assert(::setenv(var.c_str(), value.c_str(), /* overwrite */ 1) == 0);
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp
new file mode 100644
index 000000000000..0fe058ffdfff
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <filesystem>
+
+// path weakly_canonical(const path& p);
+// path weakly_canonical(const path& p, error_code& ec);
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <vector>
+#include <iostream>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "filesystem_test_helper.hpp"
+
+
+int main() {
+ // clang-format off
+ struct {
+ std::string input;
+ std::string expect;
+ } TestCases[] = {
+ {"", fs::current_path()},
+ {".", fs::current_path()},
+ {"/", "/"},
+ {"/foo", "/foo"},
+ {"/.", "/"},
+ {"/./", "/"},
+ {"a/b", fs::current_path() / "a/b"},
+ {"a", fs::current_path() / "a"},
+ {"a/b/", fs::current_path() / "a/b/"},
+ {StaticEnv::File, StaticEnv::File},
+ {StaticEnv::Dir, StaticEnv::Dir},
+ {StaticEnv::SymlinkToDir, StaticEnv::Dir},
+ {StaticEnv::SymlinkToDir / "dir2/.", StaticEnv::Dir / "dir2"},
+ // FIXME? If the trailing separator occurs in a part of the path that exists,
+ // it is ommitted. Otherwise it is added to the end of the result.
+ {StaticEnv::SymlinkToDir / "dir2/./", StaticEnv::Dir / "dir2"},
+ {StaticEnv::SymlinkToDir / "dir2/DNE/./", StaticEnv::Dir / "dir2/DNE/"},
+ {StaticEnv::SymlinkToDir / "dir2", StaticEnv::Dir2},
+ {StaticEnv::SymlinkToDir / "dir2/../dir2/DNE/..", StaticEnv::Dir2 / ""},
+ {StaticEnv::SymlinkToDir / "dir2/dir3/../DNE/DNE2", StaticEnv::Dir2 / "DNE/DNE2"},
+ {StaticEnv::Dir / "../dir1", StaticEnv::Dir},
+ {StaticEnv::Dir / "./.", StaticEnv::Dir},
+ {StaticEnv::Dir / "DNE/../foo", StaticEnv::Dir / "foo"}
+ };
+ // clang-format on
+ int ID = 0;
+ bool Failed = false;
+ for (auto& TC : TestCases) {
+ ++ID;
+ fs::path p(TC.input);
+ const fs::path output = fs::weakly_canonical(p);
+ if (!PathEq(output, TC.expect)) {
+ Failed = true;
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Expected: '" << TC.expect << "'\n";
+ std::cerr << " Output: '" << output.native() << "'";
+ std::cerr << std::endl;
+ }
+ }
+ return Failed;
+}
diff --git a/test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp b/test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp
new file mode 100644
index 000000000000..071fa800cf64
--- /dev/null
+++ b/test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <filesystem>
+
+// #define __cpp_lib_filesystem 201703L
+
+#include <filesystem>
+#include "test_macros.h"
+
+#if TEST_STD_VER >= 17
+#ifndef __cpp_lib_filesystem
+#error Filesystem feature test macro is not defined (__cpp_lib_filesystem)
+#elif __cpp_lib_filesystem != 201703L
+#error Filesystem feature test macro has an incorrect value (__cpp_lib_filesystem)
+#endif
+#else // TEST_STD_VER < 17
+#ifdef __cpp_lib_filesystem
+#error Filesystem feature test macro should not be defined before C++17
+#endif
+#endif
+
+int main() { }
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/includes.pass.cpp b/test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp
index ddc82cb5482f..c61bb2e12e8a 100644
--- a/test/std/experimental/utilities/meta/meta.type.synop/includes.pass.cpp
+++ b/test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp
@@ -7,15 +7,23 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/type_traits>
+// REQUIRES: c++98 || c++03 || c++11 || c++14
-#include <experimental/type_traits>
+// <filesystem>
-#ifndef _LIBCPP_TYPE_TRAITS
-# error "<experimental/type_traits> must include <type_traits>"
+// namespace std::filesystem
+
+#include <filesystem>
+#include "test_macros.h"
+
+using namespace std::filesystem;
+
+#if TEST_STD_VER >= 11
+// expected-error@-3 {{no namespace named 'filesystem' in namespace 'std';}}
+#else
+// expected-error@-5 {{expected namespace name}}
#endif
-int main()
-{
+int main() {
+
}
diff --git a/test/std/experimental/utilities/tuple/tuple_size_v_2.fail.cpp b/test/std/input.output/filesystems/fs.req.namespace/namespace.pass.cpp
index a95ac49ff452..557de3488a72 100644
--- a/test/std/experimental/utilities/tuple/tuple_size_v_2.fail.cpp
+++ b/test/std/input.output/filesystems/fs.req.namespace/namespace.pass.cpp
@@ -7,19 +7,20 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03, c++11
+// UNSUPPORTED: c++98, c++03, c++11, c++14
-// <experimental/tuple>
+// <filesystem>
-// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value;
+// namespace std::filesystem
-// Test with non tuple type
+#include <filesystem>
+#include <type_traits>
-#include <experimental/tuple>
+using namespace std::filesystem;
-namespace ex = std::experimental;
-
-int main()
-{
- auto x = ex::tuple_size_v<int>;
+int main() {
+ static_assert(std::is_same<
+ path,
+ std::filesystem::path
+ >::value, "");
}
diff --git a/test/std/experimental/filesystem/lit.local.cfg b/test/std/input.output/filesystems/lit.local.cfg
index 3d9360431f48..3d9360431f48 100644
--- a/test/std/experimental/filesystem/lit.local.cfg
+++ b/test/std/input.output/filesystems/lit.local.cfg
diff --git a/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
index 6b6737a765da..5afc56d8aaaa 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
@@ -45,12 +45,12 @@ protected:
{
if (ch != base::traits_type::eof())
{
- int n = str_.size();
+ std::size_t n = str_.size();
str_.push_back(static_cast<CharT>(ch));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
- base::pbump(n+1);
+ base::pbump(static_cast<int>(n+1));
}
return ch;
}
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
index 1691a2d2de14..a45802c571dd 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
@@ -7,6 +7,14 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: with_system_cxx_lib=macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12
+// XFAIL: with_system_cxx_lib=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.10
+// XFAIL: with_system_cxx_lib=macosx10.9
+// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=macosx10.7
+
// <istream>
// basic_istream<charT,traits>& get(char_type* s, streamsize n);
@@ -14,6 +22,8 @@
#include <istream>
#include <cassert>
+#include "test_macros.h"
+
template <class CharT>
struct testbuf
: public std::basic_streambuf<CharT>
@@ -67,7 +77,33 @@ int main()
assert(!is.fail());
assert(std::string(s) == " ");
assert(is.gcount() == 1);
+ // Check that even in error case the buffer is properly 0-terminated.
+ is.get(s, 5);
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::string(s) == "");
+ assert(is.gcount() == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ testbuf<char> sb(" ");
+ std::istream is(&sb);
+ char s[5] = "test";
+ is.exceptions(std::istream::eofbit | std::istream::badbit);
+ try
+ {
+ is.get(s, 5);
+ assert(false);
+ }
+ catch (std::ios_base::failure&)
+ {
+ }
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::string(s) == " ");
+ assert(is.gcount() == 1);
}
+#endif
{
testbuf<wchar_t> sb(L" \n \n ");
std::wistream is(&sb);
@@ -95,5 +131,31 @@ int main()
assert(!is.fail());
assert(std::wstring(s) == L" ");
assert(is.gcount() == 1);
+ // Check that even in error case the buffer is properly 0-terminated.
+ is.get(s, 5);
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::wstring(s) == L"");
+ assert(is.gcount() == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ testbuf<wchar_t> sb(L" ");
+ std::wistream is(&sb);
+ wchar_t s[5] = L"test";
+ is.exceptions(std::wistream::eofbit | std::wistream::badbit);
+ try
+ {
+ is.get(s, 5);
+ assert(false);
+ }
+ catch (std::ios_base::failure&)
+ {
+ }
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::wstring(s) == L" ");
+ assert(is.gcount() == 1);
}
+#endif
}
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
index c9389ec9dad5..437af84f9d61 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
@@ -7,6 +7,14 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: with_system_cxx_lib=macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12
+// XFAIL: with_system_cxx_lib=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.10
+// XFAIL: with_system_cxx_lib=macosx10.9
+// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=macosx10.7
+
// <istream>
// basic_istream<charT,traits>& get(char_type* s, streamsize n, char_type delim);
@@ -14,6 +22,8 @@
#include <istream>
#include <cassert>
+#include "test_macros.h"
+
template <class CharT>
struct testbuf
: public std::basic_streambuf<CharT>
@@ -67,7 +77,33 @@ int main()
assert(!is.fail());
assert(std::string(s) == " ");
assert(is.gcount() == 1);
+ // Check that even in error case the buffer is properly 0-terminated.
+ is.get(s, 5, '*');
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::string(s) == "");
+ assert(is.gcount() == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ testbuf<char> sb(" ");
+ std::istream is(&sb);
+ char s[5] = "test";
+ is.exceptions(std::istream::eofbit | std::istream::badbit);
+ try
+ {
+ is.get(s, 5, '*');
+ assert(false);
+ }
+ catch (std::ios_base::failure&)
+ {
+ }
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::string(s) == " ");
+ assert(is.gcount() == 1);
}
+#endif
{
testbuf<wchar_t> sb(L" * * ");
std::wistream is(&sb);
@@ -95,5 +131,31 @@ int main()
assert(!is.fail());
assert(std::wstring(s) == L" ");
assert(is.gcount() == 1);
+ // Check that even in error case the buffer is properly 0-terminated.
+ is.get(s, 5, L'*');
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::wstring(s) == L"");
+ assert(is.gcount() == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ testbuf<wchar_t> sb(L" ");
+ std::wistream is(&sb);
+ wchar_t s[5] = L"test";
+ is.exceptions(std::wistream::eofbit | std::wistream::badbit);
+ try
+ {
+ is.get(s, 5, L'*');
+ assert(false);
+ }
+ catch (std::ios_base::failure&)
+ {
+ }
+ assert( is.eof());
+ assert( is.fail());
+ assert(std::wstring(s) == L" ");
+ assert(is.gcount() == 1);
}
+#endif
}
diff --git a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
index 50f5fdad7442..44c55118d5af 100644
--- a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
@@ -15,6 +15,7 @@
#include <ios>
#include <string>
+#include <system_error>
#include <cassert>
int main()
@@ -25,7 +26,8 @@ int main()
assert(se.code() == std::make_error_code(std::errc::is_a_directory));
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
- assert(what_message.find("Is a directory") != std::string::npos);
+ assert(what_message.find(std::generic_category().message(static_cast<int>
+ (std::errc::is_a_directory))) != std::string::npos);
}
{
std::string what_arg("io test message");
diff --git a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
index a9c5f30f37ae..5711b55c7e84 100644
--- a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
@@ -15,6 +15,7 @@
#include <ios>
#include <string>
+#include <system_error>
#include <cassert>
int main()
@@ -28,7 +29,8 @@ int main()
assert(se.code() == std::make_error_code(std::errc::is_a_directory));
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
- assert(what_message.find("Is a directory") != std::string::npos);
+ assert(what_message.find(std::generic_category().message(static_cast<int>
+ (std::errc::is_a_directory))) != std::string::npos);
}
{
std::string what_arg("io test message");
diff --git a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
index 4ede8a514f96..23867e63fe25 100644
--- a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
+++ b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
@@ -48,7 +48,6 @@ struct test
assert(t.pptr() == old_this.pptr());
assert(t.epptr() == old_this.epptr());
assert(t.getloc() == old_this.getloc());
- return *this;
}
void setg(CharT* gbeg, CharT* gnext, CharT* gend)
@@ -66,12 +65,12 @@ int main()
{
test<char> t;
test<char> t2;
- swap(t2, t);
+ t2.swap(t);
}
{
test<wchar_t> t;
test<wchar_t> t2;
- swap(t2, t);
+ t2.swap(t);
}
{
char g1, g2, g3, p1, p3;
@@ -79,7 +78,7 @@ int main()
t.setg(&g1, &g2, &g3);
t.setp(&p1, &p3);
test<char> t2;
- swap(t2, t);
+ t2.swap(t);
}
{
wchar_t g1, g2, g3, p1, p3;
@@ -87,17 +86,17 @@ int main()
t.setg(&g1, &g2, &g3);
t.setp(&p1, &p3);
test<wchar_t> t2;
- swap(t2, t);
+ t2.swap(t);
}
std::locale::global(std::locale(LOCALE_en_US_UTF_8));
{
test<char> t;
test<char> t2;
- swap(t2, t);
+ t2.swap(t);
}
{
test<wchar_t> t;
test<wchar_t> t2;
- swap(t2, t);
+ t2.swap(t);
}
}
diff --git a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
index e7bdd897c745..460e4c07ec9f 100644
--- a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
+++ b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
@@ -32,12 +32,13 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
#endif
- std::string str(2147483648, 'a');
- SB sb;
- sb.str(str);
- assert(sb.pubpbase() <= sb.pubpptr());
+ std::string str(2147483648, 'a');
+ SB sb;
+ sb.str(str);
+ assert(sb.pubpbase() <= sb.pubpptr());
#ifndef TEST_HAS_NO_EXCEPTIONS
- }
- catch (const std::bad_alloc &) {}
+ }
+ catch (const std::length_error &) {} // maybe the string can't take 2GB
+ catch (const std::bad_alloc &) {} // maybe we don't have enough RAM
#endif
}
diff --git a/test/std/iterators/iterator.container/data.pass.cpp b/test/std/iterators/iterator.container/data.pass.cpp
index 09b7c0134962..12ca9129526f 100644
--- a/test/std/iterators/iterator.container/data.pass.cpp
+++ b/test/std/iterators/iterator.container/data.pass.cpp
@@ -23,6 +23,10 @@
#include "test_macros.h"
+#if TEST_STD_VER > 14
+#include <string_view>
+#endif
+
template<typename C>
void test_const_container( const C& c )
{
@@ -72,6 +76,12 @@ int main()
test_const_container ( a );
test_const_container ( il );
+#if TEST_STD_VER > 14
+ std::string_view sv{"ABC"};
+ test_container ( sv );
+ test_const_container ( sv );
+#endif
+
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
}
diff --git a/test/std/iterators/iterator.container/empty.pass.cpp b/test/std/iterators/iterator.container/empty.pass.cpp
index cd000cc2fe76..f6fe2351d3c0 100644
--- a/test/std/iterators/iterator.container/empty.pass.cpp
+++ b/test/std/iterators/iterator.container/empty.pass.cpp
@@ -23,6 +23,10 @@
#include "test_macros.h"
+#if TEST_STD_VER > 14
+#include <string_view>
+#endif
+
template<typename C>
void test_const_container( const C& c )
{
@@ -74,6 +78,12 @@ int main()
test_const_container ( a );
test_const_container ( il );
+#if TEST_STD_VER > 14
+ std::string_view sv{"ABC"};
+ test_container ( sv );
+ test_const_container ( sv );
+#endif
+
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
}
diff --git a/test/std/iterators/iterator.container/size.pass.cpp b/test/std/iterators/iterator.container/size.pass.cpp
index 7d443e6e123c..6d3bc5128915 100644
--- a/test/std/iterators/iterator.container/size.pass.cpp
+++ b/test/std/iterators/iterator.container/size.pass.cpp
@@ -22,6 +22,11 @@
#include "test_macros.h"
+#if TEST_STD_VER > 14
+#include <string_view>
+#endif
+
+
template<typename C>
void test_const_container( const C& c )
{
@@ -65,7 +70,6 @@ int main()
std::list<int> l; l.push_back(2);
std::array<int, 1> a; a[0] = 3;
std::initializer_list<int> il = { 4 };
-
test_container ( v );
test_container ( l );
test_container ( a );
@@ -76,6 +80,12 @@ int main()
test_const_container ( a );
test_const_container ( il );
+#if TEST_STD_VER > 14
+ std::string_view sv{"ABC"};
+ test_container ( sv );
+ test_const_container ( sv );
+#endif
+
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
}
diff --git a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
index 0baefb5ee766..cc451c0a278d 100644
--- a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
+++ b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
@@ -17,11 +17,13 @@
#include <sstream>
#include <cassert>
-#if defined(__clang__)
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG)
#pragma clang diagnostic ignored "-Wliteral-conversion"
#endif
-#ifdef _MSC_VER
+#ifdef TEST_COMPILER_C1XX
#pragma warning(disable: 4244) // conversion from 'X' to 'Y', possible loss of data
#endif
diff --git a/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp b/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
index 9d93bad370d0..64997d382dd9 100644
--- a/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
+++ b/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
@@ -17,14 +17,27 @@
#include <sstream>
#include <cassert>
+template <typename Char, typename Traits = std::char_traits<Char> >
+struct my_streambuf : public std::basic_streambuf<Char,Traits> {
+ typedef typename std::basic_streambuf<Char,Traits>::int_type int_type;
+ typedef typename std::basic_streambuf<Char,Traits>::char_type char_type;
+
+ my_streambuf() {}
+ int_type sputc(char_type) { return Traits::eof(); }
+ };
+
int main()
{
{
- std::ostreambuf_iterator<char> i(nullptr);
+ my_streambuf<char> buf;
+ std::ostreambuf_iterator<char> i(&buf);
+ i = 'a';
assert(i.failed());
}
{
- std::ostreambuf_iterator<wchar_t> i(nullptr);
+ my_streambuf<wchar_t> buf;
+ std::ostreambuf_iterator<wchar_t> i(&buf);
+ i = L'a';
assert(i.failed());
}
}
diff --git a/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp b/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp
new file mode 100644
index 000000000000..f146dace65ee
--- /dev/null
+++ b/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <compare>
+
+// template <class ...Ts> struct common_comparison_category
+// template <class ...Ts> using common_comparison_category_t
+
+
+#include <compare>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+const volatile void* volatile sink;
+
+template <class Expect, class ...Args>
+void test_cat() {
+ using Cat = std::common_comparison_category<Args...>;
+ using CatT = typename Cat::type;
+ static_assert(std::is_same<CatT, std::common_comparison_category_t<Args...>>::value, "");
+ static_assert(std::is_same<CatT, Expect>::value, "expected different category");
+};
+
+
+// [class.spaceship]p4: The 'common comparison type' U of a possibly-empty list
+// of 'n' types T0, T1, ..., TN, is defined as follows:
+int main() {
+ using WE = std::weak_equality;
+ using SE = std::strong_equality;
+ using PO = std::partial_ordering;
+ using WO = std::weak_ordering;
+ using SO = std::strong_ordering;
+
+ // [class.spaceship]p4.1: If any Ti is not a comparison category tpe, U is void.
+ {
+ test_cat<void, void>();
+ test_cat<void, int*>();
+ test_cat<void, SO&>();
+ test_cat<void, SO const>();
+ test_cat<void, SO*>();
+ test_cat<void, SO, void, SO>();
+ }
+
+ // [class.spaceship]p4.2: Otherwise, if at least on Ti is
+ // std::weak_equality, or at least one Ti is std::strong_equality and at least
+ // one Tj is std::partial_ordering or std::weak_ordering, U is std::weak_equality
+ {
+ test_cat<WE, WE>();
+ test_cat<WE, SO, WE, SO>();
+ test_cat<WE, SE, SO, PO>();
+ test_cat<WE, WO, SO, SE>();
+ }
+
+ // [class.spaceship]p4.3: Otherwise, if at least one Ti is std::strong_equality,
+ // U is std::strong_equality
+ {
+ test_cat<SE, SE>();
+ test_cat<SE, SO, SE, SO>();
+ }
+
+ // [class.spaceship]p4.4: Otherwise, if at least one Ti is std::partial_ordering,
+ // U is std::partial_ordering
+ {
+ test_cat<PO, PO>();
+ test_cat<PO, SO, PO, SO>();
+ test_cat<PO, WO, PO, SO>();
+ }
+
+ // [class.spaceship]p4.5: Otherwise, if at least one Ti is std::weak_ordering,
+ // U is std::weak_ordering
+ {
+ test_cat<WO, WO>();
+ test_cat<WO, SO, WO, SO>();
+ }
+
+ // [class.spaceship]p4.6: Otherwise, U is std::strong_ordering. [Note: in
+ // particular this is the result when n is 0. -- end note]
+ {
+ test_cat<SO>(); // empty type list
+ test_cat<SO, SO>();
+ test_cat<SO, SO, SO>();
+ }
+}
diff --git a/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp b/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
new file mode 100644
index 000000000000..a80477151ef2
--- /dev/null
+++ b/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
@@ -0,0 +1,164 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <compare>
+
+// class partial_ordering
+
+
+#include <compare>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+const volatile void* volatile sink;
+
+void test_static_members() {
+ DoNotOptimize(&std::partial_ordering::less);
+ DoNotOptimize(&std::partial_ordering::equivalent);
+ DoNotOptimize(&std::partial_ordering::greater);
+ DoNotOptimize(&std::partial_ordering::unordered);
+}
+
+void test_signatures() {
+ auto& Eq = std::partial_ordering::equivalent;
+
+ ASSERT_NOEXCEPT(Eq == 0);
+ ASSERT_NOEXCEPT(0 == Eq);
+ ASSERT_NOEXCEPT(Eq != 0);
+ ASSERT_NOEXCEPT(0 != Eq);
+ ASSERT_NOEXCEPT(0 < Eq);
+ ASSERT_NOEXCEPT(Eq < 0);
+ ASSERT_NOEXCEPT(0 <= Eq);
+ ASSERT_NOEXCEPT(Eq <= 0);
+ ASSERT_NOEXCEPT(0 > Eq);
+ ASSERT_NOEXCEPT(Eq > 0);
+ ASSERT_NOEXCEPT(0 >= Eq);
+ ASSERT_NOEXCEPT(Eq >= 0);
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ ASSERT_NOEXCEPT(0 <=> Eq);
+ ASSERT_NOEXCEPT(Eq <=> 0);
+ ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::partial_ordering);
+ ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::partial_ordering);
+#endif
+}
+
+constexpr bool test_conversion() {
+ static_assert(std::is_convertible<const std::partial_ordering, std::weak_equality>::value, "");
+ { // value == 0
+ auto V = std::partial_ordering::equivalent;
+ std::weak_equality WV = V;
+ assert(WV == 0);
+ }
+ std::partial_ordering TestCases[] = {
+ std::partial_ordering::less,
+ std::partial_ordering::greater,
+ std::partial_ordering::unordered
+ };
+ for (auto V : TestCases)
+ { // value != 0
+ std::weak_equality WV = V;
+ assert(WV != 0);
+ }
+ return true;
+}
+
+constexpr bool test_constexpr() {
+ auto& Eq = std::partial_ordering::equivalent;
+ auto& Less = std::partial_ordering::less;
+ auto& Greater = std::partial_ordering::greater;
+ auto& Unord = std::partial_ordering::unordered;
+ struct {
+ std::partial_ordering Value;
+ bool ExpectEq;
+ bool ExpectNeq;
+ bool ExpectLess;
+ bool ExpectGreater;
+ } TestCases[] = {
+ {Eq, true, false, false, false},
+ {Less, false, true, true, false},
+ {Greater, false, true, false, true},
+ {Unord, false, true, false, false}
+ };
+ for (auto TC : TestCases) {
+ auto V = TC.Value;
+ assert((V == 0) == TC.ExpectEq);
+ assert((0 == V) == TC.ExpectEq);
+ assert((V != 0) == TC.ExpectNeq);
+ assert((0 != V) == TC.ExpectNeq);
+
+ assert((V < 0) == TC.ExpectLess);
+ assert((V > 0) == TC.ExpectGreater);
+ assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq));
+ assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq));
+
+ assert((0 < V) == TC.ExpectGreater);
+ assert((0 > V) == TC.ExpectLess);
+ assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
+ assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
+ }
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ {
+ std::partial_ordering res = (Eq <=> 0);
+ ((void)res);
+ res = (0 <=> Eq);
+ ((void)res);
+ }
+ enum ExpectRes {
+ ER_Greater,
+ ER_Less,
+ ER_Equiv,
+ ER_Unord
+ };
+ struct {
+ std::partial_ordering Value;
+ ExpectRes Expect;
+ } SpaceshipTestCases[] = {
+ {std::partial_ordering::equivalent, ER_Equiv},
+ {std::partial_ordering::less, ER_Less},
+ {std::partial_ordering::greater, ER_Greater},
+ {std::partial_ordering::unordered, ER_Unord}
+ };
+ for (auto TC : SpaceshipTestCases)
+ {
+ std::partial_ordering Res = (0 <=> TC.Value);
+ switch (TC.Expect) {
+ case ER_Equiv:
+ assert(Res == 0);
+ assert(0 == Res);
+ break;
+ case ER_Less:
+ assert(Res < 0);
+ break;
+ case ER_Greater:
+ assert(Res > 0);
+ break;
+ case ER_Unord:
+ assert(Res != 0);
+ assert(0 != Res);
+ assert((Res < 0) == false);
+ assert((Res > 0) == false);
+ assert((Res == 0) == false);
+ break;
+ }
+ }
+#endif
+
+ return true;
+}
+
+int main() {
+ test_static_members();
+ test_signatures();
+ static_assert(test_conversion(), "conversion test failed");
+ static_assert(test_constexpr(), "constexpr test failed");
+}
diff --git a/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp b/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp
new file mode 100644
index 000000000000..07fc26eed5b1
--- /dev/null
+++ b/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <compare>
+
+// class strong_equality
+
+
+#include <compare>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+const volatile void* volatile sink;
+
+void test_static_members() {
+ DoNotOptimize(&std::strong_equality::equal);
+ DoNotOptimize(&std::strong_equality::nonequal);
+ DoNotOptimize(&std::strong_equality::equivalent);
+ DoNotOptimize(&std::strong_equality::nonequivalent);
+}
+
+void test_signatures() {
+ auto& Eq = std::strong_equality::equivalent;
+
+ ASSERT_NOEXCEPT(Eq == 0);
+ ASSERT_NOEXCEPT(0 == Eq);
+ ASSERT_NOEXCEPT(Eq != 0);
+ ASSERT_NOEXCEPT(0 != Eq);
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ ASSERT_NOEXCEPT(0 <=> Eq);
+ ASSERT_NOEXCEPT(Eq <=> 0);
+ ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::strong_equality);
+ ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::strong_equality);
+#endif
+}
+
+void test_conversion() {
+ constexpr std::weak_equality res = std::strong_equality::equivalent;
+ static_assert(res == 0, "");
+ static_assert(std::is_convertible<const std::strong_equality&,
+ std::weak_equality>::value, "");
+ static_assert(res == 0, "expected equal");
+
+ constexpr std::weak_equality neq_res = std::strong_equality::nonequivalent;
+ static_assert(neq_res != 0, "expected not equal");
+}
+
+constexpr bool test_constexpr() {
+ auto& Eq = std::strong_equality::equal;
+ auto& NEq = std::strong_equality::nonequal;
+ auto& Equiv = std::strong_equality::equivalent;
+ auto& NEquiv = std::strong_equality::nonequivalent;
+ assert((Eq == 0) == true);
+ assert((0 == Eq) == true);
+ assert((Equiv == 0) == true);
+ assert((0 == Equiv) == true);
+ assert((NEq == 0) == false);
+ assert((0 == NEq) == false);
+ assert((NEquiv == 0) == false);
+ assert((0 == NEquiv) == false);
+
+ assert((Eq != 0) == false);
+ assert((0 != Eq) == false);
+ assert((Equiv != 0) == false);
+ assert((0 != Equiv) == false);
+ assert((NEq != 0) == true);
+ assert((0 != NEq) == true);
+ assert((NEquiv != 0) == true);
+ assert((0 != NEquiv) == true);
+
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ std::strong_equality res = (Eq <=> 0);
+ ((void)res);
+ res = (0 <=> Eq);
+ ((void)res);
+#endif
+
+ return true;
+}
+
+int main() {
+ test_static_members();
+ test_signatures();
+ test_conversion();
+ static_assert(test_constexpr(), "constexpr test failed");
+}
diff --git a/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp b/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
new file mode 100644
index 000000000000..0bdd68679b44
--- /dev/null
+++ b/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
@@ -0,0 +1,212 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <compare>
+
+// class strong_ordering
+
+
+#include <compare>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+const volatile void* volatile sink;
+
+void test_static_members() {
+ DoNotOptimize(&std::strong_ordering::less);
+ DoNotOptimize(&std::strong_ordering::equal);
+ DoNotOptimize(&std::strong_ordering::equivalent);
+ DoNotOptimize(&std::strong_ordering::greater);
+}
+
+void test_signatures() {
+ auto& Eq = std::strong_ordering::equivalent;
+
+ ASSERT_NOEXCEPT(Eq == 0);
+ ASSERT_NOEXCEPT(0 == Eq);
+ ASSERT_NOEXCEPT(Eq != 0);
+ ASSERT_NOEXCEPT(0 != Eq);
+ ASSERT_NOEXCEPT(0 < Eq);
+ ASSERT_NOEXCEPT(Eq < 0);
+ ASSERT_NOEXCEPT(0 <= Eq);
+ ASSERT_NOEXCEPT(Eq <= 0);
+ ASSERT_NOEXCEPT(0 > Eq);
+ ASSERT_NOEXCEPT(Eq > 0);
+ ASSERT_NOEXCEPT(0 >= Eq);
+ ASSERT_NOEXCEPT(Eq >= 0);
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ ASSERT_NOEXCEPT(0 <=> Eq);
+ ASSERT_NOEXCEPT(Eq <=> 0);
+ ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::strong_ordering);
+ ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::strong_ordering);
+#endif
+}
+
+constexpr bool test_conversion() {
+ static_assert(std::is_convertible<const std::strong_ordering&,
+ std::weak_equality>::value, "");
+ { // value == 0
+ auto V = std::strong_ordering::equivalent;
+ std::weak_equality WV = V;
+ assert(WV == 0);
+ }
+ std::strong_ordering WeakTestCases[] = {
+ std::strong_ordering::less,
+ std::strong_ordering::greater,
+ };
+ for (auto V : WeakTestCases)
+ { // value != 0
+ std::weak_equality WV = V;
+ assert(WV != 0);
+ }
+ static_assert(std::is_convertible<const std::strong_ordering&,
+ std::strong_equality>::value, "");
+ { // value == 0
+ auto V = std::strong_ordering::equivalent;
+ std::strong_equality WV = V;
+ assert(WV == 0);
+ }
+ { // value == 0
+ auto V = std::strong_ordering::equal;
+ std::strong_equality WV = V;
+ assert(WV == 0);
+ }
+ std::strong_ordering StrongTestCases[] = {
+ std::strong_ordering::less,
+ std::strong_ordering::greater,
+ };
+ for (auto V : StrongTestCases)
+ { // value != 0
+ std::strong_equality WV = V;
+ assert(WV != 0);
+ }
+
+ static_assert(std::is_convertible<const std::strong_ordering&,
+ std::partial_ordering>::value, "");
+ { // value == 0
+ auto V = std::strong_ordering::equivalent;
+ std::partial_ordering WV = V;
+ assert(WV == 0);
+ }
+ { // value < 0
+ auto V = std::strong_ordering::less;
+ std::partial_ordering WV = V;
+ assert(WV < 0);
+ }
+ { // value > 0
+ auto V = std::strong_ordering::greater;
+ std::partial_ordering WV = V;
+ assert(WV > 0);
+ }
+
+ static_assert(std::is_convertible<const std::strong_ordering&,
+ std::weak_ordering>::value, "");
+ { // value == 0
+ auto V = std::strong_ordering::equivalent;
+ std::weak_ordering WV = V;
+ assert(WV == 0);
+ }
+ { // value < 0
+ auto V = std::strong_ordering::less;
+ std::weak_ordering WV = V;
+ assert(WV < 0);
+ }
+ { // value > 0
+ auto V = std::strong_ordering::greater;
+ std::weak_ordering WV = V;
+ assert(WV > 0);
+ }
+ return true;
+}
+
+constexpr bool test_constexpr() {
+ auto& Eq = std::strong_ordering::equal;
+ auto& Equiv = std::strong_ordering::equivalent;
+ auto& Less = std::strong_ordering::less;
+ auto& Greater = std::strong_ordering::greater;
+ struct {
+ std::strong_ordering Value;
+ bool ExpectEq;
+ bool ExpectNeq;
+ bool ExpectLess;
+ bool ExpectGreater;
+ } TestCases[] = {
+ {Eq, true, false, false, false},
+ {Equiv, true, false, false, false},
+ {Less, false, true, true, false},
+ {Greater, false, true, false, true},
+ };
+ for (auto TC : TestCases) {
+ auto V = TC.Value;
+ assert((V == 0) == TC.ExpectEq);
+ assert((0 == V) == TC.ExpectEq);
+ assert((V != 0) == TC.ExpectNeq);
+ assert((0 != V) == TC.ExpectNeq);
+
+ assert((V < 0) == TC.ExpectLess);
+ assert((V > 0) == TC.ExpectGreater);
+ assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq));
+ assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq));
+
+ assert((0 < V) == TC.ExpectGreater);
+ assert((0 > V) == TC.ExpectLess);
+ assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
+ assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
+ }
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ {
+ std::strong_ordering res = (Eq <=> 0);
+ ((void)res);
+ res = (0 <=> Eq);
+ ((void)res);
+ }
+ enum ExpectRes {
+ ER_Greater,
+ ER_Less,
+ ER_Equiv
+ };
+ struct {
+ std::strong_ordering Value;
+ ExpectRes Expect;
+ } SpaceshipTestCases[] = {
+ {std::strong_ordering::equivalent, ER_Equiv},
+ {std::strong_ordering::less, ER_Less},
+ {std::strong_ordering::greater, ER_Greater},
+ };
+ for (auto TC : SpaceshipTestCases)
+ {
+ std::strong_ordering Res = (0 <=> TC.Value);
+ switch (TC.Expect) {
+ case ER_Equiv:
+ assert(Res == 0);
+ assert(0 == Res);
+ break;
+ case ER_Less:
+ assert(Res < 0);
+ break;
+ case ER_Greater:
+ assert(Res > 0);
+ break;
+ }
+ }
+#endif
+
+ return true;
+}
+
+int main() {
+ test_static_members();
+ test_signatures();
+ static_assert(test_conversion(), "conversion test failed");
+ static_assert(test_constexpr(), "constexpr test failed");
+}
diff --git a/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp b/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp
new file mode 100644
index 000000000000..375cff460cde
--- /dev/null
+++ b/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <compare>
+
+// class weak_equality
+
+
+#include <compare>
+#include <cassert>
+#include "test_macros.h"
+
+const volatile void* volatile sink;
+
+void test_static_members() {
+ DoNotOptimize(&std::weak_equality::equivalent);
+ DoNotOptimize(&std::weak_equality::nonequivalent);
+}
+
+void test_signatures() {
+ auto& Eq = std::weak_equality::equivalent;
+
+ ASSERT_NOEXCEPT(Eq == 0);
+ ASSERT_NOEXCEPT(0 == Eq);
+ ASSERT_NOEXCEPT(Eq != 0);
+ ASSERT_NOEXCEPT(0 != Eq);
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ ASSERT_NOEXCEPT(0 <=> Eq);
+ ASSERT_NOEXCEPT(Eq <=> 0);
+ ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::weak_equality);
+ ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::weak_equality);
+#endif
+}
+
+constexpr bool test_constexpr() {
+ auto& Eq = std::weak_equality::equivalent;
+ auto& NEq = std::weak_equality::nonequivalent;
+ assert((Eq == 0) == true);
+ assert((0 == Eq) == true);
+ assert((NEq == 0) == false);
+ assert((0 == NEq) == false);
+
+ assert((Eq != 0) == false);
+ assert((0 != Eq) == false);
+ assert((NEq != 0) == true);
+ assert((0 != NEq) == true);
+
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ std::weak_equality res = (Eq <=> 0);
+ ((void)res);
+ res = (0 <=> Eq);
+ ((void)res);
+#endif
+
+ return true;
+}
+
+int main() {
+ test_static_members();
+ test_signatures();
+ static_assert(test_constexpr(), "constexpr test failed");
+}
diff --git a/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp b/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
new file mode 100644
index 000000000000..0a52680323b2
--- /dev/null
+++ b/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
@@ -0,0 +1,169 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <compare>
+
+// class weak_ordering
+
+
+#include <compare>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+const volatile void* volatile sink;
+
+void test_static_members() {
+ DoNotOptimize(&std::weak_ordering::less);
+ DoNotOptimize(&std::weak_ordering::equivalent);
+ DoNotOptimize(&std::weak_ordering::greater);
+}
+
+void test_signatures() {
+ auto& Eq = std::weak_ordering::equivalent;
+
+ ASSERT_NOEXCEPT(Eq == 0);
+ ASSERT_NOEXCEPT(0 == Eq);
+ ASSERT_NOEXCEPT(Eq != 0);
+ ASSERT_NOEXCEPT(0 != Eq);
+ ASSERT_NOEXCEPT(0 < Eq);
+ ASSERT_NOEXCEPT(Eq < 0);
+ ASSERT_NOEXCEPT(0 <= Eq);
+ ASSERT_NOEXCEPT(Eq <= 0);
+ ASSERT_NOEXCEPT(0 > Eq);
+ ASSERT_NOEXCEPT(Eq > 0);
+ ASSERT_NOEXCEPT(0 >= Eq);
+ ASSERT_NOEXCEPT(Eq >= 0);
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ ASSERT_NOEXCEPT(0 <=> Eq);
+ ASSERT_NOEXCEPT(Eq <=> 0);
+ ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::weak_ordering);
+ ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::weak_ordering);
+#endif
+}
+
+constexpr bool test_conversion() {
+ static_assert(std::is_convertible<const std::weak_ordering&,
+ std::weak_equality>::value, "");
+ { // value == 0
+ auto V = std::weak_ordering::equivalent;
+ std::weak_equality WV = V;
+ assert(WV == 0);
+ }
+ std::weak_ordering WeakTestCases[] = {
+ std::weak_ordering::less,
+ std::weak_ordering::greater,
+ };
+ for (auto V : WeakTestCases)
+ { // value != 0
+ std::weak_equality WV = V;
+ assert(WV != 0);
+ }
+ static_assert(std::is_convertible<const std::weak_ordering&,
+ std::partial_ordering>::value, "");
+ { // value == 0
+ auto V = std::weak_ordering::equivalent;
+ std::partial_ordering WV = V;
+ assert(WV == 0);
+ }
+ { // value < 0
+ auto V = std::weak_ordering::less;
+ std::partial_ordering WV = V;
+ assert(WV < 0);
+ }
+ { // value > 0
+ auto V = std::weak_ordering::greater;
+ std::partial_ordering WV = V;
+ assert(WV > 0);
+ }
+ return true;
+}
+
+constexpr bool test_constexpr() {
+ auto& Eq = std::weak_ordering::equivalent;
+ auto& Less = std::weak_ordering::less;
+ auto& Greater = std::weak_ordering::greater;
+ struct {
+ std::weak_ordering Value;
+ bool ExpectEq;
+ bool ExpectNeq;
+ bool ExpectLess;
+ bool ExpectGreater;
+ } TestCases[] = {
+ {Eq, true, false, false, false},
+ {Less, false, true, true, false},
+ {Greater, false, true, false, true},
+ };
+ for (auto TC : TestCases) {
+ auto V = TC.Value;
+ assert((V == 0) == TC.ExpectEq);
+ assert((0 == V) == TC.ExpectEq);
+ assert((V != 0) == TC.ExpectNeq);
+ assert((0 != V) == TC.ExpectNeq);
+
+ assert((V < 0) == TC.ExpectLess);
+ assert((V > 0) == TC.ExpectGreater);
+ assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq));
+ assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq));
+
+ assert((0 < V) == TC.ExpectGreater);
+ assert((0 > V) == TC.ExpectLess);
+ assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
+ assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
+ }
+#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
+ {
+ std::weak_ordering res = (Eq <=> 0);
+ ((void)res);
+ res = (0 <=> Eq);
+ ((void)res);
+ }
+ enum ExpectRes {
+ ER_Greater,
+ ER_Less,
+ ER_Equiv
+ };
+ struct {
+ std::weak_ordering Value;
+ ExpectRes Expect;
+ } SpaceshipTestCases[] = {
+ {std::weak_ordering::equivalent, ER_Equiv},
+ {std::weak_ordering::less, ER_Less},
+ {std::weak_ordering::greater, ER_Greater},
+ };
+ for (auto TC : SpaceshipTestCases)
+ {
+ std::weak_ordering Res = (0 <=> TC.Value);
+ switch (TC.Expect) {
+ case ER_Equiv:
+ assert(Res == 0);
+ assert(0 == Res);
+ break;
+ case ER_Less:
+ assert(Res < 0);
+ break;
+ case ER_Greater:
+ assert(Res > 0);
+ break;
+ }
+ }
+#endif
+
+ return true;
+}
+
+int main() {
+ test_static_members();
+ test_signatures();
+ static_assert(test_conversion(), "conversion test failed");
+ static_assert(test_constexpr(), "constexpr test failed");
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
index 828feabd2127..2175e29a040d 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
@@ -69,31 +69,32 @@ void operator delete [] (void* p, std::align_val_t) TEST_NOEXCEPT
struct alignas(OverAligned) A {};
struct alignas(std::max_align_t) B {};
-B* volatile b; // Escape the memory
-A* volatile a;
-
int main()
{
reset();
{
- b = new B[2];
+ B *b = new B[2];
+ DoNotOptimize(b);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == aligned_delete_called);
delete [] b;
+ DoNotOptimize(b);
assert(1 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == aligned_delete_called);
}
reset();
{
- a = new A[2];
+ A *a = new A[2];
+ DoNotOptimize(a);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == aligned_delete_called);
delete [] a;
+ DoNotOptimize(a);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(1 == aligned_delete_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
index 82dc77efe89e..d8e08a3a0bdb 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
@@ -53,7 +53,9 @@ void* operator new[](std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad
assert(s <= sizeof(DummyData));
assert(static_cast<std::size_t>(a) == OverAligned);
++new_called;
- return DummyData;
+ void *Ret = DummyData;
+ DoNotOptimize(Ret);
+ return Ret;
}
void operator delete[](void* p, std::align_val_t) TEST_NOEXCEPT
@@ -61,6 +63,7 @@ void operator delete[](void* p, std::align_val_t) TEST_NOEXCEPT
assert(new_called == 1);
--new_called;
assert(p == DummyData);
+ DoNotOptimize(p);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
index 5aecc2da0847..58ff728e6332 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
@@ -41,8 +41,8 @@ int main()
std::set_new_handler(my_new_handler);
try
{
- void* volatile vp = operator new[] (std::numeric_limits<std::size_t>::max());
- ((void)vp);
+ void* vp = operator new[] (std::numeric_limits<std::size_t>::max());
+ DoNotOptimize(vp);
assert(false);
}
catch (std::bad_alloc&)
@@ -55,8 +55,10 @@ int main()
}
#endif
A* ap = new A[3];
+ DoNotOptimize(ap);
assert(ap);
assert(A_constructed == 3);
delete [] ap;
+ DoNotOptimize(ap);
assert(A_constructed == 0);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
index c1606b27da79..f29f0c09e4f3 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
@@ -42,7 +42,8 @@ int main()
try
#endif
{
- void*volatile vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow);
+ void* vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow);
+ DoNotOptimize(vp);
assert(new_handler_called == 1);
assert(vp == 0);
}
@@ -53,8 +54,10 @@ int main()
}
#endif
A* ap = new(std::nothrow) A[3];
+ DoNotOptimize(ap);
assert(ap);
assert(A_constructed == 3);
delete [] ap;
+ DoNotOptimize(ap);
assert(A_constructed == 0);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
index ba3f930c5f14..3d8467faa3e8 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
@@ -36,7 +36,7 @@ void operator delete(void* p) TEST_NOEXCEPT
std::free(p);
}
-volatile int A_constructed = 0;
+int A_constructed = 0;
struct A
{
@@ -44,15 +44,15 @@ struct A
~A() {--A_constructed;}
};
-A* volatile ap;
-
int main()
{
- ap = new (std::nothrow) A[3];
+ A *ap = new (std::nothrow) A[3];
+ DoNotOptimize(ap);
assert(ap);
assert(A_constructed == 3);
assert(new_called);
delete [] ap;
+ DoNotOptimize(ap);
assert(A_constructed == 0);
assert(!new_called);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
index 3f8122745cc4..ad4d9f469d42 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
@@ -21,7 +21,7 @@
#include "test_macros.h"
-volatile int new_called = 0;
+int new_called = 0;
void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
@@ -45,15 +45,15 @@ struct A
~A() {--A_constructed;}
};
-A* volatile ap;
-
int main()
{
- ap = new A[3];
+ A *ap = new A[3];
+ DoNotOptimize(ap);
assert(ap);
assert(A_constructed == 3);
assert(new_called == 1);
delete [] ap;
+ DoNotOptimize(ap);
assert(A_constructed == 0);
assert(new_called == 0);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp
index 862318d0be7b..ef9ec2db9d19 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp
@@ -12,7 +12,7 @@
// Note that sized delete operator definitions below are simply ignored
// when sized deallocation is not supported, e.g., prior to C++14.
-// UNSUPPORTED: c++14, c++17
+// UNSUPPORTED: c++14, c++17, c++2a
// UNSUPPORTED: sanitizer-new-delete
#include <new>
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp
index 3925f2f5c313..a988b803d2d5 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp
@@ -46,15 +46,15 @@ void operator delete[](void* p, const std::nothrow_t&) TEST_NOEXCEPT
// selected.
struct A { ~A() {} };
-A *volatile x;
-
int main()
{
- x = new A[3];
+ A *x = new A[3];
+ DoNotOptimize(x);
assert(0 == delete_called);
assert(0 == delete_nothrow_called);
delete [] x;
+ DoNotOptimize(x);
assert(1 == delete_called);
assert(0 == delete_nothrow_called);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
index 83d5e80e87e4..61172fb5abe6 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
@@ -21,6 +21,6 @@
int main ()
{
- char buffer[100];
+ char buffer[100];
::operator new[](4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
index 9d3892cb0a81..def8839c46d9 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
@@ -21,6 +21,6 @@
int main ()
{
- char buffer[100];
+ char buffer[100];
::operator new(4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
index d64a633007e7..6f1c7511243e 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
@@ -68,31 +68,32 @@ void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT
struct alignas(OverAligned) A {};
struct alignas(std::max_align_t) B {};
-B* volatile bp;
-A* volatile ap;
-
int main()
{
reset();
{
- bp = new B;
+ B *bp = new B;
+ DoNotOptimize(bp);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == aligned_delete_called);
delete bp;
+ DoNotOptimize(bp);
assert(1 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == aligned_delete_called);
}
reset();
{
- ap = new A;
+ A *ap = new A;
+ DoNotOptimize(ap);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == aligned_delete_called);
delete ap;
+ DoNotOptimize(ap);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(1 == aligned_delete_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
index bace5c036e0c..2dd4631e7f6d 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
@@ -53,7 +53,9 @@ void* operator new(std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_a
assert(s <= sizeof(DummyData));
assert(static_cast<std::size_t>(a) == OverAligned);
++new_called;
- return DummyData;
+ void *Ret = DummyData;
+ DoNotOptimize(Ret);
+ return Ret;
}
void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT
@@ -61,6 +63,7 @@ void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT
assert(new_called == 1);
--new_called;
assert(p == DummyData);
+ DoNotOptimize(DummyData);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
index 31e1901511fa..a0e3eda5765e 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
@@ -44,15 +44,15 @@ struct A
~A() {A_constructed = false;}
};
-A* volatile ap;
-
int main()
{
- ap = new (std::nothrow) A;
+ A *ap = new (std::nothrow) A;
+ DoNotOptimize(ap);
assert(ap);
assert(A_constructed);
assert(new_called);
delete ap;
+ DoNotOptimize(ap);
assert(!A_constructed);
assert(!new_called);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp
index ea6c9367b903..aa00fee56e10 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp
@@ -43,15 +43,15 @@ struct A
~A() {A_constructed = false;}
};
-A *volatile ap;
-
int main()
{
- ap = new A;
+ A *ap = new A;
+ DoNotOptimize(ap);
assert(ap);
assert(A_constructed);
assert(new_called);
delete ap;
+ DoNotOptimize(ap);
assert(!A_constructed);
assert(!new_called);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp
index 945bf779a893..d9e0f5ca364d 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp
@@ -12,7 +12,7 @@
// Note that sized delete operator definitions below are simply ignored
// when sized deallocation is not supported, e.g., prior to C++14.
-// UNSUPPORTED: c++14, c++17
+// UNSUPPORTED: c++14, c++17, c++2a
// UNSUPPORTED: sanitizer-new-delete
#include <new>
@@ -44,16 +44,16 @@ void operator delete(void* p, std::size_t) TEST_NOEXCEPT
std::free(p);
}
-int *volatile x;
-
int main()
{
- x = new int(42);
+ int *x = new int(42);
+ DoNotOptimize(x);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == sized_delete_called);
delete x;
+ DoNotOptimize(x);
assert(1 == unsized_delete_called);
assert(0 == sized_delete_called);
assert(0 == unsized_delete_nothrow_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
index 7a76725a9751..5b08eb4b8569 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
@@ -49,16 +49,16 @@ void operator delete(void* p, std::size_t) TEST_NOEXCEPT
std::free(p);
}
-int *volatile x;
-
int main()
{
- x = new int(42);
+ int *x = new int(42);
+ DoNotOptimize(x);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
assert(0 == sized_delete_called);
delete x;
+ DoNotOptimize(x);
assert(0 == unsized_delete_called);
assert(1 == sized_delete_called);
assert(0 == unsized_delete_nothrow_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp
index cb093f3637ce..178e26db174a 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp
@@ -35,15 +35,15 @@ void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
std::free(p);
}
-int* volatile x;
-
int main()
{
- x = new int(42);
+ int *x = new int(42);
+ DoNotOptimize(x);
assert(0 == delete_called);
assert(0 == delete_nothrow_called);
delete x;
+ DoNotOptimize(x);
assert(1 == delete_called);
assert(0 == delete_nothrow_called);
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
index 40de3a09800c..d5b610f71802 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
@@ -62,16 +62,16 @@ void operator delete(void* p, std::size_t) TEST_NOEXCEPT
std::free(p);
}
-int* volatile x;
-
int main()
{
- x = new int(42);
+ int *x = new int(42);
+ DoNotOptimize(x);
assert(0 == sized_delete_called);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
delete x;
+ DoNotOptimize(x);
assert(1 == sized_delete_called);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
diff --git a/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp b/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp
index 1aa462957c8b..457696a42ade 100644
--- a/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp
+++ b/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp
@@ -22,14 +22,14 @@ constexpr int gi = 5;
constexpr float gf = 8.f;
int main() {
- static_assert(std::launder(&gi) == &gi, "" );
- static_assert(std::launder(&gf) == &gf, "" );
+ static_assert(std::launder(&gi) == &gi, "" );
+ static_assert(std::launder(&gf) == &gf, "" );
- const int *i = &gi;
- const float *f = &gf;
+ const int *i = &gi;
+ const float *f = &gf;
static_assert(std::is_same<decltype(i), decltype(std::launder(i))>::value, "");
static_assert(std::is_same<decltype(f), decltype(std::launder(f))>::value, "");
- assert(std::launder(i) == i);
- assert(std::launder(f) == f);
+ assert(std::launder(i) == i);
+ assert(std::launder(f) == f);
}
diff --git a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
index e35e7afa322a..d030d12d2630 100644
--- a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
+++ b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
@@ -15,40 +15,48 @@
// XFAIL: availability=macosx10.9
// XFAIL: availability=macosx10.10
// XFAIL: availability=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.12
+// XFAIL: with_system_cxx_lib=macosx10.13
// test uncaught_exceptions
#include <exception>
#include <cassert>
-struct A
-{
- ~A()
- {
- assert(std::uncaught_exceptions() > 0);
+struct Uncaught {
+ Uncaught(int depth) : d_(depth) {}
+ ~Uncaught() { assert(std::uncaught_exceptions() == d_); }
+ int d_;
+ };
+
+struct Outer {
+ Outer(int depth) : d_(depth) {}
+ ~Outer() {
+ try {
+ assert(std::uncaught_exceptions() == d_);
+ Uncaught u(d_+1);
+ throw 2;
+ }
+ catch (int) {}
}
+ int d_;
};
-struct B
-{
- B()
+int main () {
+ assert(std::uncaught_exceptions() == 0);
{
- // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
- assert(std::uncaught_exceptions() == 0);
+ Outer o(0);
}
-};
-int main()
-{
- try
+ assert(std::uncaught_exceptions() == 0);
{
- A a;
+ try {
+ Outer o(1);
+ throw 1;
+ }
+ catch (int) {
assert(std::uncaught_exceptions() == 0);
- throw B();
- }
- catch (...)
- {
- assert(std::uncaught_exception() == 0);
+ }
}
assert(std::uncaught_exceptions() == 0);
}
diff --git a/test/std/experimental/optional/optional.defs/tested_elsewhere.pass.cpp b/test/std/language.support/support.limits/version.pass.cpp
index b58f5c55b643..c41f492bbed4 100644
--- a/test/std/experimental/optional/optional.defs/tested_elsewhere.pass.cpp
+++ b/test/std/language.support/support.limits/version.pass.cpp
@@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
+// <version>
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+#include <version>
+
int main()
{
}
diff --git a/test/std/language.support/support.types/byte.pass.cpp b/test/std/language.support/support.types/byte.pass.cpp
index 66b2a553186d..a1abefa84282 100644
--- a/test/std/language.support/support.types/byte.pass.cpp
+++ b/test/std/language.support/support.types/byte.pass.cpp
@@ -9,14 +9,18 @@
#include <cstddef>
#include <type_traits>
-#include <test_macros.h>
+#include "test_macros.h"
// XFAIL: c++98, c++03, c++11, c++14
// std::byte is not an integer type, nor a character type.
// It is a distinct type for accessing the bits that ultimately make up object storage.
+#if TEST_STD_VER > 17
+static_assert( std::is_trivial<std::byte>::value, "" ); // P0767
+#else
static_assert( std::is_pod<std::byte>::value, "" );
+#endif
static_assert(!std::is_arithmetic<std::byte>::value, "" );
static_assert(!std::is_integral<std::byte>::value, "" );
diff --git a/test/std/language.support/support.types/max_align_t.pass.cpp b/test/std/language.support/support.types/max_align_t.pass.cpp
index 08a6c28a4c19..b7fe0ac647e0 100644
--- a/test/std/language.support/support.types/max_align_t.pass.cpp
+++ b/test/std/language.support/support.types/max_align_t.pass.cpp
@@ -10,15 +10,25 @@
#include <cstddef>
#include <type_traits>
-// max_align_t is a POD type whose alignment requirement is at least as
-// great as that of every scalar type
+// max_align_t is a trivial standard-layout type whose alignment requirement
+// is at least as great as that of every scalar type
#include <stdio.h>
+#include "test_macros.h"
int main()
{
+
+#if TEST_STD_VER > 17
+// P0767
+ static_assert(std::is_trivial<std::max_align_t>::value,
+ "std::is_trivial<std::max_align_t>::value");
+ static_assert(std::is_standard_layout<std::max_align_t>::value,
+ "std::is_standard_layout<std::max_align_t>::value");
+#else
static_assert(std::is_pod<std::max_align_t>::value,
"std::is_pod<std::max_align_t>::value");
+#endif
static_assert((std::alignment_of<std::max_align_t>::value >=
std::alignment_of<long long>::value),
"std::alignment_of<std::max_align_t>::value >= "
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
index 8f51d12d7c75..1070fa613e53 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
@@ -55,7 +55,7 @@ int main()
assert(f.widen('.') == L'.');
assert(f.widen('a') == L'a');
assert(f.widen('1') == L'1');
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
assert(f.widen(char(-5)) == L'\u00fb');
#else
assert(f.widen(char(-5)) == wchar_t(-1));
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
index 7a382c4dfa2c..9b841b28ba07 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
@@ -61,7 +61,7 @@ int main()
assert(v[3] == L'.');
assert(v[4] == L'a');
assert(v[5] == L'1');
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
assert(v[6] == L'\x85');
#else
assert(v[6] == wchar_t(-1));
diff --git a/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
index 5656f73ee9d2..bebc1f27bb34 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -25,6 +25,7 @@
#include "test_iterators.h"
#include "platform_support.h" // locale name macros
+#include "test_macros.h"
typedef std::money_get<char, input_iterator<const char*> > Fn;
@@ -46,6 +47,33 @@ public:
: Fw(refs) {}
};
+
+// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep.
+// this function converts the spaces in string inputs to that character if need
+// be.
+static std::wstring convert_thousands_sep(std::wstring const& in) {
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if TEST_GLIBC_PREREQ(2,27)
+ std::wstring out;
+ unsigned I = 0;
+ bool seen_decimal = false;
+ for (; I < in.size(); ++I) {
+ if (seen_decimal || in[I] != L' ') {
+ seen_decimal |= in[I] == L',';
+ out.push_back(in[I]);
+ continue;
+ }
+ assert(in[I] == L' ');
+ out.push_back(L'\u202F');
+ }
+ return out;
+#else
+ return in;
+#endif
+}
+
int main()
{
std::ios ios(0);
@@ -417,7 +445,7 @@ int main()
assert(ex == -1);
}
{ // positive
- std::wstring v = L"1 234 567,89 ";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 ");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -428,7 +456,7 @@ int main()
assert(ex == 123456789);
}
{ // negative
- std::wstring v = L"-1 234 567,89";
+ std::wstring v = convert_thousands_sep(L"-1 234 567,89");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -497,7 +525,7 @@ int main()
assert(ex == -1);
}
{ // positive, showbase
- std::wstring v = L"1 234 567,89 \u20ac"; // EURO SIGN
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 \u20ac"); // EURO SIGN
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -508,7 +536,7 @@ int main()
assert(ex == 123456789);
}
{ // positive, showbase
- std::wstring v = L"1 234 567,89 \u20ac"; // EURO SIGN
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 \u20ac"); // EURO SIGN
showbase(ios);
typedef input_iterator<const wchar_t*> I;
long double ex;
@@ -521,7 +549,7 @@ int main()
noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = L"-1 234 567,89 \u20ac"; // EURO SIGN
+ std::wstring v = convert_thousands_sep(L"-1 234 567,89 \u20ac"); // EURO SIGN
showbase(ios);
typedef input_iterator<const wchar_t*> I;
long double ex;
@@ -534,7 +562,7 @@ int main()
noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = L"1 234 567,89 EUR -";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR -");
showbase(ios);
typedef input_iterator<const wchar_t*> I;
long double ex;
@@ -546,7 +574,7 @@ int main()
noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = L"1 234 567,89 EUR -";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR -");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -583,7 +611,7 @@ int main()
assert(ex == -1);
}
{ // positive
- std::wstring v = L"1 234 567,89 ";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 ");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -594,7 +622,7 @@ int main()
assert(ex == 123456789);
}
{ // negative
- std::wstring v = L"-1 234 567,89";
+ std::wstring v = convert_thousands_sep(L"-1 234 567,89");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -663,7 +691,7 @@ int main()
assert(ex == -1);
}
{ // positive, showbase
- std::wstring v = L"1 234 567,89 EUR";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -674,7 +702,7 @@ int main()
assert(ex == 123456789);
}
{ // positive, showbase
- std::wstring v = L"1 234 567,89 EUR";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR");
showbase(ios);
typedef input_iterator<const wchar_t*> I;
long double ex;
@@ -687,7 +715,7 @@ int main()
noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = L"-1 234 567,89 EUR";
+ std::wstring v = convert_thousands_sep(L"-1 234 567,89 EUR");
showbase(ios);
typedef input_iterator<const wchar_t*> I;
long double ex;
@@ -700,7 +728,7 @@ int main()
noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = L"1 234 567,89 Eu-";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 Eu-");
showbase(ios);
typedef input_iterator<const wchar_t*> I;
long double ex;
@@ -712,7 +740,7 @@ int main()
noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = L"1 234 567,89 Eu-";
+ std::wstring v = convert_thousands_sep(L"1 234 567,89 Eu-");
typedef input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
diff --git a/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
index 8b620bca376d..2b431dc529d8 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
@@ -25,6 +25,7 @@
#include "test_iterators.h"
#include "platform_support.h" // locale name macros
+#include "test_macros.h"
typedef std::money_put<char, output_iterator<char*> > Fn;
@@ -46,6 +47,35 @@ public:
: Fw(refs) {}
};
+
+// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep.
+// this function converts the spaces in string inputs to that character if need
+// be.
+static std::wstring convert_thousands_sep(std::wstring const& in) {
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if TEST_GLIBC_PREREQ(2,27)
+ std::wstring out;
+ unsigned I = 0;
+ bool seen_num_start = false;
+ bool seen_decimal = false;
+ for (; I < in.size(); ++I) {
+ seen_decimal |= in[I] == L',';
+ seen_num_start |= in[I] == '-' || std::iswdigit(in[I]);
+ if (seen_decimal || !seen_num_start || in[I] != L' ') {
+ out.push_back(in[I]);
+ continue;
+ }
+ assert(in[I] == L' ');
+ out.push_back(L'\u202F');
+ }
+ return out;
+#else
+ return in;
+#endif
+}
+
int main()
{
std::ios ios(0);
@@ -301,7 +331,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"1 234 567,89");
+ assert(ex == convert_thousands_sep(L"1 234 567,89"));
}
{ // negative
long double v = -123456789;
@@ -309,7 +339,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89"));
}
{ // zero, showbase
long double v = 0;
@@ -336,7 +366,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"1 234 567,89 \u20ac");
+ assert(ex == convert_thousands_sep(L"1 234 567,89 \u20ac"));
}
{ // negative, showbase
long double v = -123456789;
@@ -345,7 +375,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89 \u20ac");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89 \u20ac"));
}
{ // negative, showbase, left
long double v = -123456789;
@@ -356,7 +386,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, ' ', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89 \u20ac ");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89 \u20ac "));
assert(ios.width() == 0);
}
{ // negative, showbase, internal
@@ -368,7 +398,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, ' ', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89 \u20ac");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89 \u20ac"));
assert(ios.width() == 0);
}
{ // negative, showbase, right
@@ -380,7 +410,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
false, ios, ' ', v);
std::wstring ex(str, iter.base());
- assert(ex == L" -1 234 567,89 \u20ac");
+ assert(ex == convert_thousands_sep(L" -1 234 567,89 \u20ac"));
assert(ios.width() == 0);
}
@@ -409,7 +439,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"1 234 567,89");
+ assert(ex == convert_thousands_sep(L"1 234 567,89"));
}
{ // negative
long double v = -123456789;
@@ -417,7 +447,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89"));
}
{ // zero, showbase
long double v = 0;
@@ -444,7 +474,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"1 234 567,89 EUR");
+ assert(ex == convert_thousands_sep(L"1 234 567,89 EUR"));
}
{ // negative, showbase
long double v = -123456789;
@@ -453,7 +483,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, '*', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89 EUR");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89 EUR"));
}
{ // negative, showbase, left
long double v = -123456789;
@@ -464,7 +494,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, ' ', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89 EUR ");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89 EUR "));
assert(ios.width() == 0);
}
{ // negative, showbase, internal
@@ -476,7 +506,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, ' ', v);
std::wstring ex(str, iter.base());
- assert(ex == L"-1 234 567,89 EUR");
+ assert(ex == convert_thousands_sep(L"-1 234 567,89 EUR"));
assert(ios.width() == 0);
}
{ // negative, showbase, right
@@ -488,7 +518,7 @@ int main()
output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
true, ios, ' ', v);
std::wstring ex(str, iter.base());
- assert(ex == L" -1 234 567,89 EUR");
+ assert(ex == convert_thousands_sep(L" -1 234 567,89 EUR"));
assert(ios.width() == 0);
}
}
diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
index 4051d451fcb6..e1c616c55233 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
@@ -110,7 +110,11 @@ int main()
assert(f.decimal_point() == L',');
}
// GLIBC 2.23 uses '.' as the decimal point while other C libraries use ','
-#ifndef TEST_HAS_GLIBC
+// GLIBC 2.27 corrects this
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if !defined(TEST_HAS_GLIBC) || TEST_GLIBC_PREREQ(2, 27)
const char sep = ',';
const wchar_t wsep = L',';
#else
diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
index aa585a436e6e..ca8abf09b830 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
@@ -92,7 +92,6 @@ int main()
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == L',');
}
-
{
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == ' ');
@@ -101,13 +100,22 @@ int main()
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == ' ');
}
+// The below tests work around GLIBC's use of U202F as mon_thousands_sep.
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if defined(TEST_HAS_GLIBC) && TEST_GLIBC_PREREQ(2, 27)
+ const wchar_t fr_sep = L'\u202F';
+#else
+ const wchar_t fr_sep = L' ';
+#endif
{
Fwf f(LOCALE_fr_FR_UTF_8, 1);
- assert(f.thousands_sep() == L' ');
+ assert(f.thousands_sep() == fr_sep);
}
{
Fwt f(LOCALE_fr_FR_UTF_8, 1);
- assert(f.thousands_sep() == L' ');
+ assert(f.thousands_sep() == fr_sep);
}
// The below tests work around GLIBC's use of U00A0 as mon_thousands_sep
// and U002E as mon_decimal_point.
@@ -116,6 +124,11 @@ int main()
#ifndef TEST_HAS_GLIBC
const char sep = ' ';
const wchar_t wsep = L' ';
+#elif TEST_GLIBC_PREREQ(2, 27)
+ // FIXME libc++ specifically works around \u00A0 by translating it into
+ // a regular space.
+ const char sep = ' ';
+ const wchar_t wsep = L'\u202F';
#else
// FIXME libc++ specifically works around \u00A0 by translating it into
// a regular space.
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp
index 6ba5a89e61e4..e2218fffb396 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp
@@ -15,9 +15,17 @@
using namespace std;
+template <class T>
+bool check_stream_failed(std::string const& val) {
+ istringstream ss(val);
+ T result;
+ return !(ss >> result);
+}
+
template<typename T>
void check_limits()
{
+ const bool is_unsigned = std::is_unsigned<T>::value;
T minv = numeric_limits<T>::min();
T maxv = numeric_limits<T>::max();
@@ -36,17 +44,12 @@ void check_limits()
assert(new_minv == minv);
assert(new_maxv == maxv);
- if(mins == "0")
- mins = "-1";
- else
- mins[mins.size() - 1]++;
-
maxs[maxs.size() - 1]++;
-
- istringstream maxoss2(maxs), minoss2(mins);
-
- assert(! (maxoss2 >> new_maxv));
- assert(! (minoss2 >> new_minv));
+ assert(check_stream_failed<T>(maxs));
+ if (!is_unsigned) {
+ mins[mins.size() - 1]++;
+ assert(check_stream_failed<T>(mins));
+ }
}
int main(void)
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
new file mode 100644
index 000000000000..bd9b3f05de7a
--- /dev/null
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -0,0 +1,164 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+// ios_base::iostate& err, unsigned int& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include <sstream>
+#include <iostream>
+#include "test_iterators.h"
+#include "test_macros.h"
+
+#ifdef TEST_COMPILER_C1XX
+#pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
+#endif
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+ : public F
+{
+public:
+ explicit my_facet(std::size_t refs = 0)
+ : F(refs) {}
+};
+
+template <class T>
+std::string make_neg_string(T value) {
+ std::ostringstream ss;
+ assert(ss << value);
+ std::string res = ss.str();
+ return '-' + res;
+}
+
+template <class T>
+void test_neg_one() {
+ const my_facet f(1);
+ std::ios ios(0);
+ T v = static_cast<T>(42);
+ {
+ const char str[] = "-1";
+ std::ios_base::iostate err = ios.goodbit;
+ input_iterator<const char*> iter =
+ f.get(input_iterator<const char*>(str),
+ input_iterator<const char*>(str+sizeof(str)),
+ ios, err, v);
+ assert(iter.base() == str+sizeof(str)-1);
+ assert(err == ios.goodbit);
+ assert(v == T(-1));
+ }
+ v = 42;
+ {
+ const char str[] = "-";
+ std::ios_base::iostate err = ios.goodbit;
+ input_iterator<const char*> iter =
+ f.get(input_iterator<const char*>(str),
+ input_iterator<const char*>(str+sizeof(str)),
+ ios, err, v);
+ assert(iter.base() == str+sizeof(str)-1);
+ assert(err == ios.failbit);
+ assert(v == 0);
+ }
+}
+
+template <class T>
+void test_negate() {
+ typedef typename std::make_signed<T>::type SignedT;
+ const my_facet f(1);
+ std::ios ios(0);
+ T v = 42;
+ {
+ T value = std::numeric_limits<SignedT>::max();
+ ++value;
+ std::string std_str = make_neg_string(value);
+ const char* str = std_str.data();
+ size_t size = std_str.size();
+ std::ios_base::iostate err = ios.goodbit;
+ input_iterator<const char*> iter =
+ f.get(input_iterator<const char*>(str),
+ input_iterator<const char*>(str+size+1),
+ ios, err, v);
+ assert(iter.base() == str+size);
+ assert(err == ios.goodbit);
+ T expected = -value;
+ assert(v == expected);
+ }
+ v = 42;
+ {
+ T value = std::numeric_limits<SignedT>::max();
+ ++value;
+ ++value;
+ std::string std_str = make_neg_string(value);
+ const char* str = std_str.data();
+ size_t size = std_str.size();
+ std::ios_base::iostate err = ios.goodbit;
+ input_iterator<const char*> iter =
+ f.get(input_iterator<const char*>(str),
+ input_iterator<const char*>(str+size+1),
+ ios, err, v);
+ assert(iter.base() == str+size);
+ assert(err == ios.goodbit);
+ T expected = -value;
+ assert(v == expected);
+ }
+ v = 42;
+ {
+ T value = std::numeric_limits<T>::max();
+ std::string std_str = make_neg_string(value);
+ const char* str = std_str.data();
+ size_t size = std_str.size();
+ std::ios_base::iostate err = ios.goodbit;
+ input_iterator<const char*> iter =
+ f.get(input_iterator<const char*>(str),
+ input_iterator<const char*>(str+size+1),
+ ios, err, v);
+ assert(iter.base() == str+size);
+ assert(err == ios.goodbit);
+ T expected = -value;
+ assert(v == expected);
+ }
+ v = 42;
+ {
+ std::string std_str = make_neg_string(std::numeric_limits<T>::max());
+ std_str.back()++;
+ const char* str = std_str.data();
+ size_t size = std_str.size();
+ std::ios_base::iostate err = ios.goodbit;
+ input_iterator<const char*> iter =
+ f.get(input_iterator<const char*>(str),
+ input_iterator<const char*>(str+size+1),
+ ios, err, v);
+ assert(iter.base() == str+size);
+ assert(err == ios.failbit);
+ assert(v == T(-1));
+ }
+}
+
+int main(void)
+{
+ test_neg_one<long>();
+ test_neg_one<long long>();
+ test_neg_one<unsigned short>();
+ test_neg_one<unsigned int>();
+ test_neg_one<unsigned long>();
+ test_neg_one<unsigned long long>();
+
+ test_negate<unsigned short>();
+ test_negate<unsigned int>();
+ test_negate<unsigned long>();
+ test_negate<unsigned long long>();
+}
diff --git a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
index 38cbcfda4f05..0dedf78c9e81 100644
--- a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -19,6 +19,7 @@
#include <locale>
#include <cassert>
+#include <iostream> // FIXME: for debugging purposes only
#include "test_macros.h"
#include "platform_support.h" // locale name macros
@@ -55,7 +56,12 @@ int main()
std::locale l(LOCALE_fr_FR_UTF_8);
#if defined(TEST_HAS_GLIBC)
const char sep = ' ';
+// The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep.
+# if TEST_GLIBC_PREREQ(2, 27)
+ const wchar_t wsep = L'\u202f';
+# else
const wchar_t wsep = L' ';
+# endif
#else
const char sep = ',';
const wchar_t wsep = L',';
@@ -63,6 +69,11 @@ int main()
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+ if (np.thousands_sep() != sep) {
+ std::cout << "np.thousands_sep() = '" << np.thousands_sep() << "'\n";
+ std::cout << "sep = '" << sep << "'\n";
+ std::cout << std::endl;
+ }
assert(np.thousands_sep() == sep);
}
{
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
index 70204c2fb99a..6d3947fed7fc 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -33,7 +33,7 @@ int main()
Myconv myconv;
try
{
- myconv.to_bytes(L"\xDA83");
+ TEST_IGNORE_NODISCARD myconv.to_bytes(L"\xDA83");
assert(false);
}
catch (const std::range_error&)
@@ -41,7 +41,7 @@ int main()
}
try
{
- myconv.from_bytes('\xA5');
+ TEST_IGNORE_NODISCARD myconv.from_bytes('\xA5');
assert(false);
}
catch (const std::range_error&)
@@ -56,7 +56,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- myconv.from_bytes('\xA5');
+ TEST_IGNORE_NODISCARD myconv.from_bytes('\xA5');
assert(false);
}
catch (const std::range_error&)
diff --git a/test/std/numerics/c.math/cmath.pass.cpp b/test/std/numerics/c.math/cmath.pass.cpp
index b5f586492bde..cc535e374396 100644
--- a/test/std/numerics/c.math/cmath.pass.cpp
+++ b/test/std/numerics/c.math/cmath.pass.cpp
@@ -661,11 +661,12 @@ void test_isinf()
static_assert((std::is_same<decltype(std::isinf((float)0)), bool>::value), "");
typedef decltype(std::isinf((double)0)) DoubleRetType;
-#ifndef __linux__
+#if !defined(__linux__) || defined(__clang__)
static_assert((std::is_same<DoubleRetType, bool>::value), "");
#else
- // GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in
- // all C++ dialects. The test should tolerate this.
+ // GLIBC < 2.23 defines 'isinf(double)' with a return type of 'int' in
+ // all C++ dialects. The test should tolerate this when libc++ can't work
+ // around it.
// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439
static_assert((std::is_same<DoubleRetType, bool>::value
|| std::is_same<DoubleRetType, int>::value), "");
@@ -746,11 +747,12 @@ void test_isnan()
static_assert((std::is_same<decltype(std::isnan((float)0)), bool>::value), "");
typedef decltype(std::isnan((double)0)) DoubleRetType;
-#ifndef __linux__
+#if !defined(__linux__) || defined(__clang__)
static_assert((std::is_same<DoubleRetType, bool>::value), "");
#else
- // GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in
- // all C++ dialects. The test should tolerate this.
+ // GLIBC < 2.23 defines 'isinf(double)' with a return type of 'int' in
+ // all C++ dialects. The test should tolerate this when libc++ can't work
+ // around it.
// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439
static_assert((std::is_same<DoubleRetType, bool>::value
|| std::is_same<DoubleRetType, int>::value), "");
diff --git a/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp
index deb056d67dec..5258bdc3a0f0 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp
@@ -54,6 +54,15 @@ void test_edges()
assert(r.imag() == 0);
assert(std::signbit(r.imag()) == std::signbit(testcases[i].imag()));
}
+ else if (testcases[i].real() == -1 && testcases[i].imag() == 0)
+ {
+ assert(r.real() == 0);
+ assert(!std::signbit(r.real()));
+ if (std::signbit(testcases[i].imag()))
+ is_about(r.imag(), -pi);
+ else
+ is_about(r.imag(), pi);
+ }
else if (std::isfinite(testcases[i].real()) && std::isinf(testcases[i].imag()))
{
assert(std::isinf(r.real()));
diff --git a/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp
index 3da56c32f198..cb9188d935a2 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp
@@ -44,6 +44,15 @@ void test_edges()
assert(std::signbit(r.real()) == std::signbit(testcases[i].real()));
assert(std::signbit(r.imag()) == std::signbit(testcases[i].imag()));
}
+ else if (testcases[i].real() == 0 && std::abs(testcases[i].imag()) == 1)
+ {
+ assert(r.real() == 0);
+ assert(std::signbit(testcases[i].imag()) == std::signbit(r.imag()));
+ if (std::signbit(testcases[i].imag()))
+ is_about(r.imag(), -pi/2);
+ else
+ is_about(r.imag(), pi/2);
+ }
else if (std::isfinite(testcases[i].real()) && std::isinf(testcases[i].imag()))
{
assert(std::isinf(r.real()));
diff --git a/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp b/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp
index 5e6cb0d523c2..69463ded2b40 100644
--- a/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp
+++ b/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp
@@ -11,7 +11,7 @@
// template<class T>
// complex<T>
-// polar(const T& rho, const T& theta = 0);
+// polar(const T& rho, const T& theta = T()); // changed from '0' by LWG#2870
#include <complex>
#include <cassert>
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
index 3803489c3038..da1225ae059e 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
@@ -17,6 +17,21 @@
#include <cassert>
#include <cstddef>
+struct S
+{
+ S() : x_(0) { default_ctor_called = true; }
+ S(int x) : x_(x) {}
+ int x_;
+ static bool default_ctor_called;
+};
+
+bool S::default_ctor_called = false;
+
+bool operator==(const S& lhs, const S& rhs)
+{
+ return lhs.x_ == rhs.x_;
+}
+
int main()
{
{
@@ -56,4 +71,16 @@ int main()
assert(v2[i][j] == v[i][j]);
}
}
+ {
+ typedef S T;
+ T a[] = {T(1), T(2), T(3), T(4), T(5)};
+ const unsigned N = sizeof(a)/sizeof(a[0]);
+ std::valarray<T> v(a, N);
+ std::valarray<T> v2;
+ v2 = v;
+ assert(v2.size() == v.size());
+ for (std::size_t i = 0; i < v2.size(); ++i)
+ assert(v2[i] == v[i]);
+ assert(!S::default_ctor_called);
+ }
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
index 5122f44c3d80..7923b104b254 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
@@ -19,6 +19,21 @@
#include <cassert>
#include <cstddef>
+struct S
+{
+ S() : x_(0) { default_ctor_called = true; }
+ S(int x) : x_(x) {}
+ int x_;
+ static bool default_ctor_called;
+};
+
+bool S::default_ctor_called = false;
+
+bool operator==(const S& lhs, const S& rhs)
+{
+ return lhs.x_ == rhs.x_;
+}
+
int main()
{
{
@@ -55,4 +70,15 @@ int main()
assert(v2[i][j] == a[i][j]);
}
}
+ {
+ typedef S T;
+ T a[] = {T(1), T(2), T(3), T(4), T(5)};
+ const unsigned N = sizeof(a)/sizeof(a[0]);
+ std::valarray<T> v2;
+ v2 = {T(1), T(2), T(3), T(4), T(5)};
+ assert(v2.size() == N);
+ for (std::size_t i = 0; i < v2.size(); ++i)
+ assert(v2[i] == a[i]);
+ assert(!S::default_ctor_called);
+ }
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp
index f46e0bf28cf8..9933322de96a 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp
@@ -16,6 +16,13 @@
#include <valarray>
#include <cassert>
+struct S {
+ S() { ctor_called = true; }
+ static bool ctor_called;
+};
+
+bool S::ctor_called = false;
+
int main()
{
{
@@ -34,4 +41,9 @@ int main()
std::valarray<std::valarray<double> > v;
assert(v.size() == 0);
}
+ {
+ std::valarray<S> v;
+ assert(v.size() == 0);
+ assert(!S::ctor_called);
+ }
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
index 359073eb3ae9..221187c4e124 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
@@ -16,6 +16,15 @@
#include <valarray>
#include <cassert>
+struct S {
+ S() : x(1) {}
+ ~S() { ++cnt_dtor; }
+ int x;
+ static size_t cnt_dtor;
+};
+
+size_t S::cnt_dtor = 0;
+
int main()
{
{
@@ -36,4 +45,11 @@ int main()
for (int i = 0; i < 100; ++i)
assert(v[i].size() == 0);
}
+ {
+ std::valarray<S> v(100);
+ assert(v.size() == 100);
+ for (int i = 0; i < 100; ++i)
+ assert(v[i].x == 1);
+ }
+ assert(S::cnt_dtor == 100);
}
diff --git a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
index 34181f508e2a..7026b73c692d 100644
--- a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
+++ b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
@@ -16,8 +16,11 @@
//
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
@@ -52,31 +55,31 @@ test()
test(Iter(ia), Iter(ia + i), 0, pRes, pRes + i);
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
- std::exclusive_scan(v.begin(), v.end(), v.begin(), 50);
+ std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 50 + (int) i * 3);
+ assert(v[i] == 50 + i * 3);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
- std::exclusive_scan(v.begin(), v.end(), v.begin(), 30);
+ std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30});
for (size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i-1));
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
- std::exclusive_scan(v.begin(), v.end(), v.begin(), 40);
+ std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40});
for (size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i));
}
diff --git a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
index c15cb1661e25..4fd5e236e51e 100644
--- a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
+++ b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
@@ -17,8 +17,11 @@
// T init, BinaryOperation binary_op); // C++17
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
@@ -70,12 +73,12 @@ int main()
// Make sure that the calculations are done using the init typedef
{
std::vector<unsigned char> v(10);
- std::iota(v.begin(), v.end(), 1);
- std::vector<int> res;
+ std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
+ std::vector<size_t> res;
std::exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 1, std::multiplies<>());
assert(res.size() == 10);
- int j = 1;
+ size_t j = 1;
assert(res[0] == 1);
for (size_t i = 1; i < v.size(); ++i)
{
diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
index 5c422300e343..2058b8e3d94f 100644
--- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
+++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
@@ -16,8 +16,11 @@
//
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
@@ -52,21 +55,21 @@ test()
test(Iter(ia), Iter(ia + i), pRes, pRes + i);
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin());
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == (int)(i+1) * 3);
+ assert(v[i] == (i+1) * 3);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin());
for (size_t i = 0; i < v.size(); ++i)
@@ -74,7 +77,7 @@ void basic_tests()
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin());
for (size_t i = 0; i < v.size(); ++i)
@@ -82,7 +85,7 @@ void basic_tests()
}
{
- std::vector<int> v, res;
+ std::vector<size_t> v, res;
std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res));
assert(res.empty());
}
diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
index 2c6eacc1682f..ca4da984121e 100644
--- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
+++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
@@ -17,9 +17,12 @@
// BinaryOperation binary_op); // C++17
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
#include <iostream>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
@@ -58,21 +61,21 @@ test()
}
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == (int)(i+1) * 3);
+ assert(v[i] == (i+1) * 3);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
for (size_t i = 0; i < v.size(); ++i)
@@ -80,7 +83,7 @@ void basic_tests()
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
for (size_t i = 0; i < v.size(); ++i)
@@ -88,7 +91,7 @@ void basic_tests()
}
{
- std::vector<int> v, res;
+ std::vector<size_t> v, res;
std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>());
assert(res.empty());
}
diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
index 653578055c69..c3b0feb34a8c 100644
--- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
+++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
@@ -17,8 +17,11 @@
// BinaryOperation binary_op, T init); // C++17
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
@@ -57,50 +60,50 @@ test()
}
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
- std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 50);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{50});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 50 + (int)(i+1) * 3);
+ assert(v[i] == 50 + (i+1) * 3);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
- std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 40);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{40});
for (size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i));
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
- std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 30);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{30});
for (size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i + 1));
}
{
- std::vector<int> v, res;
- std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), 40);
+ std::vector<size_t> v, res;
+ std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), size_t{40});
assert(res.empty());
}
// Make sure that the calculations are done using the init typedef
{
std::vector<unsigned char> v(10);
- std::iota(v.begin(), v.end(), 1);
- std::vector<int> res;
- std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), 1);
+ std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
+ std::vector<size_t> res;
+ std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), size_t{1});
assert(res.size() == 10);
- int j = 1;
+ size_t j = 1;
assert(res[0] == 1);
for (size_t i = 1; i < v.size(); ++i)
{
diff --git a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
index 4964e8e884bd..ff0cb29f4a20 100644
--- a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
@@ -19,26 +19,20 @@
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
#include <iostream>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
-template <class T = void>
-struct identity : std::unary_function<T, T>
-{
- constexpr const T& operator()(const T& x) const { return x;}
-};
-
-template <>
-struct identity<void>
-{
- template <class T>
- constexpr auto operator()(T&& x) const
- _NOEXCEPT_(noexcept(_VSTD::forward<T>(x)))
- -> decltype (_VSTD::forward<T>(x))
- { return _VSTD::forward<T>(x); }
+struct add_one {
+ template <typename T>
+ constexpr auto operator()(T x) const noexcept {
+ return static_cast<T>(x + 1);
+ }
};
template <class Iter1, class BOp, class UOp, class T, class Iter2>
@@ -62,15 +56,15 @@ template <class Iter>
void
test()
{
- int ia[] = { 1, 3, 5, 7, 9};
- const int pResI0[] = { 0, 1, 4, 9, 16}; // with identity
- const int mResI0[] = { 0, 0, 0, 0, 0};
- const int pResN0[] = { 0, -1, -4, -9, -16}; // with negate
- const int mResN0[] = { 0, 0, 0, 0, 0};
- const int pResI2[] = { 2, 3, 6, 11, 18}; // with identity
- const int mResI2[] = { 2, 2, 6, 30, 210};
- const int pResN2[] = { 2, 1, -2, -7, -14}; // with negate
- const int mResN2[] = { 2, -2, 6, -30, 210};
+ int ia[] = { 1, 3, 5, 7, 9 };
+ const int pResI0[] = { 0, 2, 6, 12, 20 }; // with add_one
+ const int mResI0[] = { 0, 0, 0, 0, 0 };
+ const int pResN0[] = { 0, -1, -4, -9, -16 }; // with negate
+ const int mResN0[] = { 0, 0, 0, 0, 0 };
+ const int pResI2[] = { 2, 4, 8, 14, 22 }; // with add_one
+ const int mResI2[] = { 2, 4, 16, 96, 768 };
+ const int pResN2[] = { 2, 1, -2, -7, -14 }; // with negate
+ const int mResN2[] = { 2, -2, 6, -30, 210 };
const unsigned sa = sizeof(ia) / sizeof(ia[0]);
static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure
static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure
@@ -82,65 +76,65 @@ test()
static_assert(sa == sizeof(mResN2) / sizeof(mResN2[0])); // just to be sure
for (unsigned int i = 0; i < sa; ++i ) {
- test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 0, pResI0, pResI0 + i);
- test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 0, mResI0, mResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 0, pResI0, pResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 0, mResI0, mResI0 + i);
test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 0, pResN0, pResN0 + i);
test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 0, mResN0, mResN0 + i);
- test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 2, pResI2, pResI2 + i);
- test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 2, mResI2, mResI2 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 2, pResI2, pResI2 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 2, mResI2, mResI2 + i);
test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 2, pResN2, pResN2 + i);
test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 2, mResN2, mResN2 + i);
}
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
- std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 50, std::plus<>(), identity<>());
+ std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50}, std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 50 + (int) i * 3);
+ assert(v[i] == 50 + i * 4);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
- std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 30, std::plus<>(), identity<>());
+ std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30}, std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 30 + triangle(i-1));
+ assert(v[i] == 30 + triangle(i - 1) + i);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
- std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 40, std::plus<>(), identity<>());
+ std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40}, std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 40 + triangle(i));
+ assert(v[i] == 40 + triangle(i) + i);
}
{
- std::vector<int> v, res;
- std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 40, std::plus<>(), identity<>());
+ std::vector<size_t> v, res;
+ std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), size_t{40}, std::plus<>(), add_one{});
assert(res.empty());
}
// Make sure that the calculations are done using the init typedef
{
std::vector<unsigned char> v(10);
- std::iota(v.begin(), v.end(), 1);
- std::vector<int> res;
- std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 1, std::multiplies<>(), identity<>());
+ std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
+ std::vector<size_t> res;
+ std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), size_t{1}, std::multiplies<>(), add_one{});
assert(res.size() == 10);
- int j = 1;
+ size_t j = 1;
assert(res[0] == 1);
for (size_t i = 1; i < res.size(); ++i)
{
- j *= i;
+ j *= i + 1;
assert(res[i] == j);
}
}
diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
index d15defc2cabc..48aeadb879dc 100644
--- a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
@@ -20,26 +20,20 @@
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
#include <iostream>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
-template <class T = void>
-struct identity : std::unary_function<T, T>
-{
- constexpr const T& operator()(const T& x) const { return x;}
-};
-
-template <>
-struct identity<void>
-{
- template <class T>
- constexpr auto operator()(T&& x) const
- _NOEXCEPT_(noexcept(_VSTD::forward<T>(x)))
- -> decltype (_VSTD::forward<T>(x))
- { return _VSTD::forward<T>(x); }
+struct add_one {
+ template <typename T>
+ constexpr auto operator()(T x) const noexcept {
+ return static_cast<T>(x + 1);
+ }
};
template <class Iter1, class BOp, class UOp, class Iter2>
@@ -63,59 +57,59 @@ template <class Iter>
void
test()
{
- int ia[] = { 1, 3, 5, 7, 9};
- const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity
- const int mResI0[] = { 1, 3, 15, 105, 945};
- const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate
- const int mResN0[] = { -1, 3, -15, 105, -945};
- const unsigned sa = sizeof(ia) / sizeof(ia[0]);
+ int ia[] = { 1, 3, 5, 7, 9 };
+ const int pResI0[] = { 2, 6, 12, 20, 30 }; // with add_one
+ const int mResI0[] = { 2, 8, 48, 384, 3840 };
+ const int pResN0[] = { -1, -4, -9, -16, -25 }; // with negate
+ const int mResN0[] = { -1, 3, -15, 105, -945 };
+ const unsigned sa = sizeof(ia) / sizeof(ia[0] );
static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure
static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure
static_assert(sa == sizeof(pResN0) / sizeof(pResN0[0])); // just to be sure
static_assert(sa == sizeof(mResN0) / sizeof(mResN0[0])); // just to be sure
for (unsigned int i = 0; i < sa; ++i ) {
- test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), pResI0, pResI0 + i);
- test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), mResI0, mResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, pResI0, pResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, mResI0, mResI0 + i);
test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), pResN0, pResN0 + i);
test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), mResN0, mResN0 + i);
}
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
- std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " "));
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
+ std::copy(v.begin(), v.end(), std::ostream_iterator<size_t>(std::cout, " "));
std::cout << std::endl;
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == (int)(i+1) * 3);
+ assert(v[i] == (i+1) * 4);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == triangle(i));
+ assert(v[i] == triangle(i) + i + 1);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == triangle(i + 1));
+ assert(v[i] == triangle(i + 1) + i + 1);
}
{
- std::vector<int> v, res;
- std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), identity<>());
+ std::vector<size_t> v, res;
+ std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), add_one{});
assert(res.empty());
}
}
diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
index b38b9a5afedf..00c4aafdf001 100644
--- a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
@@ -20,25 +20,19 @@
#include <numeric>
-#include <vector>
+#include <algorithm>
#include <cassert>
+#include <functional>
+#include <iterator>
+#include <vector>
#include "test_iterators.h"
-template <class T = void>
-struct identity : std::unary_function<T, T>
-{
- constexpr const T& operator()(const T& x) const { return x;}
-};
-
-template <>
-struct identity<void>
-{
- template <class T>
- constexpr auto operator()(T&& x) const
- _NOEXCEPT_(noexcept(_VSTD::forward<T>(x)))
- -> decltype (_VSTD::forward<T>(x))
- { return _VSTD::forward<T>(x); }
+struct add_one {
+ template <typename T>
+ constexpr auto operator()(T x) const noexcept {
+ return static_cast<T>(x + 1);
+ }
};
template <class Iter1, class BOp, class UOp, class T, class Iter2>
@@ -62,15 +56,15 @@ template <class Iter>
void
test()
{
- int ia[] = { 1, 3, 5, 7, 9};
- const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity
- const int mResI0[] = { 0, 0, 0, 0, 0};
- const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate
- const int mResN0[] = { 0, 0, 0, 0, 0};
- const int pResI2[] = { 3, 6, 11, 18, 27}; // with identity
- const int mResI2[] = { 2, 6, 30, 210, 1890};
- const int pResN2[] = { 1, -2, -7, -14, -23}; // with negate
- const int mResN2[] = { -2, 6, -30, 210, -1890};
+ int ia[] = { 1, 3, 5, 7, 9 };
+ const int pResI0[] = { 2, 6, 12, 20, 30 }; // with add_one
+ const int mResI0[] = { 0, 0, 0, 0, 0 };
+ const int pResN0[] = { -1, -4, -9, -16, -25 }; // with negate
+ const int mResN0[] = { 0, 0, 0, 0, 0 };
+ const int pResI2[] = { 4, 8, 14, 22, 32 }; // with add_one
+ const int mResI2[] = { 4, 16, 96, 768, 7680 };
+ const int pResN2[] = { 1, -2, -7, -14, -23 }; // with negate
+ const int mResN2[] = { -2, 6, -30, 210, -1890 };
const unsigned sa = sizeof(ia) / sizeof(ia[0]);
static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure
static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure
@@ -82,65 +76,65 @@ test()
static_assert(sa == sizeof(mResN2) / sizeof(mResN2[0])); // just to be sure
for (unsigned int i = 0; i < sa; ++i ) {
- test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 0, pResI0, pResI0 + i);
- test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 0, mResI0, mResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 0, pResI0, pResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 0, mResI0, mResI0 + i);
test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 0, pResN0, pResN0 + i);
test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 0, mResN0, mResN0 + i);
- test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 2, pResI2, pResI2 + i);
- test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 2, mResI2, mResI2 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 2, pResI2, pResI2 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 2, mResI2, mResI2 + i);
test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 2, pResN2, pResN2 + i);
test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 2, mResN2, mResN2 + i);
}
}
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
void basic_tests()
{
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::fill(v.begin(), v.end(), 3);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 50);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{50});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 50 + (int) (i + 1) * 3);
+ assert(v[i] == 50 + (i + 1) * 4);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 0);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 30);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{30});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 30 + triangle(i));
+ assert(v[i] == 30 + triangle(i) + i + 1);
}
{
- std::vector<int> v(10);
+ std::vector<size_t> v(10);
std::iota(v.begin(), v.end(), 1);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 40);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{40});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 40 + triangle(i + 1));
+ assert(v[i] == 40 + triangle(i + 1) + i + 1);
}
{
- std::vector<int> v, res;
- std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), identity<>(), 1);
+ std::vector<size_t> v, res;
+ std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), add_one{}, size_t{1});
assert(res.empty());
}
// Make sure that the calculations are done using the init typedef
{
std::vector<unsigned char> v(10);
- std::iota(v.begin(), v.end(), 1);
- std::vector<int> res;
- std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), identity<>(), 1);
+ std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
+ std::vector<size_t> res;
+ std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), add_one{}, size_t{1});
assert(res.size() == 10);
- int j = 1;
- assert(res[0] == 1);
+ size_t j = 2;
+ assert(res[0] == 2);
for (size_t i = 1; i < res.size(); ++i)
{
- j *= i + 1;
+ j *= i + 2;
assert(res[i] == j);
}
}
diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp
index 418c57f7cfca..c5bcaf148eae 100644
--- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp
@@ -18,40 +18,26 @@
#include <numeric>
#include <cassert>
+#include <utility>
+#include <iterator>
+#include "MoveOnly.h"
#include "test_iterators.h"
-template <class T = void>
-struct identity : std::unary_function<T, T>
-{
- constexpr const T& operator()(const T& x) const { return x;}
-};
-
-template <>
-struct identity<void>
+struct identity
{
template <class T>
- constexpr auto operator()(T&& x) const
- _NOEXCEPT_(noexcept(_VSTD::forward<T>(x)))
- -> decltype (_VSTD::forward<T>(x))
- { return _VSTD::forward<T>(x); }
+ constexpr decltype(auto) operator()(T&& x) const {
+ return std::forward<T>(x);
+ }
};
-
-template <class T = void>
struct twice
{
- constexpr const T operator()(const T& x) const noexcept { return 2 * x; }
-};
-
-template <>
-struct twice<void>
-{
template <class T>
- constexpr auto operator()(const T& x) const
- _NOEXCEPT_(noexcept(2 * x))
- -> decltype (2 * x)
- { return 2 * x; }
+ constexpr auto operator()(const T& x) const {
+ return 2 * x;
+ }
};
template <class Iter1, class T, class BOp, class UOp>
@@ -70,23 +56,23 @@ test()
int ia[] = {1, 2, 3, 4, 5, 6};
unsigned sa = sizeof(ia) / sizeof(ia[0]);
- test(Iter(ia), Iter(ia), 0, std::plus<>(), identity<>(), 0);
- test(Iter(ia), Iter(ia), 1, std::multiplies<>(), identity<>(), 1);
- test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), identity<>(), 0);
- test(Iter(ia), Iter(ia+1), 2, std::plus<>(), identity<>(), 3);
- test(Iter(ia), Iter(ia+2), 0, std::plus<>(), identity<>(), 3);
- test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), identity<>(), 6);
- test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), identity<>(), 2880);
- test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), identity<>(), 25);
-
- test(Iter(ia), Iter(ia), 0, std::plus<>(), twice<>(), 0);
- test(Iter(ia), Iter(ia), 1, std::multiplies<>(), twice<>(), 1);
- test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), twice<>(), 0);
- test(Iter(ia), Iter(ia+1), 2, std::plus<>(), twice<>(), 4);
- test(Iter(ia), Iter(ia+2), 0, std::plus<>(), twice<>(), 6);
- test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), twice<>(), 24);
- test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), twice<>(), 184320); // 64 * 2880
- test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), twice<>(), 46);
+ test(Iter(ia), Iter(ia), 0, std::plus<>(), identity(), 0);
+ test(Iter(ia), Iter(ia), 1, std::multiplies<>(), identity(), 1);
+ test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), identity(), 0);
+ test(Iter(ia), Iter(ia+1), 2, std::plus<>(), identity(), 3);
+ test(Iter(ia), Iter(ia+2), 0, std::plus<>(), identity(), 3);
+ test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), identity(), 6);
+ test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), identity(), 2880);
+ test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), identity(), 25);
+
+ test(Iter(ia), Iter(ia), 0, std::plus<>(), twice(), 0);
+ test(Iter(ia), Iter(ia), 1, std::multiplies<>(), twice(), 1);
+ test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), twice(), 0);
+ test(Iter(ia), Iter(ia+1), 2, std::plus<>(), twice(), 4);
+ test(Iter(ia), Iter(ia+2), 0, std::plus<>(), twice(), 6);
+ test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), twice(), 24);
+ test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), twice(), 184320); // 64 * 2880
+ test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), twice(), 46);
}
template <typename T, typename Init>
@@ -94,7 +80,16 @@ void test_return_type()
{
T *p = nullptr;
static_assert( std::is_same_v<Init,
- decltype(std::transform_reduce(p, p, Init{}, std::plus<>(), identity<>()))> );
+ decltype(std::transform_reduce(p, p, Init{}, std::plus<>(), identity()))> );
+}
+
+void test_move_only_types()
+{
+ MoveOnly ia[] = {{1}, {2}, {3}};
+ assert(60 ==
+ std::transform_reduce(std::begin(ia), std::end(ia), MoveOnly{0},
+ [](const MoveOnly& lhs, const MoveOnly& rhs) { return MoveOnly{lhs.get() + rhs.get()}; },
+ [](const MoveOnly& target) { return MoveOnly{target.get() * 10}; }).get());
}
int main()
@@ -118,7 +113,9 @@ int main()
// Make sure the math is done using the correct type
{
auto v = {1, 2, 3, 4, 5, 6};
- unsigned res = std::transform_reduce(v.begin(), v.end(), 1U, std::multiplies<>(), twice<>());
+ unsigned res = std::transform_reduce(v.begin(), v.end(), 1U, std::multiplies<>(), twice());
assert(res == 46080); // 6! * 64 will not fit into a char
}
+
+ test_move_only_types();
}
diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp
index 4f8142afe84a..a79b4e98f03f 100644
--- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp
@@ -17,7 +17,9 @@
#include <numeric>
#include <cassert>
+#include <iterator>
+#include "MoveOnly.h"
#include "test_iterators.h"
template <class Iter1, class Iter2, class T>
@@ -56,6 +58,14 @@ void test_return_type()
decltype(std::transform_reduce(p, p, p, Init{}))> );
}
+void test_move_only_types()
+{
+ MoveOnly ia[] = {{1}, {2}, {3}};
+ MoveOnly ib[] = {{1}, {2}, {3}};
+ assert(14 ==
+ std::transform_reduce(std::begin(ia), std::end(ia), std::begin(ib), MoveOnly{0}).get());
+}
+
int main()
{
test_return_type<char, int>();
@@ -92,4 +102,6 @@ int main()
test<const int*, unsigned int *>();
test< int*, const unsigned int *>();
test< int*, unsigned int *>();
+
+ test_move_only_types();
}
diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp
index 41ea3b38a7f6..f60a0f149bcc 100644
--- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp
@@ -19,7 +19,9 @@
#include <numeric>
#include <cassert>
+#include <iterator>
+#include "MoveOnly.h"
#include "test_iterators.h"
template <class Iter1, class Iter2, class T, class Op1, class Op2>
@@ -58,6 +60,16 @@ void test_return_type()
decltype(std::transform_reduce(p, p, p, Init{}, std::plus<>(), std::multiplies<>()))> );
}
+void test_move_only_types()
+{
+ MoveOnly ia[] = {{1}, {2}, {3}};
+ MoveOnly ib[] = {{1}, {2}, {3}};
+ assert(14 ==
+ std::transform_reduce(std::begin(ia), std::end(ia), std::begin(ib), MoveOnly{0},
+ [](const MoveOnly& lhs, const MoveOnly& rhs) { return MoveOnly{lhs.get() + rhs.get()}; },
+ [](const MoveOnly& lhs, const MoveOnly& rhs) { return MoveOnly{lhs.get() * rhs.get()}; }).get());
+}
+
int main()
{
test_return_type<char, int>();
@@ -94,4 +106,6 @@ int main()
test<const int*, unsigned int *>();
test< int*, const unsigned int *>();
test< int*, unsigned int *>();
+
+ test_move_only_types();
}
diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp
index 56690316c129..e5a2a32ee261 100644
--- a/test/std/numerics/rand/rand.device/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -23,6 +23,7 @@
#include <random>
#include <cassert>
+#include <system_error>
#include "test_macros.h"
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp
index d96ccf9de7f5..1c3a0c14a6d0 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp
@@ -25,7 +25,7 @@ test1()
E e1;
E e2;
assert(e1 == e2);
- e1();
+ (void)e1();
e2 = e1;
assert(e1 == e2);
}
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp
index b38e8f583f23..641e5f479afb 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp
@@ -25,8 +25,8 @@ test1()
E e1;
E e2 = e1;
assert(e1 == e2);
- e1();
- e2();
+ (void)e1();
+ (void)e2();
assert(e1 == e2);
}
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
index 734b4209984a..83ad55725ad6 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
@@ -22,7 +22,6 @@ void
test1()
{
typedef std::linear_congruential_engine<T, a, c, m> LCE;
- typedef typename LCE::result_type result_type;
LCE e1;
LCE e2;
e2.seed();
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
index 72d5854b7655..2c2abe6e94d6 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
@@ -45,10 +45,10 @@ test1()
assert((LCE::min() == (c == 0u ? 1u: 0u)));
#endif
-#ifdef _MSC_VER
+#ifdef TEST_COMPILER_C1XX
#pragma warning(push)
#pragma warning(disable: 4310) // cast truncates constant value
-#endif // _MSC_VER
+#endif // TEST_COMPILER_C1XX
#if TEST_STD_VER >= 11
static_assert((LCE::max() == result_type(m - 1u)), "");
@@ -56,9 +56,9 @@ test1()
assert((LCE::max() == result_type(m - 1u)));
#endif
-#ifdef _MSC_VER
+#ifdef TEST_COMPILER_C1XX
#pragma warning(pop)
-#endif // _MSC_VER
+#endif // TEST_COMPILER_C1XX
static_assert((LCE::default_seed == 1), "");
where(LCE::multiplier);
diff --git a/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp b/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp
new file mode 100644
index 000000000000..aa70258dbfae
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-no-exceptions
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// template <class ST, class SA>
+// basic_regex(const basic_string<charT, ST, SA>& s);
+
+#include <regex>
+#include <cassert>
+#include "test_macros.h"
+
+static bool error_ctype_thrown(const char *pat)
+{
+ bool result = false;
+ try {
+ std::regex re(pat);
+ } catch (const std::regex_error &ex) {
+ result = (ex.code() == std::regex_constants::error_ctype);
+ }
+ return result;
+}
+
+int main()
+{
+ assert(error_ctype_thrown("[[::]]"));
+ assert(error_ctype_thrown("[[:error:]]"));
+}
diff --git a/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp b/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp
new file mode 100644
index 000000000000..d4dc9e54fc52
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// vector(InputIterator, InputIterator, Allocator = Allocator())
+// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <regex>
+#include <string>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+// basic_regex(ForwardIterator, ForwardIterator)
+// <int> is not an iterator
+ std::basic_regex re(23, 34); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}}
+ }
+
+ {
+// basic_regex(ForwardIterator, ForwardIterator, flag_type)
+// <double> is not an iterator
+ std::basic_regex re(23.0, 34.0, std::regex_constants::basic); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}}
+ }
+
+// Test the implicit deduction guides
+
+}
diff --git a/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp b/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
new file mode 100644
index 000000000000..31f047c71950
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
@@ -0,0 +1,137 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template<class ForwardIterator>
+// basic_regex(ForwardIterator, ForwardIterator,
+// regex_constants::syntax_option_type = regex_constants::ECMAScript)
+// -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
+
+
+#include <regex>
+#include <string>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_allocator.h"
+
+using namespace std::literals;
+
+struct A {};
+
+int main()
+{
+
+// Test the explicit deduction guides
+ {
+// basic_regex(ForwardIterator, ForwardIterator)
+ std::string s1("\\(a\\)");
+ std::basic_regex re(s1.begin(), s1.end());
+
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, "");
+ assert(re.flags() == std::regex_constants::ECMAScript);
+ assert(re.mark_count() == 0);
+ }
+
+ {
+ std::wstring s1(L"\\(a\\)");
+ std::basic_regex re(s1.begin(), s1.end(), std::regex_constants::basic);
+
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, "");
+ assert(re.flags() == std::regex_constants::basic);
+ assert(re.mark_count() == 1);
+ }
+
+// Test the implicit deduction guides
+ {
+// basic_regex(string);
+ std::basic_regex re("(a([bc]))"s);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, "");
+ assert(re.flags() == std::regex_constants::ECMAScript);
+ assert(re.mark_count() == 2);
+ }
+
+ {
+// basic_regex(string, flag_type);
+ std::basic_regex re(L"(a([bc]))"s, std::regex_constants::awk);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, "");
+ assert(re.flags() == std::regex_constants::awk);
+ assert(re.mark_count() == 2);
+ }
+
+ {
+// basic_regex(const charT*);
+ std::basic_regex re("ABCDE");
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, "");
+ assert(re.flags() == std::regex_constants::ECMAScript);
+ assert(re.mark_count() == 0);
+ }
+
+ {
+// basic_regex(const charT*, flag_type);
+ std::basic_regex re(L"ABCDE", std::regex_constants::grep);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, "");
+ assert(re.flags() == std::regex_constants::grep);
+ assert(re.mark_count() == 0);
+ }
+
+ {
+// basic_regex(const charT*, size_t);
+ std::basic_regex re("ABCDEDEF", 7);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, "");
+ assert(re.flags() == std::regex_constants::ECMAScript);
+ assert(re.mark_count() == 0);
+ }
+
+ {
+// basic_regex(const charT*, size_t, flag_type);
+ std::basic_regex re(L"ABCDEDEF", 8, std::regex_constants::awk);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, "");
+ assert(re.flags() == std::regex_constants::awk);
+ assert(re.mark_count() == 0);
+ }
+
+ {
+// basic_regex(const basic_regex &);
+ std::basic_regex<char> source;
+ std::basic_regex re(source);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, "");
+ assert(re.flags() == source.flags());
+ assert(re.mark_count() == source.mark_count());
+ }
+
+ {
+// template<class ST, class SA>
+// explicit basic_regex(const basic_string<charT, ST, SA>& p,
+// flag_type f = regex_constants::ECMAScript);
+ }
+
+ {
+// basic_regex(initializer_list);
+ std::basic_regex re({'A', 'B', 'F', 'E', 'D'});
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, "");
+ assert(re.flags() == std::regex_constants::ECMAScript);
+ assert(re.mark_count() == 0);
+ }
+
+ {
+// basic_regex(initializer_list, flag_type);
+ std::basic_regex re({L'A', L'B', L'F', L'E', L'D'}, std::regex_constants::grep);
+ static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, "");
+ assert(re.flags() == std::regex_constants::grep);
+ assert(re.mark_count() == 0);
+ }
+}
diff --git a/test/std/strings/basic.string/char.bad.fail.cpp b/test/std/strings/basic.string/char.bad.fail.cpp
new file mode 100644
index 000000000000..1878cd02ca38
--- /dev/null
+++ b/test/std/strings/basic.string/char.bad.fail.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// ... manipulating sequences of any non-array trivial standard-layout types.
+
+#include <string>
+#include "test_traits.h"
+
+struct NotTrivial {
+ NotTrivial() : value(3) {}
+ int value;
+};
+
+struct NotStandardLayout {
+public:
+ NotStandardLayout() : one(1), two(2) {}
+ int sum() const { return one + two; } // silences "unused field 'two' warning"
+ int one;
+private:
+ int two;
+};
+
+int main()
+{
+ {
+// array
+ typedef char C[3];
+ static_assert(std::is_array<C>::value, "");
+ std::basic_string<C, test_traits<C> > s;
+// expected-error-re@string:* {{static_assert failed{{.*}} "Character type of basic_string must not be an array"}}
+ }
+
+ {
+// not trivial
+ static_assert(!std::is_trivial<NotTrivial>::value, "");
+ std::basic_string<NotTrivial, test_traits<NotTrivial> > s;
+// expected-error-re@string:* {{static_assert failed{{.*}} "Character type of basic_string must be trivial"}}
+ }
+
+ {
+// not standard layout
+ static_assert(!std::is_standard_layout<NotStandardLayout>::value, "");
+ std::basic_string<NotStandardLayout, test_traits<NotStandardLayout> > s;
+// expected-error-re@string:* {{static_assert failed{{.*}} "Character type of basic_string must be standard-layout"}}
+ }
+}
diff --git a/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp b/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp
index b1e9108e90ba..34d5f306a739 100644
--- a/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp
@@ -68,4 +68,13 @@ int main()
S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s;
+ s = {"abc", 1};
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp
index 87698ec55103..a995a51eed48 100644
--- a/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp
@@ -22,13 +22,6 @@
#include "test_macros.h"
#include "test_allocator.h"
-template <class T>
-struct some_alloc
-{
- typedef T value_type;
- some_alloc(const some_alloc&);
-};
-
int main()
{
{
@@ -40,7 +33,7 @@ int main()
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
+ typedef std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
}
diff --git a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
index f4ff0645afcf..a4de566a4dc0 100644
--- a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
@@ -20,11 +20,12 @@
#include "test_allocator.h"
template <class T>
-struct some_alloc
+struct throwing_alloc
{
typedef T value_type;
- some_alloc(const some_alloc&);
- ~some_alloc() noexcept(false);
+ throwing_alloc(const throwing_alloc&);
+ T *allocate(size_t);
+ ~throwing_alloc() noexcept(false);
};
// Test that it's possible to take the address of basic_string's destructors
@@ -44,7 +45,7 @@ int main()
}
#if defined(_LIBCPP_VERSION)
{
- typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
+ typedef std::basic_string<char, std::char_traits<char>, throwing_alloc<char>> C;
static_assert(!std::is_nothrow_destructible<C>::value, "");
}
#endif // _LIBCPP_VERSION
diff --git a/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp b/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
index 0fbd663db4bc..3665e23a727b 100644
--- a/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
@@ -36,7 +36,7 @@ using BStr = std::basic_string<T, std::char_traits<T>, Alloc>;
// (2) basic_string(A const&) - BROKEN
// (3) basic_string(size_type, CharT, const A& = A())
// (4) basic_string(BS const&, size_type, A const& = A())
-// (5) basic_string(BS const&, size_type, size_type, A const& = A()) - PARTIALLY BROKEN
+// (5) basic_string(BS const&, size_type, size_type, A const& = A())
// (6) basic_string(const CharT*, size_type, A const& = A())
// (7) basic_string(const CharT*, A const& = A())
// (8) basic_string(InputIt, InputIt, A const& = A()) - BROKEN
@@ -46,7 +46,7 @@ using BStr = std::basic_string<T, std::char_traits<T>, Alloc>;
// (12) basic_string(BS&&, A const&)
// (13) basic_string(initializer_list<CharT>, A const& = A())
// (14) basic_string(BSV, A const& = A())
-// (15) basic_string(const T&, size_type, size_type, A const& = A()) - BROKEN
+// (15) basic_string(const T&, size_type, size_type, A const& = A())
int main()
{
using TestSizeT = test_allocator<char>::size_type;
@@ -106,7 +106,6 @@ int main()
assert(w == L"def");
}
{ // Testing (5) w/o allocator
-#if 0 // FIXME: This doesn't work
const std::string sin("abc");
std::basic_string s(sin, (size_t)1, (size_t)3);
ASSERT_SAME_TYPE(decltype(s), std::string);
@@ -119,7 +118,6 @@ int main()
std::basic_string w(win, (TestSizeT)2, (TestSizeT)3);
ASSERT_SAME_TYPE(decltype(w), WStr);
assert(w == L"cde");
-#endif
}
{ // Testing (5) w/ allocator
const std::string sin("abc");
@@ -178,20 +176,19 @@ int main()
assert(w == L"abcdef");
}
{ // (8) w/o allocator
- // This overload isn't compatible with implicit deduction guides as
- // specified in the standard.
- // FIXME: Propose adding an explicit guide to the standard?
- }
- { // (8) w/ allocator
- // This overload isn't compatible with implicit deduction guides as
- // specified in the standard.
- // FIXME: Propose adding an explicit guide to the standard?
-#if 0
using It = input_iterator<const char*>;
const char* input = "abcdef";
std::basic_string s(It(input), It(input + 3), std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
-#endif
+ assert(s == "abc");
+ }
+ { // (8) w/ allocator
+ using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>;
+ using It = input_iterator<const wchar_t*>;
+ const wchar_t* input = L"abcdef";
+ std::basic_string s(It(input), It(input + 3), test_allocator<wchar_t>{});
+ ASSERT_SAME_TYPE(decltype(s), ExpectW);
+ assert(s == L"abc");
}
{ // Testing (9)
const std::string sin("abc");
@@ -293,8 +290,28 @@ int main()
ASSERT_SAME_TYPE(decltype(w), ExpectW);
assert(w == L"abcdef");
}
- { // Testing (15)
- // This overload isn't compatible with implicit deduction guides as
- // specified in the standard.
+ { // Testing (15) w/o allocator
+ std::string s0("abc");
+ std::basic_string s(s0, 1, 1);
+ ASSERT_SAME_TYPE(decltype(s), std::string);
+ assert(s == "b");
+
+ std::wstring w0(L"abcdef");
+ std::basic_string w(w0, 2, 2);
+ ASSERT_SAME_TYPE(decltype(w), std::wstring);
+ assert(w == L"cd");
+ }
+ { // Testing (15) w/ allocator
+ using ExpectS = std::basic_string<char, std::char_traits<char>, test_allocator<char>>;
+ ExpectS s0("abc");
+ std::basic_string s(s0, 1, 1, test_allocator<char>{4});
+ ASSERT_SAME_TYPE(decltype(s), ExpectS);
+ assert(s == "b");
+
+ using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>;
+ ExpectW w0(L"abcdef");
+ std::basic_string w(w0, 2, 2, test_allocator<wchar_t>{6});
+ ASSERT_SAME_TYPE(decltype(w), ExpectW);
+ assert(w == L"cd");
}
}
diff --git a/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
index 1f83696891c4..e7fefacc068f 100644
--- a/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
@@ -13,6 +13,7 @@
// basic_string(InputIterator begin, InputIterator end,
// const Allocator& a = Allocator());
+
#include <string>
#include <iterator>
#include <cassert>
diff --git a/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp
new file mode 100644
index 000000000000..9c2a3201f8af
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8, clang-3.9, clang-4.0
+// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8, apple-clang-9
+
+// template<class InputIterator,
+// class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// basic_string(InputIterator, InputIterator, Allocator = Allocator())
+// -> basic_string<typename iterator_traits<InputIterator>::value_type,
+// char_traits<typename iterator_traits<InputIterator>::value_type>,
+// Allocator>;
+//
+// The deduction guide shall not participate in overload resolution if InputIterator
+// is a type that does not qualify as an input iterator, or if Allocator is a type
+// that does not qualify as an allocator.
+
+
+#include <string>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+
+class NotAnItertor {};
+
+template <typename T>
+struct NotAnAllocator { typedef T value_type; };
+
+int main()
+{
+ { // Not an iterator at all
+ std::basic_string s1{NotAnItertor{}, NotAnItertor{}, std::allocator<char>{}}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}}
+ }
+ { // Not an input iterator
+ const char16_t* s = u"12345678901234";
+ std::basic_string<char16_t> s0;
+ std::basic_string s1{std::back_insert_iterator(s0), // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}}
+ std::back_insert_iterator(s0),
+ std::allocator<char16_t>{}};
+ }
+ { // Not an allocator
+ const wchar_t* s = L"12345678901234";
+ std::basic_string s1{s, s+10, NotAnAllocator<wchar_t>{}}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}}
+ }
+
+}
diff --git a/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp
new file mode 100644
index 000000000000..815b5600dd47
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: libcpp-no-deduction-guides
+
+// template<class InputIterator>
+// basic_string(InputIterator begin, InputIterator end,
+// const Allocator& a = Allocator());
+
+// template<class InputIterator,
+// class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// basic_string(InputIterator, InputIterator, Allocator = Allocator())
+// -> basic_string<typename iterator_traits<InputIterator>::value_type,
+// char_traits<typename iterator_traits<InputIterator>::value_type>,
+// Allocator>;
+//
+// The deduction guide shall not participate in overload resolution if InputIterator
+// is a type that does not qualify as an input iterator, or if Allocator is a type
+// that does not qualify as an allocator.
+
+
+#include <string>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_allocator.h"
+#include "../input_iterator.h"
+#include "min_allocator.h"
+
+int main()
+{
+ {
+ const char* s = "12345678901234";
+ std::basic_string s1(s, s+10); // Can't use {} here
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
+ static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
+ assert(s1.size() == 10);
+ assert(s1.compare(0, s1.size(), s, s1.size()) == 0);
+ }
+
+ {
+ const char* s = "12345678901234";
+ std::basic_string s1{s, s+10, std::allocator<char>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
+ static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
+ assert(s1.size() == 10);
+ assert(s1.compare(0, s1.size(), s, s1.size()) == 0);
+ }
+ {
+ const wchar_t* s = L"12345678901234";
+ std::basic_string s1{s, s+10, test_allocator<wchar_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, wchar_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<wchar_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, test_allocator<wchar_t>>, "");
+ assert(s1.size() == 10);
+ assert(s1.compare(0, s1.size(), s, s1.size()) == 0);
+ }
+ {
+ const char16_t* s = u"12345678901234";
+ std::basic_string s1{s, s+10, min_allocator<char16_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char16_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char16_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, min_allocator<char16_t>>, "");
+ assert(s1.size() == 10);
+ assert(s1.compare(0, s1.size(), s, s1.size()) == 0);
+ }
+ {
+ const char32_t* s = U"12345678901234";
+ std::basic_string s1{s, s+10, explicit_allocator<char32_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char32_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char32_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, explicit_allocator<char32_t>>, "");
+ assert(s1.size() == 10);
+ assert(s1.compare(0, s1.size(), s, s1.size()) == 0);
+ }
+}
diff --git a/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
index 0720543420a8..ad9ed36d3f80 100644
--- a/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
@@ -32,6 +32,7 @@ struct some_alloc
{
typedef T value_type;
some_alloc(const some_alloc&);
+ T *allocate(size_t);
};
template <class T>
@@ -41,6 +42,7 @@ struct some_alloc2
some_alloc2() {}
some_alloc2(const some_alloc2&);
+ T *allocate(size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
@@ -54,6 +56,7 @@ struct some_alloc3
some_alloc3() {}
some_alloc3(const some_alloc3&);
+ T *allocate(size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
diff --git a/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp
index 9a7c65ca2cf5..e0e4a4ff31bd 100644
--- a/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp
@@ -22,13 +22,6 @@
#include "test_macros.h"
#include "test_allocator.h"
-template <class T>
-struct some_alloc
-{
- typedef T value_type;
- some_alloc(const some_alloc&);
-};
-
int main()
{
{
@@ -40,7 +33,7 @@ int main()
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
+ typedef std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>> C;
#if TEST_STD_VER <= 14
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#else
diff --git a/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp
index 3c75a700eaed..6d660fd10e8e 100644
--- a/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp
@@ -83,4 +83,12 @@ int main()
test("123456798012345679801234567980123456798012345679801234567980", 60, A());
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s({"abc", 1});
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp b/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
new file mode 100644
index 000000000000..b2fece8da8c2
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: libcpp-no-deduction-guides
+
+// template<class InputIterator>
+// basic_string(InputIterator begin, InputIterator end,
+// const Allocator& a = Allocator());
+
+// template<class charT,
+// class traits,
+// class Allocator = allocator<charT>
+// >
+// basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator())
+// -> basic_string<charT, traits, Allocator>;
+//
+// The deduction guide shall not participate in overload resolution if Allocator
+// is a type that does not qualify as an allocator.
+
+
+#include <string>
+#include <string_view>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+int main()
+{
+ {
+ std::string_view sv = "12345678901234";
+ std::basic_string s1{sv, 23}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}}
+ }
+}
diff --git a/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp b/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
new file mode 100644
index 000000000000..df1e99e0147f
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: libcpp-no-deduction-guides
+
+// template<class InputIterator>
+// basic_string(InputIterator begin, InputIterator end,
+// const Allocator& a = Allocator());
+
+// template<class charT,
+// class traits,
+// class Allocator = allocator<charT>
+// >
+// basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator())
+// -> basic_string<charT, traits, Allocator>;
+//
+// The deduction guide shall not participate in overload resolution if Allocator
+// is a type that does not qualify as an allocator.
+
+
+#include <string>
+#include <string_view>
+#include <iterator>
+#include <memory>
+#include <type_traits>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_allocator.h"
+#include "../input_iterator.h"
+#include "min_allocator.h"
+
+int main()
+{
+ {
+ std::string_view sv = "12345678901234";
+ std::basic_string s1(sv);
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
+ static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
+ assert(s1.size() == sv.size());
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+
+ {
+ std::string_view sv = "12345678901234";
+ std::basic_string s1{sv, std::allocator<char>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
+ static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
+ assert(s1.size() == sv.size());
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+ {
+ std::wstring_view sv = L"12345678901234";
+ std::basic_string s1{sv, test_allocator<wchar_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, wchar_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<wchar_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, test_allocator<wchar_t>>, "");
+ assert(s1.size() == sv.size());
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+ {
+ std::u16string_view sv = u"12345678901234";
+ std::basic_string s1{sv, min_allocator<char16_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char16_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char16_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, min_allocator<char16_t>>, "");
+ assert(s1.size() == sv.size());
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+ {
+ std::u32string_view sv = U"12345678901234";
+ std::basic_string s1{sv, explicit_allocator<char32_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char32_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char32_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, explicit_allocator<char32_t>>, "");
+ assert(s1.size() == sv.size());
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+}
diff --git a/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
new file mode 100644
index 000000000000..f79e43f6a6b0
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: libcpp-no-deduction-guides
+
+// template<class InputIterator>
+// basic_string(InputIterator begin, InputIterator end,
+// const Allocator& a = Allocator());
+
+// template<class charT,
+// class traits,
+// class Allocator = allocator<charT>
+// >
+// basic_string(basic_string_view<charT, traits>,
+// typename see below::size_type,
+// typename see below::size_type,
+// const Allocator& = Allocator())
+// -> basic_string<charT, traits, Allocator>;
+//
+// A size_type parameter type in a basic_string deduction guide refers to the size_type
+// member type of the type deduced by the deduction guide.
+//
+// The deduction guide shall not participate in overload resolution if Allocator
+// is a type that does not qualify as an allocator.
+
+
+#include <string>
+#include <string_view>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+int main()
+{
+ {
+ std::string_view sv = "12345678901234";
+ std::basic_string s1{sv, 0, 4, 23}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}}
+ }
+}
diff --git a/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
new file mode 100644
index 000000000000..d9561d22b882
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
@@ -0,0 +1,99 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: libcpp-no-deduction-guides
+
+// template<class InputIterator>
+// basic_string(InputIterator begin, InputIterator end,
+// const Allocator& a = Allocator());
+
+// template<class charT,
+// class traits,
+// class Allocator = allocator<charT>
+// >
+// basic_string(basic_string_view<charT, traits>,
+// typename see below::size_type,
+// typename see below::size_type,
+// const Allocator& = Allocator())
+// -> basic_string<charT, traits, Allocator>;
+//
+// A size_type parameter type in a basic_string deduction guide refers to the size_type
+// member type of the type deduced by the deduction guide.
+//
+// The deduction guide shall not participate in overload resolution if Allocator
+// is a type that does not qualify as an allocator.
+
+
+#include <string>
+#include <string_view>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_allocator.h"
+#include "../input_iterator.h"
+#include "min_allocator.h"
+
+int main()
+{
+ {
+ std::string_view sv = "12345678901234";
+ std::basic_string s1{sv, 0, 4};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
+ static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
+ assert(s1.size() == 4);
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+
+ {
+ std::string_view sv = "12345678901234";
+ std::basic_string s1{sv, 0, 4, std::allocator<char>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
+ static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
+ assert(s1.size() == 4);
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+ {
+ std::wstring_view sv = L"12345678901234";
+ std::basic_string s1{sv, 0, 4, test_allocator<wchar_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, wchar_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<wchar_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, test_allocator<wchar_t>>, "");
+ assert(s1.size() == 4);
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+ {
+ std::u16string_view sv = u"12345678901234";
+ std::basic_string s1{sv, 0, 4, min_allocator<char16_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char16_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char16_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, min_allocator<char16_t>>, "");
+ assert(s1.size() == 4);
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+ {
+ std::u32string_view sv = U"12345678901234";
+ std::basic_string s1{sv, 0, 4, explicit_allocator<char32_t>{}};
+ using S = decltype(s1); // what type did we get?
+ static_assert(std::is_same_v<S::value_type, char32_t>, "");
+ static_assert(std::is_same_v<S::traits_type, std::char_traits<char32_t>>, "");
+ static_assert(std::is_same_v<S::allocator_type, explicit_allocator<char32_t>>, "");
+ assert(s1.size() == 4);
+ assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
+ }
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
index 5ca5aaf8629c..38b68aa69042 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
@@ -48,14 +48,13 @@ int main()
test(S("12345678901234567890"), 'a', S("12345678901234567890a"));
}
#endif
-#if 0
+
{
// https://bugs.llvm.org/show_bug.cgi?id=31454
std::basic_string<veryLarge> s;
- veryLarge vl;
+ veryLarge vl = {};
s.push_back(vl);
s.push_back(vl);
s.push_back(vl);
}
-#endif
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp
index b58ed632893e..b3704268a4b6 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp
@@ -77,4 +77,13 @@ int main()
S("1234567890123456789012345678901234567890"));
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s;
+ s.append({"abc", 1});
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
index e7c5ecdc9c1b..4c3a87248c72 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
@@ -218,4 +218,13 @@ int main()
test(S("abcdefghijklmnopqrst"), 21, S("12345678901234567890"), S("can't happen"));
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s;
+ s.insert(0, {"abc", 1});
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp
index 1064855c1506..bbe385015331 100644
--- a/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp
@@ -77,4 +77,13 @@ int main()
S("1234567890123456789012345678901234567890"));
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s;
+ s += {"abc", 1};
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
index 190e10d5c830..f5f31254eb10 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
@@ -281,4 +281,13 @@ int main()
test2<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " ";
+ s.replace(s.cbegin(), s.cend(), {"abc", 1});
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
index 612e1e200c90..88982e09804f 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
@@ -379,4 +379,13 @@ int main()
test2<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " ";
+ s.replace(0, 1, {"abc", 1});
+ assert(s.size() == 1);
+ assert(s == "a");
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
index 73727198f28e..c8b784c2465f 100644
--- a/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
@@ -35,8 +35,8 @@ struct some_alloc
some_alloc() {}
some_alloc(const some_alloc&);
+ T *allocate(size_t);
void deallocate(void*, unsigned) {}
-
typedef std::true_type propagate_on_container_swap;
};
@@ -47,6 +47,7 @@ struct some_alloc2
some_alloc2() {}
some_alloc2(const some_alloc2&);
+ T *allocate(size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_swap;
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
index 0ddbf2e2f99f..be730cbc1242 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
@@ -15,9 +15,8 @@
#include <stdexcept>
#include <cassert>
-#include "min_allocator.h"
-
#include "test_macros.h"
+#include "min_allocator.h"
int sign(int x)
{
@@ -378,4 +377,11 @@ int main()
test2<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.compare(0, 1, {"abc", 1}) < 0);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
index 3f6c169d223a..80d579e300c3 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int sign(int x)
@@ -74,4 +75,11 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), 0);
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.compare({"abc", 1}) < 0);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
index b7df3461792b..4ce343351a9e 100644
--- a/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -154,4 +155,11 @@ int main()
test1<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.find_first_not_of({"abc", 1}) == 0);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
index 765d1603af8c..105c2a6db175 100644
--- a/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -154,4 +155,11 @@ int main()
test1<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.find_first_of({"abc", 1}) == std::string::npos);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
index f3377596ab3d..57fab60e78a7 100644
--- a/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -154,4 +155,11 @@ int main()
test1<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.find_last_not_of({"abc", 1}) == s.size() - 1);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
index 5cb2df7c6c7f..b6b5b8f1217e 100644
--- a/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -154,4 +155,11 @@ int main()
test1<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.find_last_of({"abc", 1}) == std::string::npos);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
index e519a7943ba9..769b51c8dc10 100644
--- a/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -154,4 +155,11 @@ int main()
test1<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.find({"abc", 1}) == std::string::npos);
+ }
+#endif
}
diff --git a/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
index ef571c284b81..d7908ad8583b 100644
--- a/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -154,4 +155,11 @@ int main()
test1<S>();
}
#endif
+
+#if TEST_STD_VER > 3
+ { // LWG 2946
+ std::string s = " !";
+ assert(s.rfind({"abc", 1}) == std::string::npos);
+ }
+#endif
}
diff --git a/test/std/strings/string.view/char.bad.fail.cpp b/test/std/strings/string.view/char.bad.fail.cpp
new file mode 100644
index 000000000000..cbd2b47b9138
--- /dev/null
+++ b/test/std/strings/string.view/char.bad.fail.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+// ... manipulating sequences of any non-array trivial standard-layout types.
+
+#include <string>
+#include "../basic.string/test_traits.h"
+
+struct NotTrivial {
+ NotTrivial() : value(3) {}
+ int value;
+};
+
+struct NotStandardLayout {
+public:
+ NotStandardLayout() : one(1), two(2) {}
+ int sum() const { return one + two; } // silences "unused field 'two' warning"
+ int one;
+private:
+ int two;
+};
+
+int main()
+{
+ {
+// array
+ typedef char C[3];
+ static_assert(std::is_array<C>::value, "");
+ std::basic_string_view<C, test_traits<C> > sv;
+// expected-error-re@string_view:* {{static_assert failed{{.*}} "Character type of basic_string_view must not be an array"}}
+ }
+
+ {
+// not trivial
+ static_assert(!std::is_trivial<NotTrivial>::value, "");
+ std::basic_string_view<NotTrivial, test_traits<NotTrivial> > sv;
+// expected-error-re@string_view:* {{static_assert failed{{.*}} "Character type of basic_string_view must be trivial"}}
+ }
+
+ {
+// not standard layout
+ static_assert(!std::is_standard_layout<NotStandardLayout>::value, "");
+ std::basic_string_view<NotStandardLayout, test_traits<NotStandardLayout> > sv;
+// expected-error-re@string_view:* {{static_assert failed{{.*}} "Character type of basic_string_view must be standard-layout"}}
+ }
+}
diff --git a/test/std/strings/string.view/string.view.access/data.pass.cpp b/test/std/strings/string.view/string.view.access/data.pass.cpp
index 7b2350923bb6..a179cfa1c4a1 100644
--- a/test/std/strings/string.view/string.view.access/data.pass.cpp
+++ b/test/std/strings/string.view/string.view.access/data.pass.cpp
@@ -22,6 +22,10 @@ void test ( const CharT *s, size_t len ) {
std::basic_string_view<CharT> sv ( s, len );
assert ( sv.length() == len );
assert ( sv.data() == s );
+#if TEST_STD_VER > 14
+// make sure we pick up std::data, too!
+ assert ( sv.data() == std::data(sv));
+#endif
}
int main () {
diff --git a/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
index bb733c4fb13d..b21ba0422fdb 100644
--- a/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
+++ b/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
@@ -55,6 +55,11 @@ void test2 ( const CharT *s, size_t len ) {
assert ( sv1.empty() == (len == 0));
assert ( sv1.size() == sv1.length());
assert ( sv1.max_size() > sv1.size());
+#if TEST_STD_VER > 14
+// make sure we pick up std::size, too!
+ assert ( sv1.size() == std::size(sv1));
+ assert ( sv1.empty() == std::empty(sv1));
+#endif
}
}
diff --git a/test/std/strings/string.view/string.view.cons/assign.pass.cpp b/test/std/strings/string.view/string.view.cons/assign.pass.cpp
index b7348ea226cf..3307aa61d99f 100644
--- a/test/std/strings/string.view/string.view.cons/assign.pass.cpp
+++ b/test/std/strings/string.view/string.view.cons/assign.pass.cpp
@@ -33,15 +33,17 @@ bool test (T sv0)
int main () {
assert( test<std::string_view> ( "1234"));
-#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
+#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
assert( test<std::u16string_view> (u"1234"));
assert( test<std::u32string_view> (U"1234"));
#endif
+#endif
assert( test<std::wstring_view> (L"1234"));
#if TEST_STD_VER > 11
static_assert( test<std::string_view> ({ "abc", 3}), "");
-#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
static_assert( test<std::u16string_view> ({u"abc", 3}), "");
static_assert( test<std::u32string_view> ({U"abc", 3}), "");
#endif
diff --git a/test/std/strings/string.view/types.pass.cpp b/test/std/strings/string.view/types.pass.cpp
index 68bbc29b9aa0..4c29959f0951 100644
--- a/test/std/strings/string.view/types.pass.cpp
+++ b/test/std/strings/string.view/types.pass.cpp
@@ -15,20 +15,20 @@
// {
// public:
// // types:
-// using traits_type = traits;
-// using value_type = charT;
-// using pointer = value_type*;
-// using const_pointer = const value_type*;
-// using reference = value_type&;
-// using const_reference = const value_type&;
-// using const_iterator = implementation-defined ; // see 24.4.2.2
-// using iterator = const_iterator;
-// using const_reverse_iterator = reverse_iterator<const_iterator>;
-// using iterator = const_reverse_iterator;
-// using size_type = size_t;
-// using difference_type = ptrdiff_t;
-// static constexpr size_type npos = size_type(-1);
-//
+// using traits_type = traits;
+// using value_type = charT;
+// using pointer = value_type*;
+// using const_pointer = const value_type*;
+// using reference = value_type&;
+// using const_reference = const value_type&;
+// using const_iterator = implementation-defined ; // see 24.4.2.2
+// using iterator = const_iterator;
+// using const_reverse_iterator = reverse_iterator<const_iterator>;
+// using iterator = const_reverse_iterator;
+// using size_type = size_t;
+// using difference_type = ptrdiff_t;
+// static constexpr size_type npos = size_type(-1);
+//
// };
#include <string_view>
diff --git a/test/std/thread/futures/futures.async/async.fail.cpp b/test/std/thread/futures/futures.async/async.fail.cpp
index 594c67f52699..e20f1a0a5091 100644
--- a/test/std/thread/futures/futures.async/async.fail.cpp
+++ b/test/std/thread/futures/futures.async/async.fail.cpp
@@ -33,6 +33,6 @@ int foo (int x) { return x; }
int main ()
{
- std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
-} \ No newline at end of file
+ std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
+}
diff --git a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
index 37618f7aafc7..68de5e3d1368 100644
--- a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
+++ b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
@@ -102,7 +102,7 @@ void test_copy_assign_self() {
// empty
{
any a;
- a = a;
+ a = (any &)a;
assertEmpty(a);
assert(globalMemCounter.checkOutstandingNewEq(0));
}
@@ -112,7 +112,7 @@ void test_copy_assign_self() {
any a((small(1)));
assert(small::count == 1);
- a = a;
+ a = (any &)a;
assert(small::count == 1);
assertContains<small>(a, 1);
@@ -125,7 +125,7 @@ void test_copy_assign_self() {
any a(large(1));
assert(large::count == 1);
- a = a;
+ a = (any &)a;
assert(large::count == 1);
assertContains<large>(a, 1);
diff --git a/test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp b/test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp
new file mode 100644
index 000000000000..abb80d06d755
--- /dev/null
+++ b/test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// XFAIL: gcc-7
+
+// <functional>
+
+// equal_to, not_equal_to, less, et al.
+
+// Test that these types can be constructed w/o an initializer in a constexpr
+// context. This is specifically testing gcc.gnu.org/PR83921
+
+
+#include <functional>
+#include "test_macros.h"
+
+template <class T>
+constexpr bool test_constexpr_context() {
+ std::equal_to<T> eq;
+ ((void)eq);
+ std::not_equal_to<T> neq;
+ ((void)neq);
+ std::less<T> l;
+ ((void)l);
+ std::less_equal<T> le;
+ ((void)le);
+ std::greater<T> g;
+ ((void)g);
+ std::greater_equal<T> ge;
+ ((void)ge);
+ return true;
+}
+
+static_assert(test_constexpr_context<int>(), "");
+static_assert(test_constexpr_context<void>(), "");
+
+
+int main() {
+
+}
diff --git a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
index 7601ff9d147d..f33b4157721a 100644
--- a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
+++ b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
@@ -305,15 +305,17 @@ void constructor_tests()
using RetT = decltype(std::not_fn(value));
static_assert(std::is_move_constructible<RetT>::value, "");
static_assert(std::is_copy_constructible<RetT>::value, "");
- static_assert(std::is_move_assignable<RetT>::value, "");
- static_assert(std::is_copy_assignable<RetT>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_move_assignable<RetT>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_copy_assignable<RetT>::value, "");
auto ret = std::not_fn(value);
assert(ret() == false);
auto ret2 = std::not_fn(value2);
assert(ret2() == true);
+#if defined(_LIBCPP_VERSION)
ret = ret2;
assert(ret() == true);
assert(ret2() == true);
+#endif // _LIBCPP_VERSION
}
{
using T = MoveAssignableWrapper;
@@ -322,14 +324,16 @@ void constructor_tests()
using RetT = decltype(std::not_fn(std::move(value)));
static_assert(std::is_move_constructible<RetT>::value, "");
static_assert(!std::is_copy_constructible<RetT>::value, "");
- static_assert(std::is_move_assignable<RetT>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_move_assignable<RetT>::value, "");
static_assert(!std::is_copy_assignable<RetT>::value, "");
auto ret = std::not_fn(std::move(value));
assert(ret() == false);
auto ret2 = std::not_fn(std::move(value2));
assert(ret2() == true);
+#if defined(_LIBCPP_VERSION)
ret = std::move(ret2);
assert(ret() == true);
+#endif // _LIBCPP_VERSION
}
}
@@ -426,7 +430,7 @@ void throws_in_constructor_test()
{
ThrowsOnCopy cp;
try {
- std::not_fn(cp);
+ (void)std::not_fn(cp);
assert(false);
} catch (int const& value) {
assert(value == 42);
diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
new file mode 100644
index 000000000000..c328b4a4e7a2
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
@@ -0,0 +1,129 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ std::boyer_moore_searcher<Iter2> s{b2, e2};
+ assert(result == std::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
new file mode 100644
index 000000000000..2555cedb212a
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
@@ -0,0 +1,125 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) {
+ std::boyer_moore_searcher<Iter2,
+ MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>>
+ s{b2, e2};
+ assert(result == std::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
new file mode 100644
index 000000000000..f7b8e4983e54
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
@@ -0,0 +1,143 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::boyer_moore_searcher<Iter2,
+ MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>,
+ count_equal>
+ s{b2, e2};
+ count_equal::count = 0;
+ assert(result == std::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp
new file mode 100644
index 000000000000..17121d2809aa
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp
@@ -0,0 +1,134 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::boyer_moore_searcher<Iter2,
+ typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2};
+ count_equal::count = 0;
+ assert(result == std::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp
new file mode 100644
index 000000000000..ec65a4b9b69f
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp
@@ -0,0 +1,129 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ std::boyer_moore_horspool_searcher<Iter2> s{b2, e2};
+ assert(result == std::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
new file mode 100644
index 000000000000..dfa587dccfb1
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
@@ -0,0 +1,124 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) {
+ std::boyer_moore_horspool_searcher<Iter2,
+ MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>>
+ s{b2, e2};
+ assert(result == std::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
new file mode 100644
index 000000000000..083065ca8a91
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
@@ -0,0 +1,137 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::boyer_moore_horspool_searcher<Iter2,
+ MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>,
+ count_equal>
+ s{b2, e2};
+ count_equal::count = 0;
+ assert(result == std::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp
new file mode 100644
index 000000000000..865dd89ce18a
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp
@@ -0,0 +1,131 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: c++17, c++2a
+
+// <functional>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// pair<RandomAccessIterator2, RandomAccessIterator2>
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::boyer_moore_horspool_searcher<Iter2,
+ typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2};
+ count_equal::count = 0;
+ assert(result == std::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ char ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp
new file mode 100644
index 000000000000..e498cfd960a3
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <functional>
+
+// default searcher
+// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+// class default_searcher {
+// public:
+// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
+// _BinaryPredicate __p = _BinaryPredicate())
+// : __first_(__f), __last_(__l), __pred_(__p) {}
+//
+// template <typename _ForwardIterator2>
+// pair<_ForwardIterator2, _ForwardIterator2>
+// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const {
+// return std::search(__f, __l, __first_, __last_, __pred_);
+// }
+//
+// private:
+// _ForwardIterator __first_;
+// _ForwardIterator __last_;
+// _BinaryPredicate __pred_;
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ std::default_searcher<Iter2> s{b2, e2};
+ assert(result == std::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<forward_iterator<const int*>, forward_iterator<const int*> >();
+ test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<forward_iterator<const int*>, random_access_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
+ test<random_access_iterator<const int*>, forward_iterator<const int*> >();
+ test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+}
diff --git a/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp
new file mode 100644
index 000000000000..025565f8eb13
--- /dev/null
+++ b/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp
@@ -0,0 +1,103 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// default searcher
+// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+// class default_searcher {
+// public:
+// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
+// _BinaryPredicate __p = _BinaryPredicate())
+// : __first_(__f), __last_(__l), __pred_(__p) {}
+//
+// template <typename _ForwardIterator2>
+// pair<_ForwardIterator2, _ForwardIterator2>
+// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const {
+// return std::search(__f, __l, __first_, __last_, __pred_);
+// }
+//
+// private:
+// _ForwardIterator __first_;
+// _ForwardIterator __last_;
+// _BinaryPredicate __pred_;
+// };
+
+
+#include <algorithm>
+#include <functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::default_searcher<Iter2, count_equal> s{b2, e2};
+ count_equal::count = 0;
+ assert(result == std::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+ int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ int ic[] = {1};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ int ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<forward_iterator<const int*>, forward_iterator<const int*> >();
+ test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<forward_iterator<const int*>, random_access_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
+ test<random_access_iterator<const int*>, forward_iterator<const int*> >();
+ test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+}
diff --git a/test/std/experimental/utilities/ratio/nothing_to_do.pass.cpp b/test/std/utilities/function.objects/func.search/nothing_to_do.pass.cpp
index 9a59227abdd9..9a59227abdd9 100644
--- a/test/std/experimental/utilities/ratio/nothing_to_do.pass.cpp
+++ b/test/std/utilities/function.objects/func.search/nothing_to_do.pass.cpp
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
index 9b83ddecb974..1c2be02c6212 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
@@ -92,28 +92,28 @@ int main() {
{
typedef std::function<int()> Func;
Func f = g0;
- Func& fr = (f = f);
+ Func& fr = (f = (Func &)f);
assert(&fr == &f);
assert(*f.target<int(*)()>() == g0);
}
{
typedef std::function<int(int)> Func;
Func f = g;
- Func& fr = (f = f);
+ Func& fr = (f = (Func &)f);
assert(&fr == &f);
assert(*f.target<int(*)(int)>() == g);
}
{
typedef std::function<int(int, int)> Func;
Func f = g2;
- Func& fr = (f = f);
+ Func& fr = (f = (Func &)f);
assert(&fr == &f);
assert(*f.target<int(*)(int, int)>() == g2);
}
{
typedef std::function<int(int, int, int)> Func;
Func f = g3;
- Func& fr = (f = f);
+ Func& fr = (f = (Func &)f);
assert(&fr == &f);
assert(*f.target<int(*)(int, int, int)>() == g3);
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
new file mode 100644
index 000000000000..0813c48f322e
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// class function<R(ArgTypes...)>
+
+// function& operator=(function &&);
+
+#include <functional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A
+{
+ static std::function<void()> global;
+ static bool cancel;
+
+ ~A() {
+ DoNotOptimize(cancel);
+ if (cancel)
+ global = std::function<void()>(nullptr);
+ }
+ void operator()() {}
+};
+
+std::function<void()> A::global;
+bool A::cancel = false;
+
+int main()
+{
+ A::global = A();
+ assert(A::global.target<A>());
+
+ // Check that we don't recurse in A::~A().
+ A::cancel = true;
+ A::global = std::function<void()>(nullptr);
+ assert(!A::global.target<A>());
+}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp
new file mode 100644
index 000000000000..eeb181928eaf
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// class function<R(ArgTypes...)>
+
+// function& operator=(nullptr_t);
+
+#include <functional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A
+{
+ static std::function<void()> global;
+ static bool cancel;
+
+ ~A() {
+ DoNotOptimize(cancel);
+ if (cancel)
+ global = nullptr;
+ }
+ void operator()() {}
+};
+
+std::function<void()> A::global;
+bool A::cancel = false;
+
+int main()
+{
+ A::global = A();
+ assert(A::global.target<A>());
+
+ // Check that we don't recurse in A::~A().
+ A::cancel = true;
+ A::global = nullptr;
+ assert(!A::global.target<A>());
+}
diff --git a/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp
new file mode 100644
index 000000000000..0afab685f913
--- /dev/null
+++ b/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+//
+// template <class T>
+// class allocator
+// {
+// public: // All of these are constexpr after C++17
+// constexpr allocator() noexcept;
+// constexpr allocator(const allocator&) noexcept;
+// template<class U> constexpr allocator(const allocator<U>&) noexcept;
+// ...
+// };
+
+#include <memory>
+#include <cstddef>
+
+#include "test_macros.h"
+
+
+int main()
+{
+ {
+ typedef std::allocator<char> AC;
+ typedef std::allocator<long> AL;
+
+ constexpr AC a1;
+ constexpr AC a2{a1};
+ constexpr AL a3{a2};
+ (void) a3;
+ }
+ {
+ typedef std::allocator<const char> AC;
+ typedef std::allocator<const long> AL;
+
+ constexpr AC a1;
+ constexpr AC a2{a1};
+ constexpr AL a3{a2};
+ (void) a3;
+ }
+
+}
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
index f2cf9f2d4187..70c5e46965a0 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
@@ -14,40 +14,98 @@
#include <memory>
#include <cassert>
+#include <iostream>
+#include "test_macros.h"
#include "count_new.hpp"
-int A_constructed = 0;
-struct A
-{
- int data;
- A() {++A_constructed;}
- A(const A&) {++A_constructed;}
- ~A() {--A_constructed;}
+#ifdef TEST_HAS_NO_ALIGNED_ALLOCATION
+static const bool UsingAlignedNew = false;
+#else
+static const bool UsingAlignedNew = true;
+#endif
+
+#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
+static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+#else
+static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+#endif
+
+static const size_t OverAligned = MaxAligned * 2;
+
+
+template <size_t Align>
+struct TEST_ALIGNAS(Align) AlignedType {
+ char data;
+ static int constructed;
+ AlignedType() { ++constructed; }
+ AlignedType(AlignedType const&) { ++constructed; }
+ ~AlignedType() { --constructed; }
};
+template <size_t Align>
+int AlignedType<Align>::constructed = 0;
-int main()
-{
- globalMemCounter.reset();
- std::allocator<A> a;
+
+template <size_t Align>
+void test_aligned() {
+ typedef AlignedType<Align> T;
+ T::constructed = 0;
+ globalMemCounter.reset();
+ std::allocator<T> a;
+ const bool IsOverAlignedType = Align > MaxAligned;
+ const bool ExpectAligned = IsOverAlignedType && UsingAlignedNew;
+ {
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(A_constructed == 0);
+ assert(T::constructed == 0);
globalMemCounter.last_new_size = 0;
- A* volatile ap = a.allocate(3);
+ globalMemCounter.last_new_align = 0;
+ T* ap = a.allocate(3);
+ DoNotOptimize(ap);
assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
- assert(A_constructed == 0);
+ assert(globalMemCounter.checkNewCalledEq(1));
+ assert(globalMemCounter.checkAlignedNewCalledEq(ExpectAligned));
+ assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(T)));
+ assert(globalMemCounter.checkLastNewAlignEq(ExpectAligned ? Align : 0));
+ assert(T::constructed == 0);
+ globalMemCounter.last_delete_align = 0;
a.deallocate(ap, 3);
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(A_constructed == 0);
-
+ assert(globalMemCounter.checkDeleteCalledEq(1));
+ assert(globalMemCounter.checkAlignedDeleteCalledEq(ExpectAligned));
+ assert(globalMemCounter.checkLastDeleteAlignEq(ExpectAligned ? Align : 0));
+ assert(T::constructed == 0);
+ }
+ globalMemCounter.reset();
+ {
globalMemCounter.last_new_size = 0;
- A* volatile ap2 = a.allocate(3, (const void*)5);
+ globalMemCounter.last_new_align = 0;
+ T* volatile ap2 = a.allocate(11, (const void*)5);
+ DoNotOptimize(ap2);
assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
- assert(A_constructed == 0);
- a.deallocate(ap2, 3);
+ assert(globalMemCounter.checkNewCalledEq(1));
+ assert(globalMemCounter.checkAlignedNewCalledEq(ExpectAligned));
+ assert(globalMemCounter.checkLastNewSizeEq(11 * sizeof(T)));
+ assert(globalMemCounter.checkLastNewAlignEq(ExpectAligned ? Align : 0));
+ assert(T::constructed == 0);
+ globalMemCounter.last_delete_align = 0;
+ a.deallocate(ap2, 11);
+ DoNotOptimize(ap2);
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(A_constructed == 0);
+ assert(globalMemCounter.checkDeleteCalledEq(1));
+ assert(globalMemCounter.checkAlignedDeleteCalledEq(ExpectAligned));
+ assert(globalMemCounter.checkLastDeleteAlignEq(ExpectAligned ? Align : 0));
+ assert(T::constructed == 0);
+ }
+}
+
+int main() {
+ test_aligned<1>();
+ test_aligned<2>();
+ test_aligned<4>();
+ test_aligned<8>();
+ test_aligned<16>();
+ test_aligned<MaxAligned>();
+ test_aligned<OverAligned>();
+ test_aligned<OverAligned * 2>();
}
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
index 28dadd831514..9ba9874406f6 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
@@ -63,6 +63,7 @@ int main()
globalMemCounter.last_new_size = 0;
A* ap = a.allocate(3);
+ DoNotOptimize(ap);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
assert(A_constructed == 0);
@@ -100,6 +101,7 @@ int main()
assert(A_constructed == 0);
a.deallocate(ap, 3);
+ DoNotOptimize(ap);
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(A_constructed == 0);
}
@@ -111,6 +113,7 @@ int main()
globalMemCounter.last_new_size = 0;
move_only* ap = a.allocate(3);
+ DoNotOptimize(ap);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
assert(move_only_constructed == 0);
@@ -132,6 +135,7 @@ int main()
assert(move_only_constructed == 0);
a.deallocate(ap, 3);
+ DoNotOptimize(ap);
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(move_only_constructed == 0);
}
diff --git a/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp b/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
new file mode 100644
index 000000000000..52aca8192cbb
--- /dev/null
+++ b/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <memory>
+
+// template <class T>
+// pair<T*, ptrdiff_t>
+// get_temporary_buffer(ptrdiff_t n);
+//
+// template <class T>
+// void
+// return_temporary_buffer(T* p);
+
+#include <memory>
+#include <cassert>
+
+struct alignas(32) A {
+ int field;
+};
+
+int main()
+{
+ std::pair<A*, std::ptrdiff_t> ip = std::get_temporary_buffer<A>(5);
+ assert(!(ip.first == nullptr) ^ (ip.second == 0));
+ assert(reinterpret_cast<uintptr_t>(ip.first) % alignof(A) == 0);
+ std::return_temporary_buffer(ip.first);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp
index 48c90f7b9661..54c85e94338c 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp
@@ -24,11 +24,12 @@
#include <sstream>
#include <cassert>
-class A {};
+#include "min_allocator.h"
+#include "deleter_types.h"
int main()
{
- std::unique_ptr<A> p(new A);
+ std::unique_ptr<int, PointerDeleter<int>> p;
std::ostringstream os;
- os << p;
+ os << p; // expected-error {{invalid operands to binary expression}}
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
index 079661d0c174..d7e35a62f8f0 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
@@ -10,6 +10,9 @@
// type_traits
// aligned_storage
+//
+// Issue 3034 added:
+// The member typedef type shall be a trivial standard-layout type.
#include <type_traits>
#include <cstddef> // for std::max_align_t
@@ -20,144 +23,231 @@ int main()
{
typedef std::aligned_storage<10, 1 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 1, "");
static_assert(sizeof(T1) == 10, "");
}
{
typedef std::aligned_storage<10, 2 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 10, "");
}
{
typedef std::aligned_storage<10, 4 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 12, "");
}
{
typedef std::aligned_storage<10, 8 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<10, 16 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10, 16>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10, 16>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 16, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<10, 32 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10, 32>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10, 32>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 32, "");
static_assert(sizeof(T1) == 32, "");
}
{
typedef std::aligned_storage<20, 32 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<20, 32>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<20, 32>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 32, "");
static_assert(sizeof(T1) == 32, "");
}
{
typedef std::aligned_storage<40, 32 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<40, 32>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<40, 32>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 32, "");
static_assert(sizeof(T1) == 64, "");
}
{
typedef std::aligned_storage<12, 16 >::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<12, 16>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<12, 16>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 16, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<1>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<1>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<1>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 1, "");
static_assert(sizeof(T1) == 1, "");
}
{
typedef std::aligned_storage<2>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<2>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<2>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 2, "");
}
{
typedef std::aligned_storage<3>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<3>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<3>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 4, "");
}
{
typedef std::aligned_storage<4>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<4>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<4>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 4, "");
}
{
typedef std::aligned_storage<5>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<5>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<5>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 8, "");
}
{
typedef std::aligned_storage<7>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<7>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<7>, T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 8, "");
}
{
typedef std::aligned_storage<8>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<8>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<8>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 8, "");
}
{
typedef std::aligned_storage<9>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<9>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<9>, T1>::value, "");
#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
+#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<15>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<15>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<15>, T1>::value, "");
+#endif
+#if TEST_STD_VER <= 17
+ static_assert(std::is_pod<T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
@@ -170,8 +260,10 @@ int main()
{
typedef std::aligned_storage<16>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<16>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<16>, T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == alignof(std::max_align_t),
"");
static_assert(sizeof(T1) == 16, "");
@@ -179,8 +271,10 @@ int main()
{
typedef std::aligned_storage<17>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<17>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<17>, T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == alignof(std::max_align_t),
"");
static_assert(sizeof(T1) == 16 + alignof(std::max_align_t), "");
@@ -188,8 +282,10 @@ int main()
{
typedef std::aligned_storage<10>::type T1;
#if TEST_STD_VER > 11
- static_assert(std::is_same<std::aligned_storage_t<10>, T1>::value, "" );
+ static_assert(std::is_same<std::aligned_storage_t<10>, T1>::value, "");
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
index 883548270469..3e58b51a6168 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
@@ -13,6 +13,9 @@
// aligned_union<size_t Len, class ...Types>
+// Issue 3034 added:
+// The member typedef type shall be a trivial standard-layout type.
+
#include <type_traits>
#include "test_macros.h"
@@ -24,6 +27,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, char>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 1, "");
static_assert(sizeof(T1) == 10, "");
}
@@ -32,6 +37,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, short>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 10, "");
}
@@ -40,6 +47,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, int>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 12, "");
}
@@ -48,6 +57,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, double>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
@@ -56,6 +67,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, short, char>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 10, "");
}
@@ -64,6 +77,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, char, short>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 10, "");
}
@@ -72,6 +87,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, int, char, short>, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 4, "");
}
@@ -80,6 +97,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, char, int, short >, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 4, "");
}
@@ -88,6 +107,8 @@ int main()
#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, char, short, int >, T1>::value, "" );
#endif
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 4, "");
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
index 85b14726617f..dbbbe159f09e 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
@@ -11,8 +11,9 @@
// common_type
-#include <type_traits>
+#include <functional>
#include <memory>
+#include <type_traits>
#include "test_macros.h"
@@ -45,7 +46,6 @@ namespace std
template <> struct common_type< ::S<long>, long> {};
template <> struct common_type<long, ::S<long> > {};
- template <> struct common_type< ::X<float> > {};
template <> struct common_type< ::X<double>, ::X<double> > {};
}
@@ -97,7 +97,6 @@ void test_bullet_two() {
static_assert(std::is_same<CommonType<int volatile[]>, int volatile*>::value, "");
static_assert(std::is_same<CommonType<void(&)()>, void(*)()>::value, "");
- static_assert(no_common_type<X<float> >::value, "");
static_assert(no_common_type<X<double> >::value, "");
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp
index e06229f7e975..e220f591f480 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp
@@ -32,7 +32,7 @@ int main()
test_remove_cvref<const volatile int, int>();
test_remove_cvref<volatile int, int>();
-// Doesn't decay
+// Doesn't decay
test_remove_cvref<int[3], int[3]>();
test_remove_cvref<int const [3], int[3]>();
test_remove_cvref<int volatile [3], int[3]>();
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
index 24231526b2bf..69e805d1e1f4 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
@@ -104,36 +104,43 @@ int main()
test_result_of<S const volatile&(unsigned char, int&), double const volatile&> ();
}
{ // pointer to function
- typedef bool (&RF0)();
+ typedef bool (&RF0)();
typedef bool* (&RF1)(int);
typedef bool& (&RF2)(int, int);
typedef bool const& (&RF3)(int, int, int);
+ typedef bool (&RF4)(int, ...);
typedef bool (*PF0)();
typedef bool* (*PF1)(int);
typedef bool& (*PF2)(int, int);
typedef bool const& (*PF3)(int, int, int);
+ typedef bool (*PF4)(int, ...);
typedef bool (*&PRF0)();
typedef bool* (*&PRF1)(int);
typedef bool& (*&PRF2)(int, int);
typedef bool const& (*&PRF3)(int, int, int);
+ typedef bool (*&PRF4)(int, ...);
test_result_of<RF0(), bool>();
test_result_of<RF1(int), bool*>();
test_result_of<RF2(int, long), bool&>();
test_result_of<RF3(int, long, int), bool const&>();
+ test_result_of<RF4(int, float, void*), bool>();
test_result_of<PF0(), bool>();
test_result_of<PF1(int), bool*>();
test_result_of<PF2(int, long), bool&>();
test_result_of<PF3(int, long, int), bool const&>();
+ test_result_of<PF4(int, float, void*), bool>();
test_result_of<PRF0(), bool>();
test_result_of<PRF1(int), bool*>();
test_result_of<PRF2(int, long), bool&>();
test_result_of<PRF3(int, long, int), bool const&>();
+ test_result_of<PRF4(int, float, void*), bool>();
}
{ // pointer to member function
typedef int (S::*PMS0)();
typedef int* (S::*PMS1)(long);
typedef int& (S::*PMS2)(long, int);
+ typedef const int& (S::*PMS3)(int, ...);
test_result_of<PMS0( S), int> ();
test_result_of<PMS0( S&), int> ();
test_result_of<PMS0( S*), int> ();
@@ -193,9 +200,13 @@ int main()
test_no_result<PMS2(std::reference_wrapper<ND>, int, int)>();
test_no_result<PMS2(std::unique_ptr<ND>, int, int)>();
+ test_result_of<PMS3(S&, int), const int &>();
+ test_result_of<PMS3(S&, int, long), const int &>();
+
typedef int (S::*PMS0C)() const;
typedef int* (S::*PMS1C)(long) const;
typedef int& (S::*PMS2C)(long, int) const;
+ typedef const int& (S::*PMS3C)(int, ...) const;
test_result_of<PMS0C( S), int> ();
test_result_of<PMS0C( S&), int> ();
test_result_of<PMS0C(const S&), int> ();
@@ -238,9 +249,13 @@ int main()
test_no_result<PMS2C(volatile S&, int, int)>();
test_no_result<PMS2C(const volatile S&, int, int)>();
+ test_result_of<PMS3C(S&, int), const int &>();
+ test_result_of<PMS3C(S&, int, long), const int &>();
+
typedef int (S::*PMS0V)() volatile;
typedef int* (S::*PMS1V)(long) volatile;
typedef int& (S::*PMS2V)(long, int) volatile;
+ typedef const int& (S::*PMS3V)(int, ...) volatile;
test_result_of<PMS0V( S), int> ();
test_result_of<PMS0V( S&), int> ();
test_result_of<PMS0V(volatile S&), int> ();
@@ -274,9 +289,13 @@ int main()
test_no_result<PMS2V(const S&, int, int)>();
test_no_result<PMS2V(const volatile S&, int, int)>();
+ test_result_of<PMS3V(S&, int), const int &>();
+ test_result_of<PMS3V(S&, int, long), const int &>();
+
typedef int (S::*PMS0CV)() const volatile;
typedef int* (S::*PMS1CV)(long) const volatile;
typedef int& (S::*PMS2CV)(long, int) const volatile;
+ typedef const int& (S::*PMS3CV)(int, ...) const volatile;
test_result_of<PMS0CV( S), int> ();
test_result_of<PMS0CV( S&), int> ();
test_result_of<PMS0CV(const S&), int> ();
@@ -321,6 +340,9 @@ int main()
test_result_of<PMS2CV(volatile S*&, int, int), int&> ();
test_result_of<PMS2CV(const volatile S*&, int, int), int&> ();
test_result_of<PMS2CV(std::unique_ptr<S>, int, int), int&> ();
+
+ test_result_of<PMS3CV(S&, int), const int &>();
+ test_result_of<PMS3CV(S&, int, long), const int &>();
}
{ // pointer to member data
typedef char S::*PMD;
diff --git a/test/std/utilities/meta/meta.type.synop/endian.pass.cpp b/test/std/utilities/meta/meta.type.synop/endian.pass.cpp
new file mode 100644
index 000000000000..cf0ab2d26390
--- /dev/null
+++ b/test/std/utilities/meta/meta.type.synop/endian.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// enum class endian;
+
+#include <type_traits>
+#include <cstring>
+#include <cassert>
+#include <cstdint>
+
+#include "test_macros.h"
+
+int main() {
+ typedef std::endian E;
+ static_assert(std::is_enum<std::endian>::value, "");
+
+// Check that E is a scoped enum by checking for conversions.
+ typedef std::underlying_type<std::endian>::type UT;
+ static_assert(!std::is_convertible<std::endian, UT>::value, "");
+
+// test that the enumeration values exist
+ static_assert( std::endian::little == std::endian::little );
+ static_assert( std::endian::big == std::endian::big );
+ static_assert( std::endian::native == std::endian::native );
+ static_assert( std::endian::little != std::endian::big );
+
+// Technically not required, but true on all existing machines
+ static_assert( std::endian::native == std::endian::little ||
+ std::endian::native == std::endian::big );
+
+// Try to check at runtime
+ {
+ uint32_t i = 0x01020304;
+ char c[4];
+ static_assert(sizeof(i) == sizeof(c));
+ std::memcpy(c, &i, sizeof(c));
+
+ assert ((c[0] == 1) == (std::endian::native == std::endian::big));
+ }
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp
new file mode 100644
index 000000000000..52100c30404c
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp
@@ -0,0 +1,106 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-3, clang-4, clang-5, apple-clang, gcc-4, gcc-5, gcc-6
+
+// type_traits
+
+// has_unique_object_representations
+
+#include <type_traits>
+
+#include "test_macros.h"
+
+template <class T>
+void test_has_unique_object_representations()
+{
+ static_assert( std::has_unique_object_representations<T>::value, "");
+ static_assert( std::has_unique_object_representations<const T>::value, "");
+ static_assert( std::has_unique_object_representations<volatile T>::value, "");
+ static_assert( std::has_unique_object_representations<const volatile T>::value, "");
+
+ static_assert( std::has_unique_object_representations_v<T>, "");
+ static_assert( std::has_unique_object_representations_v<const T>, "");
+ static_assert( std::has_unique_object_representations_v<volatile T>, "");
+ static_assert( std::has_unique_object_representations_v<const volatile T>, "");
+}
+
+template <class T>
+void test_has_not_has_unique_object_representations()
+{
+ static_assert(!std::has_unique_object_representations<T>::value, "");
+ static_assert(!std::has_unique_object_representations<const T>::value, "");
+ static_assert(!std::has_unique_object_representations<volatile T>::value, "");
+ static_assert(!std::has_unique_object_representations<const volatile T>::value, "");
+
+ static_assert(!std::has_unique_object_representations_v<T>, "");
+ static_assert(!std::has_unique_object_representations_v<const T>, "");
+ static_assert(!std::has_unique_object_representations_v<volatile T>, "");
+ static_assert(!std::has_unique_object_representations_v<const volatile T>, "");
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union EmptyUnion {};
+struct NonEmptyUnion {int x; unsigned y;};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+struct A
+{
+ ~A();
+ unsigned foo;
+};
+
+struct B
+{
+ char bar;
+ int foo;
+};
+
+
+int main()
+{
+ test_has_not_has_unique_object_representations<void>();
+ test_has_not_has_unique_object_representations<Empty>();
+ test_has_not_has_unique_object_representations<EmptyUnion>();
+ test_has_not_has_unique_object_representations<NotEmpty>();
+ test_has_not_has_unique_object_representations<bit_zero>();
+ test_has_not_has_unique_object_representations<Abstract>();
+ test_has_not_has_unique_object_representations<B>();
+
+// I would expect all three of these to have unique representations.
+// I would also expect that there are systems where they do not.
+// test_has_not_has_unique_object_representations<int&>();
+// test_has_not_has_unique_object_representations<int *>();
+// test_has_not_has_unique_object_representations<double>();
+
+
+ test_has_unique_object_representations<unsigned>();
+ test_has_unique_object_representations<NonEmptyUnion>();
+ test_has_unique_object_representations<char[3]>();
+ test_has_unique_object_representations<char[]>();
+
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
index 8d63a23494b9..4808a4dc9e48 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
@@ -59,8 +59,6 @@ struct E
template <typename T>
struct X { T t; };
-struct Incomplete;
-
int main()
{
test_is_assignable<int&, int&> ();
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
index 1f7c32a8cc07..b90363a5c380 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -30,6 +30,7 @@ struct A
{
explicit A(int);
A(int, double);
+ A(int, long, double);
#if TEST_STD_VER >= 11
private:
#endif
@@ -106,6 +107,16 @@ void test_is_constructible()
#endif
}
+template <class T, class A0, class A1, class A2>
+void test_is_constructible()
+{
+ static_assert(( std::is_constructible<T, A0, A1, A2>::value), "");
+ LIBCPP11_STATIC_ASSERT((std::__libcpp_is_constructible<T, A0, A1, A2>::type::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_constructible_v<T, A0, A1, A2>), "");
+#endif
+}
+
template <class T>
void test_is_not_constructible()
{
@@ -146,6 +157,7 @@ int main()
test_is_constructible<int, const int> ();
test_is_constructible<A, int> ();
test_is_constructible<A, int, double> ();
+ test_is_constructible<A, int, long, double> ();
test_is_constructible<int&, int&> ();
test_is_not_constructible<A> ();
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
index 0bb373c96620..ac4664312f84 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
@@ -13,7 +13,7 @@
// These compilers have not implemented Core 2094 which makes volatile
// qualified types trivially copyable.
-// XFAIL: clang-3, clang-4, apple-clang, gcc
+// XFAIL: clang-3, clang-4, apple-clang-6, apple-clang-7, apple-clang-8, apple-clang-9.0, gcc
#include <type_traits>
#include <cassert>
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
new file mode 100644
index 000000000000..1e1e82b03d70
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <optional>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-5
+// UNSUPPORTED: libcpp-no-deduction-guides
+// Clang 5 will generate bad implicit deduction guides
+// Specifically, for the copy constructor.
+
+
+// template<class T>
+// optional(T) -> optional<T>;
+
+
+#include <optional>
+#include <cassert>
+
+struct A {};
+
+int main()
+{
+// Test the explicit deduction guides
+
+// Test the implicit deduction guides
+ {
+// optional()
+ std::optional opt; // expected-error-re {{{{declaration of variable 'opt' with deduced type 'std::optional' requires an initializer|no viable constructor or deduction guide for deduction of template arguments of 'optional'}}}}
+// clang-6 gives a bogus error here:
+// declaration of variable 'opt' with deduced type 'std::optional' requires an initializer
+// clang-7 (and later) give a better message:
+// no viable constructor or deduction guide for deduction of template arguments of 'optional'
+// So we check for one or the other.
+ }
+
+ {
+// optional(nullopt_t)
+ std::optional opt(std::nullopt); // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with nullopt_t is ill-formed"}}
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp
new file mode 100644
index 000000000000..6ce35a489d43
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <optional>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: clang-5, apple-clang-9
+// UNSUPPORTED: libcpp-no-deduction-guides
+// Clang 5 will generate bad implicit deduction guides
+// Specifically, for the copy constructor.
+
+
+// template<class T>
+// optional(T) -> optional<T>;
+
+
+#include <optional>
+#include <cassert>
+
+struct A {};
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+// optional(T)
+ std::optional opt(5);
+ static_assert(std::is_same_v<decltype(opt), std::optional<int>>, "");
+ assert(static_cast<bool>(opt));
+ assert(*opt == 5);
+ }
+
+ {
+// optional(T)
+ std::optional opt(A{});
+ static_assert(std::is_same_v<decltype(opt), std::optional<A>>, "");
+ assert(static_cast<bool>(opt));
+ }
+
+// Test the implicit deduction guides
+ {
+// optional(optional);
+ std::optional<char> source('A');
+ std::optional opt(source);
+ static_assert(std::is_same_v<decltype(opt), std::optional<char>>, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(source));
+ assert(*opt == *source);
+ }
+}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
index 78446976431e..457df5602850 100644
--- a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
@@ -1,3 +1,4 @@
+// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
@@ -11,21 +12,80 @@
// <tuple>
-// Test the diagnostics libc++ generates for invalid reference binding.
-// Libc++ attempts to diagnose the following cases:
-// * Constructing an lvalue reference from an rvalue.
-// * Constructing an rvalue reference from an lvalue.
+// See llvm.org/PR20855
#include <tuple>
#include <string>
-#include <functional>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary)
+# define ASSERT_REFERENCE_BINDS_TEMPORARY(...) static_assert(__reference_binds_to_temporary(__VA_ARGS__), "")
+# define ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(...) static_assert(!__reference_binds_to_temporary(__VA_ARGS__), "")
+#else
+# define ASSERT_REFERENCE_BINDS_TEMPORARY(...) static_assert(true, "")
+# define ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(...) static_assert(true, "")
+#endif
+
+template <class Tp>
+struct ConvertsTo {
+ using RawTp = typename std::remove_cv< typename std::remove_reference<Tp>::type>::type;
+
+ operator Tp() const {
+ return static_cast<Tp>(value);
+ }
+
+ mutable RawTp value;
+};
+
+struct Base {};
+struct Derived : Base {};
+
+
+static_assert(std::is_same<decltype("abc"), decltype(("abc"))>::value, "");
+ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, decltype("abc"));
+ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, decltype(("abc")));
+ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, const char*&&);
+
+ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(int&, const ConvertsTo<int&>&);
+ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(const int&, ConvertsTo<int&>&);
+ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(Base&, Derived&);
+
static_assert(std::is_constructible<int&, std::reference_wrapper<int>>::value, "");
static_assert(std::is_constructible<int const&, std::reference_wrapper<int>>::value, "");
+template <class T> struct CannotDeduce {
+ using type = T;
+};
-int main() {
+template <class ...Args>
+void F(typename CannotDeduce<std::tuple<Args...>>::type const&) {}
+
+void compile_tests() {
+ {
+ F<int, int const&>(std::make_tuple(42, 42));
+ }
+ {
+ F<int, int const&>(std::make_tuple<const int&, const int&>(42, 42));
+ std::tuple<int, int const&> t(std::make_tuple<const int&, const int&>(42, 42));
+ }
+ {
+ auto fn = &F<int, std::string const&>;
+ fn(std::tuple<int, std::string const&>(42, std::string("a")));
+ fn(std::make_tuple(42, std::string("a")));
+ }
+ {
+ Derived d;
+ std::tuple<Base&, Base const&> t(d, d);
+ }
+ {
+ ConvertsTo<int&> ct;
+ std::tuple<int, int&> t(42, ct);
+ }
+}
+
+void allocator_tests() {
std::allocator<void> alloc;
int x = 42;
{
@@ -69,3 +129,9 @@ int main() {
assert(&std::get<0>(t4) == &x);
}
}
+
+
+int main() {
+ compile_tests();
+ allocator_tests();
+}
diff --git a/test/std/utilities/utility/exchange/exchange.pass.cpp b/test/std/utilities/utility/exchange/exchange.pass.cpp
index 2d01d6c8c8af..1a5007ea41fb 100644
--- a/test/std/utilities/utility/exchange/exchange.pass.cpp
+++ b/test/std/utilities/utility/exchange/exchange.pass.cpp
@@ -8,14 +8,38 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// utilities
+// <utility>
// exchange
+// template<class T, class U=T>
+// constexpr T // constexpr after C++17
+// exchange(T& obj, U&& new_value);
+
#include <utility>
#include <cassert>
#include <string>
+#include "test_macros.h"
+
+#if TEST_STD_VER > 17
+TEST_CONSTEXPR bool test_constexpr() {
+ int v = 12;
+
+ if (12 != std::exchange(v,23) || v != 23)
+ return false;
+
+ if (23 != std::exchange(v,static_cast<short>(67)) || v != 67)
+ return false;
+
+ if (67 != std::exchange<int, short>(v, {}) || v != 0)
+ return false;
+ return true;
+ }
+#endif
+
+
+
int main()
{
{
@@ -53,4 +77,8 @@ int main()
assert ( std::exchange ( s3, "" ) == s2 );
assert ( s3.size () == 0 );
}
+
+#if TEST_STD_VER > 17
+ static_assert(test_constexpr());
+#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp
index 132443f66a7c..90722c393c68 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp
@@ -16,6 +16,11 @@
#include <utility>
#include <cassert>
+#include "test_macros.h"
+#if TEST_STD_VER >= 11
+#include "archetypes.hpp"
+#endif
+
int main()
{
{
@@ -27,4 +32,21 @@ int main()
assert(p2.first == 3);
assert(p2.second == 4);
}
+#if TEST_STD_VER >= 11
+ {
+ using C = TestTypes::TestType;
+ using P = std::pair<int, C>;
+ using T = std::pair<long, C>;
+ const T t(42, -42);
+ P p(101, 101);
+ C::reset_constructors();
+ p = t;
+ assert(C::constructed == 0);
+ assert(C::assigned == 1);
+ assert(C::copy_assigned == 1);
+ assert(C::move_assigned == 0);
+ assert(p.first == 42);
+ assert(p.second.value == -42);
+ }
+#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
index 38089200e4da..f02e24b24140 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
@@ -49,7 +49,7 @@ int CountAssign::moved = 0;
int main()
{
{
- typedef std::pair<std::unique_ptr<int>, short> P;
+ typedef std::pair<std::unique_ptr<int>, int> P;
P p1(std::unique_ptr<int>(new int(3)), 4);
P p2;
p2 = std::move(p1);
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp
index 76dfc3f65a23..b7a89a84460d 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp
@@ -18,6 +18,7 @@
#include <utility>
#include <memory>
#include <cassert>
+#include <archetypes.hpp>
struct Base
{
@@ -40,4 +41,19 @@ int main()
assert(p2.first == nullptr);
assert(p2.second == 4);
}
+ {
+ using C = TestTypes::TestType;
+ using P = std::pair<int, C>;
+ using T = std::pair<long, C>;
+ T t(42, -42);
+ P p(101, 101);
+ C::reset_constructors();
+ p = std::move(t);
+ assert(C::constructed == 0);
+ assert(C::assigned == 1);
+ assert(C::copy_assigned == 0);
+ assert(C::move_assigned == 1);
+ assert(p.first == 42);
+ assert(p.second.value == -42);
+ }
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
index 715b65537761..d2cb6b10984e 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
@@ -57,7 +57,7 @@ struct ImplicitT {
int main()
{
{
- typedef std::pair<int, short> P1;
+ typedef std::pair<int, int> P1;
typedef std::pair<double, long> P2;
const P1 p1(3, 4);
const P2 p2 = p1;
@@ -154,7 +154,7 @@ int main()
}
#if TEST_STD_VER > 11
{
- typedef std::pair<int, short> P1;
+ typedef std::pair<int, int> P1;
typedef std::pair<double, long> P2;
constexpr P1 p1(3, 4);
constexpr P2 p2 = p1;
diff --git a/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
index f5d3bb621deb..7e40bed21820 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
@@ -67,7 +67,7 @@ struct ImplicitT {
int main()
{
{
- typedef std::pair<std::unique_ptr<Derived>, short> P1;
+ typedef std::pair<std::unique_ptr<Derived>, int> P1;
typedef std::pair<std::unique_ptr<Base>, long> P2;
P1 p1(std::unique_ptr<Derived>(), 4);
P2 p2 = std::move(p1);
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
index 608cdf9d6efb..9d0bf55fb538 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
@@ -73,6 +73,12 @@ void test_ctor_sfinae() {
!std::is_constructible<V, std::in_place_index_t<2>, IL>::value, "");
static_assert(!test_convertible<V, std::in_place_index_t<2>, IL>(), "");
}
+ { // index not in variant
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_index_t<3>, IL>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<3>, IL>(), "");
+ }
}
void test_ctor_basic() {
diff --git a/test/support/Counter.h b/test/support/Counter.h
index 602f35f70671..4a658c58c064 100644
--- a/test/support/Counter.h
+++ b/test/support/Counter.h
@@ -45,8 +45,10 @@ namespace std {
template <class T>
struct hash<Counter<T> >
- : public std::unary_function<Counter<T>, std::size_t>
{
+ typedef Counter<T> argument_type;
+ typedef std::size_t result_type;
+
std::size_t operator()(const Counter<T>& x) const {return std::hash<T>(x.get());}
};
}
diff --git a/test/support/MoveOnly.h b/test/support/MoveOnly.h
index 4afa8aef7104..2eba8e7428af 100644
--- a/test/support/MoveOnly.h
+++ b/test/support/MoveOnly.h
@@ -19,7 +19,6 @@
class MoveOnly
{
- friend class MoveOnly2;
MoveOnly(const MoveOnly&);
MoveOnly& operator=(const MoveOnly&);
@@ -35,6 +34,8 @@ public:
bool operator==(const MoveOnly& x) const {return data_ == x.data_;}
bool operator< (const MoveOnly& x) const {return data_ < x.data_;}
+ MoveOnly operator+(const MoveOnly& x) const { return MoveOnly{data_ + x.data_}; }
+ MoveOnly operator*(const MoveOnly& x) const { return MoveOnly{data_ * x.data_}; }
};
namespace std {
diff --git a/test/support/count_new.hpp b/test/support/count_new.hpp
index c001c0340fa2..e3111e7a58f4 100644
--- a/test/support/count_new.hpp
+++ b/test/support/count_new.hpp
@@ -59,12 +59,20 @@ public:
int outstanding_new;
int new_called;
int delete_called;
+ int aligned_new_called;
+ int aligned_delete_called;
std::size_t last_new_size;
+ std::size_t last_new_align;
+ std::size_t last_delete_align;
int outstanding_array_new;
int new_array_called;
int delete_array_called;
+ int aligned_new_array_called;
+ int aligned_delete_array_called;
std::size_t last_new_array_size;
+ std::size_t last_new_array_align;
+ std::size_t last_delete_array_align;
public:
void newCalled(std::size_t s)
@@ -82,6 +90,12 @@ public:
last_new_size = s;
}
+ void alignedNewCalled(std::size_t s, std::size_t a) {
+ newCalled(s);
+ ++aligned_new_called;
+ last_new_align = a;
+ }
+
void deleteCalled(void * p)
{
assert(p);
@@ -89,6 +103,12 @@ public:
++delete_called;
}
+ void alignedDeleteCalled(void *p, std::size_t a) {
+ deleteCalled(p);
+ ++aligned_delete_called;
+ last_delete_align = a;
+ }
+
void newArrayCalled(std::size_t s)
{
assert(disable_allocations == false);
@@ -104,6 +124,12 @@ public:
last_new_array_size = s;
}
+ void alignedNewArrayCalled(std::size_t s, std::size_t a) {
+ newArrayCalled(s);
+ ++aligned_new_array_called;
+ last_new_array_align = a;
+ }
+
void deleteArrayCalled(void * p)
{
assert(p);
@@ -111,6 +137,12 @@ public:
++delete_array_called;
}
+ void alignedDeleteArrayCalled(void * p, std::size_t a) {
+ deleteArrayCalled(p);
+ ++aligned_delete_array_called;
+ last_delete_array_align = a;
+ }
+
void disableAllocations()
{
disable_allocations = true;
@@ -121,7 +153,6 @@ public:
disable_allocations = false;
}
-
void reset()
{
disable_allocations = false;
@@ -130,12 +161,18 @@ public:
outstanding_new = 0;
new_called = 0;
delete_called = 0;
+ aligned_new_called = 0;
+ aligned_delete_called = 0;
last_new_size = 0;
+ last_new_align = 0;
outstanding_array_new = 0;
new_array_called = 0;
delete_array_called = 0;
+ aligned_new_array_called = 0;
+ aligned_delete_array_called = 0;
last_new_array_size = 0;
+ last_new_array_align = 0;
}
public:
@@ -174,6 +211,31 @@ public:
return disable_checking || n != delete_called;
}
+ bool checkAlignedNewCalledEq(int n) const
+ {
+ return disable_checking || n == aligned_new_called;
+ }
+
+ bool checkAlignedNewCalledNotEq(int n) const
+ {
+ return disable_checking || n != aligned_new_called;
+ }
+
+ bool checkAlignedNewCalledGreaterThan(int n) const
+ {
+ return disable_checking || aligned_new_called > n;
+ }
+
+ bool checkAlignedDeleteCalledEq(int n) const
+ {
+ return disable_checking || n == aligned_delete_called;
+ }
+
+ bool checkAlignedDeleteCalledNotEq(int n) const
+ {
+ return disable_checking || n != aligned_delete_called;
+ }
+
bool checkLastNewSizeEq(std::size_t n) const
{
return disable_checking || n == last_new_size;
@@ -184,6 +246,26 @@ public:
return disable_checking || n != last_new_size;
}
+ bool checkLastNewAlignEq(std::size_t n) const
+ {
+ return disable_checking || n == last_new_align;
+ }
+
+ bool checkLastNewAlignNotEq(std::size_t n) const
+ {
+ return disable_checking || n != last_new_align;
+ }
+
+ bool checkLastDeleteAlignEq(std::size_t n) const
+ {
+ return disable_checking || n == last_delete_align;
+ }
+
+ bool checkLastDeleteAlignNotEq(std::size_t n) const
+ {
+ return disable_checking || n != last_delete_align;
+ }
+
bool checkOutstandingArrayNewEq(int n) const
{
return disable_checking || n == outstanding_array_new;
@@ -214,6 +296,31 @@ public:
return disable_checking || n != delete_array_called;
}
+ bool checkAlignedNewArrayCalledEq(int n) const
+ {
+ return disable_checking || n == aligned_new_array_called;
+ }
+
+ bool checkAlignedNewArrayCalledNotEq(int n) const
+ {
+ return disable_checking || n != aligned_new_array_called;
+ }
+
+ bool checkAlignedNewArrayCalledGreaterThan(int n) const
+ {
+ return disable_checking || aligned_new_array_called > n;
+ }
+
+ bool checkAlignedDeleteArrayCalledEq(int n) const
+ {
+ return disable_checking || n == aligned_delete_array_called;
+ }
+
+ bool checkAlignedDeleteArrayCalledNotEq(int n) const
+ {
+ return disable_checking || n != aligned_delete_array_called;
+ }
+
bool checkLastNewArraySizeEq(std::size_t n) const
{
return disable_checking || n == last_new_array_size;
@@ -223,6 +330,16 @@ public:
{
return disable_checking || n != last_new_array_size;
}
+
+ bool checkLastNewArrayAlignEq(std::size_t n) const
+ {
+ return disable_checking || n == last_new_array_align;
+ }
+
+ bool checkLastNewArrayAlignNotEq(std::size_t n) const
+ {
+ return disable_checking || n != last_new_array_align;
+ }
};
#ifdef DISABLE_NEW_COUNT
@@ -254,22 +371,65 @@ void operator delete(void* p) TEST_NOEXCEPT
std::free(p);
}
-
void* operator new[](std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
getGlobalMemCounter()->newArrayCalled(s);
return operator new(s);
}
-
void operator delete[](void* p) TEST_NOEXCEPT
{
getGlobalMemCounter()->deleteArrayCalled(p);
operator delete(p);
}
-#endif // DISABLE_NEW_COUNT
+#ifndef TEST_HAS_NO_ALIGNED_ALLOCATION
+#if defined(_LIBCPP_MSVCRT_LIKE) || \
+ (!defined(_LIBCPP_VERSION) && defined(_WIN32))
+#define USE_ALIGNED_ALLOC
+#endif
+void* operator new(std::size_t s, std::align_val_t av) TEST_THROW_SPEC(std::bad_alloc) {
+ const std::size_t a = static_cast<std::size_t>(av);
+ getGlobalMemCounter()->alignedNewCalled(s, a);
+ void *ret;
+#ifdef USE_ALIGNED_ALLOC
+ ret = _aligned_malloc(s, a);
+#else
+ posix_memalign(&ret, a, s);
+#endif
+ if (ret == nullptr)
+ detail::throw_bad_alloc_helper();
+ return ret;
+}
+
+void operator delete(void *p, std::align_val_t av) TEST_NOEXCEPT {
+ const std::size_t a = static_cast<std::size_t>(av);
+ getGlobalMemCounter()->alignedDeleteCalled(p, a);
+ if (p) {
+#ifdef USE_ALIGNED_ALLOC
+ ::_aligned_free(p);
+#else
+ ::free(p);
+#endif
+ }
+}
+
+void* operator new[](std::size_t s, std::align_val_t av) TEST_THROW_SPEC(std::bad_alloc) {
+ const std::size_t a = static_cast<std::size_t>(av);
+ getGlobalMemCounter()->alignedNewArrayCalled(s, a);
+ return operator new(s, av);
+}
+
+void operator delete[](void *p, std::align_val_t av) TEST_NOEXCEPT {
+ const std::size_t a = static_cast<std::size_t>(av);
+ getGlobalMemCounter()->alignedDeleteArrayCalled(p, a);
+ return operator delete(p, av);
+}
+
+#endif // TEST_HAS_NO_ALIGNED_ALLOCATION
+
+#endif // DISABLE_NEW_COUNT
struct DisableAllocationGuard {
explicit DisableAllocationGuard(bool disable = true) : m_disabled(disable)
@@ -295,7 +455,6 @@ private:
DisableAllocationGuard& operator=(DisableAllocationGuard const&);
};
-
struct RequireAllocationGuard {
explicit RequireAllocationGuard(std::size_t RequireAtLeast = 1)
: m_req_alloc(RequireAtLeast),
diff --git a/test/support/filesystem_include.hpp b/test/support/filesystem_include.hpp
new file mode 100644
index 000000000000..731532a7be98
--- /dev/null
+++ b/test/support/filesystem_include.hpp
@@ -0,0 +1,13 @@
+#ifndef TEST_SUPPORT_FILESYSTEM_INCLUDE_HPP
+#define TEST_SUPPORT_FILESYSTEM_INCLUDE_HPP
+
+#include <filesystem>
+#include "test_macros.h"
+
+#if defined(_LIBCPP_VERSION) && TEST_STD_VER < 17
+namespace fs = std::__fs::filesystem;
+#else
+namespace fs = std::filesystem;
+#endif
+
+#endif
diff --git a/test/support/filesystem_test_helper.hpp b/test/support/filesystem_test_helper.hpp
index 755be90351ff..f027928700b9 100644
--- a/test/support/filesystem_test_helper.hpp
+++ b/test/support/filesystem_test_helper.hpp
@@ -1,15 +1,19 @@
#ifndef FILESYSTEM_TEST_HELPER_HPP
#define FILESYSTEM_TEST_HELPER_HPP
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <cassert>
#include <cstdio> // for printf
#include <string>
#include <fstream>
#include <random>
#include <chrono>
+#include <vector>
+#include <regex>
-namespace fs = std::experimental::filesystem;
+#include "test_macros.h"
+#include "rapid-cxx-test.hpp"
+#include "format_string.hpp"
// static test helpers
@@ -104,6 +108,20 @@ static const fs::path RecDirFollowSymlinksIterationList[] = {
#error LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER must be defined
#endif
+namespace random_utils {
+inline char to_hex(int ch) {
+ return ch < 10 ? static_cast<char>('0' + ch)
+ : static_cast<char>('a' + (ch - 10));
+}
+
+inline char random_hex_char() {
+ static std::mt19937 rd{std::random_device{}()};
+ static std::uniform_int_distribution<int> mrand{0, 15};
+ return to_hex(mrand(rd));
+}
+
+} // namespace random_utils
+
struct scoped_test_env
{
scoped_test_env() : test_root(random_env_path())
@@ -178,21 +196,11 @@ struct scoped_test_env
fs::path const test_root;
private:
- static char to_hex(int ch) {
- return ch < 10 ? static_cast<char>('0' + ch)
- : static_cast<char>('a' + (ch - 10));
- }
-
- static char random_hex_char() {
- static std::mt19937 rd { std::random_device{}() };
- static std::uniform_int_distribution<int> mrand{0, 15};
- return to_hex( mrand(rd) );
- }
-
static std::string unique_path_suffix() {
std::string model = "test.%%%%%%";
for (auto & ch : model) {
- if (ch == '%') ch = random_hex_char();
+ if (ch == '%')
+ ch = random_utils::random_hex_char();
}
return model;
}
@@ -383,8 +391,39 @@ bool checkCollectionsEqualBackwards(
// We often need to test that the error_code was cleared if no error occurs
// this function returns an error_code which is set to an error that will
// never be returned by the filesystem functions.
-inline std::error_code GetTestEC() {
- return std::make_error_code(std::errc::address_family_not_supported);
+inline std::error_code GetTestEC(unsigned Idx = 0) {
+ using std::errc;
+ auto GetErrc = [&]() {
+ switch (Idx) {
+ case 0:
+ return errc::address_family_not_supported;
+ case 1:
+ return errc::address_not_available;
+ case 2:
+ return errc::address_in_use;
+ case 3:
+ return errc::argument_list_too_long;
+ default:
+ assert(false && "Idx out of range");
+ std::abort();
+ }
+ };
+ return std::make_error_code(GetErrc());
+}
+
+inline bool ErrorIsImp(const std::error_code& ec,
+ std::vector<std::errc> const& errors) {
+ for (auto errc : errors) {
+ if (ec == std::make_error_code(errc))
+ return true;
+ }
+ return false;
+}
+
+template <class... ErrcT>
+inline bool ErrorIs(const std::error_code& ec, std::errc First, ErrcT... Rest) {
+ std::vector<std::errc> errors = {First, Rest...};
+ return ErrorIsImp(ec, errors);
}
// Provide our own Sleep routine since std::this_thread::sleep_for is not
@@ -401,4 +440,82 @@ void SleepFor(std::chrono::seconds dur) {
;
}
+inline bool PathEq(fs::path const& LHS, fs::path const& RHS) {
+ return LHS.native() == RHS.native();
+}
+
+struct ExceptionChecker {
+ std::errc expected_err;
+ fs::path expected_path1;
+ fs::path expected_path2;
+ unsigned num_paths;
+ const char* func_name;
+ std::string opt_message;
+
+ explicit ExceptionChecker(std::errc first_err, const char* func_name,
+ std::string opt_msg = {})
+ : expected_err{first_err}, num_paths(0), func_name(func_name),
+ opt_message(opt_msg) {}
+ explicit ExceptionChecker(fs::path p, std::errc first_err,
+ const char* func_name, std::string opt_msg = {})
+ : expected_err(first_err), expected_path1(p), num_paths(1),
+ func_name(func_name), opt_message(opt_msg) {}
+
+ explicit ExceptionChecker(fs::path p1, fs::path p2, std::errc first_err,
+ const char* func_name, std::string opt_msg = {})
+ : expected_err(first_err), expected_path1(p1), expected_path2(p2),
+ num_paths(2), func_name(func_name), opt_message(opt_msg) {}
+
+ void operator()(fs::filesystem_error const& Err) {
+ TEST_CHECK(ErrorIsImp(Err.code(), {expected_err}));
+ TEST_CHECK(Err.path1() == expected_path1);
+ TEST_CHECK(Err.path2() == expected_path2);
+ LIBCPP_ONLY(check_libcxx_string(Err));
+ }
+
+ void check_libcxx_string(fs::filesystem_error const& Err) {
+ std::string message = std::make_error_code(expected_err).message();
+
+ std::string additional_msg = "";
+ if (!opt_message.empty()) {
+ additional_msg = opt_message + ": ";
+ }
+ auto transform_path = [](const fs::path& p) {
+ if (p.native().empty())
+ return "\"\"";
+ return p.c_str();
+ };
+ std::string format = [&]() -> std::string {
+ switch (num_paths) {
+ case 0:
+ return format_string("filesystem error: in %s: %s%s", func_name,
+ additional_msg, message);
+ case 1:
+ return format_string("filesystem error: in %s: %s%s [%s]", func_name,
+ additional_msg, message,
+ transform_path(expected_path1));
+ case 2:
+ return format_string("filesystem error: in %s: %s%s [%s] [%s]",
+ func_name, additional_msg, message,
+ transform_path(expected_path1),
+ transform_path(expected_path2));
+ default:
+ TEST_CHECK(false && "unexpected case");
+ return "";
+ }
+ }();
+ TEST_CHECK(format == Err.what());
+ if (format != Err.what()) {
+ fprintf(stderr,
+ "filesystem_error::what() does not match expected output:\n");
+ fprintf(stderr, " expected: \"%s\"\n", format.c_str());
+ fprintf(stderr, " actual: \"%s\"\n\n", Err.what());
+ }
+ }
+
+ ExceptionChecker(ExceptionChecker const&) = delete;
+ ExceptionChecker& operator=(ExceptionChecker const&) = delete;
+
+};
+
#endif /* FILESYSTEM_TEST_HELPER_HPP */
diff --git a/test/support/format_string.hpp b/test/support/format_string.hpp
new file mode 100644
index 000000000000..44dc30f551d1
--- /dev/null
+++ b/test/support/format_string.hpp
@@ -0,0 +1,71 @@
+#ifndef TEST_SUPPORT_FORMAT_STRING_HPP
+#define TEST_SUPPORT_FORMAT_STRING_HPP
+
+#include <cstdio>
+#include <string>
+#include <memory>
+#include <array>
+#include <cstdarg>
+
+namespace format_string_detail {
+inline std::string format_string_imp(const char* msg, ...) {
+ // we might need a second shot at this, so pre-emptivly make a copy
+ struct GuardVAList {
+ va_list& xtarget;
+ bool active;
+ GuardVAList(va_list& val) : xtarget(val), active(true) {}
+
+ void clear() {
+ if (active)
+ va_end(xtarget);
+ active = false;
+ }
+ ~GuardVAList() {
+ if (active)
+ va_end(xtarget);
+ }
+ };
+ va_list args;
+ va_start(args, msg);
+ GuardVAList args_guard(args);
+
+ va_list args_cp;
+ va_copy(args_cp, args);
+ GuardVAList args_copy_guard(args_cp);
+
+ std::array<char, 256> local_buff;
+ std::size_t size = local_buff.size();
+ auto ret = ::vsnprintf(local_buff.data(), size, msg, args_cp);
+
+ args_copy_guard.clear();
+
+ // handle empty expansion
+ if (ret == 0)
+ return std::string{};
+ if (static_cast<std::size_t>(ret) < size)
+ return std::string(local_buff.data());
+
+ // we did not provide a long enough buffer on our first attempt.
+ // add 1 to size to account for null-byte in size cast to prevent overflow
+ size = static_cast<std::size_t>(ret) + 1;
+ auto buff_ptr = std::unique_ptr<char[]>(new char[size]);
+ ret = ::vsnprintf(buff_ptr.get(), size, msg, args);
+ return std::string(buff_ptr.get());
+}
+
+const char* unwrap(std::string& s) { return s.c_str(); }
+template <class Arg>
+Arg const& unwrap(Arg& a) {
+ static_assert(!std::is_class<Arg>::value, "cannot pass class here");
+ return a;
+}
+
+} // namespace format_string_detail
+
+template <class... Args>
+std::string format_string(const char* fmt, Args const&... args) {
+ return format_string_detail::format_string_imp(
+ fmt, format_string_detail::unwrap(const_cast<Args&>(args))...);
+}
+
+#endif // TEST_SUPPORT_FORMAT_STRING_HPP
diff --git a/test/support/msvc_stdlib_force_include.hpp b/test/support/msvc_stdlib_force_include.hpp
index 83120c7eb52b..f2ec35fd05b0 100644
--- a/test/support/msvc_stdlib_force_include.hpp
+++ b/test/support/msvc_stdlib_force_include.hpp
@@ -52,6 +52,9 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
#define _MSVC_HAS_FEATURE_memory_sanitizer 0
#define _MSVC_HAS_FEATURE_thread_sanitizer 0
+ #define __has_attribute(X) _MSVC_HAS_ATTRIBUTE_ ## X
+ #define _MSVC_HAS_ATTRIBUTE_vector_size 0
+
// Silence compiler warnings.
#pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
#pragma warning(disable: 4324) // structure was padded due to alignment specifier
@@ -70,9 +73,6 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
// atomic_is_lock_free.pass.cpp needs this VS 2015 Update 2 fix.
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
- // Silence warnings about raw pointers and other unchecked iterators.
- #define _SCL_SECURE_NO_WARNINGS
-
// Silence warnings about features that are deprecated in C++17.
#define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
#endif // _LIBCXX_IN_DEVCRT
diff --git a/test/support/platform_support.h b/test/support/platform_support.h
index 020cdbf98e20..eae79541d7dd 100644
--- a/test/support/platform_support.h
+++ b/test/support/platform_support.h
@@ -54,6 +54,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <codecvt>
+#include <locale>
#include <string>
#if defined(_WIN32) || defined(__MINGW32__)
#include <io.h> // _mktemp_s
@@ -97,6 +99,16 @@ std::string get_temp_file_name()
return Name;
#endif
}
+
+#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+inline
+std::wstring get_wide_temp_file_name()
+{
+ return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t> >().from_bytes(
+ get_temp_file_name());
+}
+#endif // _LIBCPP_HAS_OPEN_WITH_WCHAR
+
#endif // __CloudABI__
#endif // PLATFORM_SUPPORT_H
diff --git a/test/support/rapid-cxx-test.hpp b/test/support/rapid-cxx-test.hpp
index a25bda53109c..bf027407a16b 100644
--- a/test/support/rapid-cxx-test.hpp
+++ b/test/support/rapid-cxx-test.hpp
@@ -221,6 +221,24 @@ namespace Name \
} while (false)
#
+#define TEST_CHECK_THROW_RESULT(Except, Checker, ...) \
+ do { \
+ TEST_SET_CHECKPOINT(); \
+ ::rapid_cxx_test::test_outcome m_f(::rapid_cxx_test::failure_type::none, \
+ __FILE__, TEST_FUNC_NAME(), __LINE__, \
+ "TEST_CHECK_THROW_RESULT(" #Except \
+ "," #Checker "," #__VA_ARGS__ ")", \
+ ""); \
+ try { \
+ (static_cast<void>(__VA_ARGS__)); \
+ m_f.type = ::rapid_cxx_test::failure_type::check; \
+ } catch (Except const& Caught) { \
+ Checker(Caught); \
+ } \
+ ::rapid_cxx_test::get_reporter().report(m_f); \
+ } while (false)
+#
+
#else // TEST_HAS_NO_EXCEPTIONS
# define TEST_CHECK_NO_THROW(...) \
@@ -236,6 +254,7 @@ namespace Name \
#
#define TEST_CHECK_THROW(Except, ...) ((void)0)
+#define TEST_CHECK_THROW_RESULT(Except, Checker, ...) ((void)0)
#endif // TEST_HAS_NO_EXCEPTIONS
@@ -807,8 +826,8 @@ namespace rapid_cxx_test
get_reporter().test_case_end();
}
auto exit_code = get_reporter().failure_count() ? EXIT_FAILURE : EXIT_SUCCESS;
- if (exit_code == EXIT_FAILURE)
- get_reporter().print_summary(m_ts.name());
+ if (exit_code == EXIT_FAILURE || get_reporter().unsupported_count())
+ get_reporter().print_summary(m_ts.name());
return exit_code;
}
diff --git a/test/support/test_allocator.h b/test/support/test_allocator.h
index e77796b676e7..60f9a21b244d 100644
--- a/test/support/test_allocator.h
+++ b/test/support/test_allocator.h
@@ -36,12 +36,37 @@ public:
static int throw_after;
static int count;
static int alloc_count;
+ static int copied;
+ static int moved;
+ static int converted;
+
+ const static int destructed_value = -1;
+ const static int default_value = 0;
+ const static int moved_value = INT_MAX;
+
+ static void clear() {
+ assert(count == 0 && "clearing leaking allocator data?");
+ count = 0;
+ time_to_throw = 0;
+ alloc_count = 0;
+ throw_after = INT_MAX;
+ clear_ctor_counters();
+ }
+
+ static void clear_ctor_counters() {
+ copied = 0;
+ moved = 0;
+ converted = 0;
+ }
};
int test_alloc_base::count = 0;
int test_alloc_base::time_to_throw = 0;
int test_alloc_base::alloc_count = 0;
int test_alloc_base::throw_after = INT_MAX;
+int test_alloc_base::copied = 0;
+int test_alloc_base::moved = 0;
+int test_alloc_base::converted = 0;
template <class T>
class test_allocator
@@ -65,13 +90,35 @@ public:
test_allocator() TEST_NOEXCEPT : data_(0), id_(0) {++count;}
explicit test_allocator(int i, int id = 0) TEST_NOEXCEPT : data_(i), id_(id)
{++count;}
- test_allocator(const test_allocator& a) TEST_NOEXCEPT
- : data_(a.data_), id_(a.id_) {++count;}
- template <class U> test_allocator(const test_allocator<U>& a) TEST_NOEXCEPT
- : data_(a.data_), id_(a.id_) {++count;}
+ test_allocator(const test_allocator& a) TEST_NOEXCEPT : data_(a.data_),
+ id_(a.id_) {
+ ++count;
+ ++copied;
+ assert(a.data_ != destructed_value && a.id_ != destructed_value &&
+ "copying from destroyed allocator");
+ }
+#if TEST_STD_VER >= 11
+ test_allocator(test_allocator&& a) TEST_NOEXCEPT : data_(a.data_),
+ id_(a.id_) {
+ ++count;
+ ++moved;
+ assert(a.data_ != destructed_value && a.id_ != destructed_value &&
+ "moving from destroyed allocator");
+ a.data_ = moved_value;
+ a.id_ = moved_value;
+ }
+#endif
+ template <class U>
+ test_allocator(const test_allocator<U>& a) TEST_NOEXCEPT : data_(a.data_),
+ id_(a.id_) {
+ ++count;
+ ++converted;
+ }
~test_allocator() TEST_NOEXCEPT {
assert(data_ >= 0); assert(id_ >= 0);
- --count; data_ = -1; id_ = -1;
+ --count;
+ data_ = destructed_value;
+ id_ = destructed_value;
}
pointer address(reference x) const {return &x;}
const_pointer address(const_reference x) const {return &x;}
diff --git a/test/support/test_comparisons.h b/test/support/test_comparisons.h
new file mode 100644
index 000000000000..a3f8dd9f8c35
--- /dev/null
+++ b/test/support/test_comparisons.h
@@ -0,0 +1,175 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// A set of routines for testing the comparison operators of a type
+//
+// XXXX6 tests all six comparison operators
+// XXXX2 tests only op== and op!=
+//
+// AssertComparisonsXAreNoexcept static_asserts that the operations are all noexcept.
+// AssertComparisonsXReturnBool static_asserts that the operations return bool.
+// AssertComparisonsXConvertibleToBool static_asserts that the operations return something convertible to bool.
+
+
+#ifndef TEST_COMPARISONS_H
+#define TEST_COMPARISONS_H
+
+#include <type_traits>
+#include "test_macros.h"
+
+// Test all six comparison operations for sanity
+template <class T>
+TEST_CONSTEXPR_CXX14 bool testComparisons6(const T& t1, const T& t2, bool isEqual, bool isLess)
+{
+ if (isEqual)
+ {
+ if (!(t1 == t2)) return false;
+ if (!(t2 == t1)) return false;
+ if ( (t1 != t2)) return false;
+ if ( (t2 != t1)) return false;
+ if ( (t1 < t2)) return false;
+ if ( (t2 < t1)) return false;
+ if (!(t1 <= t2)) return false;
+ if (!(t2 <= t1)) return false;
+ if ( (t1 > t2)) return false;
+ if ( (t2 > t1)) return false;
+ if (!(t1 >= t2)) return false;
+ if (!(t2 >= t1)) return false;
+ }
+ else if (isLess)
+ {
+ if ( (t1 == t2)) return false;
+ if ( (t2 == t1)) return false;
+ if (!(t1 != t2)) return false;
+ if (!(t2 != t1)) return false;
+ if (!(t1 < t2)) return false;
+ if ( (t2 < t1)) return false;
+ if (!(t1 <= t2)) return false;
+ if ( (t2 <= t1)) return false;
+ if ( (t1 > t2)) return false;
+ if (!(t2 > t1)) return false;
+ if ( (t1 >= t2)) return false;
+ if (!(t2 >= t1)) return false;
+ }
+ else /* greater */
+ {
+ if ( (t1 == t2)) return false;
+ if ( (t2 == t1)) return false;
+ if (!(t1 != t2)) return false;
+ if (!(t2 != t1)) return false;
+ if ( (t1 < t2)) return false;
+ if (!(t2 < t1)) return false;
+ if ( (t1 <= t2)) return false;
+ if (!(t2 <= t1)) return false;
+ if (!(t1 > t2)) return false;
+ if ( (t2 > t1)) return false;
+ if (!(t1 >= t2)) return false;
+ if ( (t2 >= t1)) return false;
+ }
+
+ return true;
+}
+
+// Easy call when you can init from something already comparable.
+template <class T, class Param>
+TEST_CONSTEXPR_CXX14 bool testComparisons6Values(Param val1, Param val2)
+{
+ const bool isEqual = val1 == val2;
+ const bool isLess = val1 < val2;
+
+ return testComparisons6(T{val1}, T{val2}, isEqual, isLess);
+}
+
+template <class T>
+void AssertComparisons6AreNoexcept()
+{
+ ASSERT_NOEXCEPT(std::declval<const T&>() == std::declval<const T&>());
+ ASSERT_NOEXCEPT(std::declval<const T&>() != std::declval<const T&>());
+ ASSERT_NOEXCEPT(std::declval<const T&>() < std::declval<const T&>());
+ ASSERT_NOEXCEPT(std::declval<const T&>() <= std::declval<const T&>());
+ ASSERT_NOEXCEPT(std::declval<const T&>() > std::declval<const T&>());
+ ASSERT_NOEXCEPT(std::declval<const T&>() >= std::declval<const T&>());
+}
+
+template <class T>
+void AssertComparisons6ReturnBool()
+{
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() == std::declval<const T&>()), bool);
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() != std::declval<const T&>()), bool);
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() < std::declval<const T&>()), bool);
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() <= std::declval<const T&>()), bool);
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() > std::declval<const T&>()), bool);
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() >= std::declval<const T&>()), bool);
+}
+
+
+template <class T>
+void AssertComparisons6ConvertibleToBool()
+{
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() == std::declval<const T&>()), bool>::value), "");
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() != std::declval<const T&>()), bool>::value), "");
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() < std::declval<const T&>()), bool>::value), "");
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() <= std::declval<const T&>()), bool>::value), "");
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() > std::declval<const T&>()), bool>::value), "");
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() >= std::declval<const T&>()), bool>::value), "");
+}
+
+// Test all six comparison operations for sanity
+template <class T>
+TEST_CONSTEXPR_CXX14 bool testComparisons2(const T& t1, const T& t2, bool isEqual)
+{
+ if (isEqual)
+ {
+ if (!(t1 == t2)) return false;
+ if (!(t2 == t1)) return false;
+ if ( (t1 != t2)) return false;
+ if ( (t2 != t1)) return false;
+ }
+ else /* greater */
+ {
+ if ( (t1 == t2)) return false;
+ if ( (t2 == t1)) return false;
+ if (!(t1 != t2)) return false;
+ if (!(t2 != t1)) return false;
+ }
+
+ return true;
+}
+
+// Easy call when you can init from something already comparable.
+template <class T, class Param>
+TEST_CONSTEXPR_CXX14 bool testComparisons2Values(Param val1, Param val2)
+{
+ const bool isEqual = val1 == val2;
+
+ return testComparisons2(T{val1}, T{val2}, isEqual);
+}
+
+template <class T>
+void AssertComparisons2AreNoexcept()
+{
+ ASSERT_NOEXCEPT(std::declval<const T&>() == std::declval<const T&>());
+ ASSERT_NOEXCEPT(std::declval<const T&>() != std::declval<const T&>());
+}
+
+template <class T>
+void AssertComparisons2ReturnBool()
+{
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() == std::declval<const T&>()), bool);
+ ASSERT_SAME_TYPE(decltype(std::declval<const T&>() != std::declval<const T&>()), bool);
+}
+
+
+template <class T>
+void AssertComparisons2ConvertibleToBool()
+{
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() == std::declval<const T&>()), bool>::value), "");
+ static_assert((std::is_convertible<decltype(std::declval<const T&>() != std::declval<const T&>()), bool>::value), "");
+}
+
+#endif // TEST_COMPARISONS_H
diff --git a/test/support/test_macros.h b/test/support/test_macros.h
index 257875a35ed2..dbbfd53094e6 100644
--- a/test/support/test_macros.h
+++ b/test/support/test_macros.h
@@ -27,10 +27,8 @@
#define TEST_HAS_FEATURE(X) 0
#endif
-#ifdef __has_include
-#define TEST_HAS_INCLUDE(X) __has_include(X)
-#else
-#define TEST_HAS_INCLUDE(X) 0
+#ifndef __has_include
+#define __has_include(...) 0
#endif
#ifdef __has_extension
@@ -90,7 +88,7 @@
#endif
// Attempt to deduce GCC version
-#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE(<features.h>)
+#if defined(_LIBCPP_VERSION) && __has_include(<features.h>)
#include <features.h>
#define TEST_HAS_GLIBC
#define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor)
@@ -157,12 +155,23 @@
#define TEST_NORETURN [[noreturn]]
#endif
+#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || \
+ (!(TEST_STD_VER > 14 || \
+ (defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606L)))
+#define TEST_HAS_NO_ALIGNED_ALLOCATION
+#endif
+
#if defined(_LIBCPP_SAFE_STATIC)
#define TEST_SAFE_STATIC _LIBCPP_SAFE_STATIC
#else
#define TEST_SAFE_STATIC
#endif
+// FIXME: Fix this feature check when either (A) a compiler provides a complete
+// implementation, or (b) a feature check macro is specified
+#define TEST_HAS_NO_SPACESHIP_OPERATOR
+
+
#if TEST_STD_VER < 11
#define ASSERT_NOEXCEPT(...)
#define ASSERT_NOT_NOEXCEPT(...)
@@ -215,8 +224,18 @@ struct is_same<T, T> { enum {value = 1}; };
#if defined(__GNUC__) || defined(__clang__)
template <class Tp>
-inline void DoNotOptimize(Tp const& value) {
- asm volatile("" : : "g"(value) : "memory");
+inline
+void DoNotOptimize(Tp const& value) {
+ asm volatile("" : : "r,m"(value) : "memory");
+}
+
+template <class Tp>
+inline void DoNotOptimize(Tp& value) {
+#if defined(__clang__)
+ asm volatile("" : "+r,m"(value) : : "memory");
+#else
+ asm volatile("" : "+m,r"(value) : : "memory");
+#endif
}
#else
#include <intrin.h>
@@ -228,6 +247,7 @@ inline void DoNotOptimize(Tp const& value) {
}
#endif
+
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
diff --git a/test/support/test_memory_resource.hpp b/test/support/test_memory_resource.hpp
index b3472c8b6105..4b8167ba0393 100644
--- a/test/support/test_memory_resource.hpp
+++ b/test/support/test_memory_resource.hpp
@@ -28,7 +28,7 @@
// because it can't include <experimental/memory_resource>
template <>
struct TransformErasedTypeAlloc<std::experimental::erased_type> {
- using type = std::experimental::pmr::memory_resource*;
+ using type = std::experimental::pmr::polymorphic_allocator<int>;
};
template <class ProviderT, int = 0>
diff --git a/test/support/verbose_assert.h b/test/support/verbose_assert.h
new file mode 100644
index 000000000000..353e71cfc67e
--- /dev/null
+++ b/test/support/verbose_assert.h
@@ -0,0 +1,222 @@
+#ifndef TEST_SUPPORT_VERBOSE_ASSERT
+#define TEST_SUPPORT_VERBOSE_ASSERT
+
+#include <iostream>
+#include <cstdio>
+#include <sstream>
+#include <string>
+#include "test_macros.h"
+
+namespace verbose_assert {
+
+typedef std::basic_ostream<char>&(EndLType)(std::basic_ostream<char>&);
+
+template <class Stream, class Tp,
+ class = decltype(std::declval<Stream&>() << std::declval<Tp const&>())>
+std::true_type IsStreamableImp(int);
+template <class Stream, class Tp> std::false_type IsStreamableImp(long);
+
+template <class Stream, class Tp>
+struct IsStreamable : decltype(IsStreamableImp<Stream, Tp>(0)) {};
+
+template <class Tp, int ST = (IsStreamable<decltype(std::cerr), Tp>::value ? 1
+ : (IsStreamable<decltype(std::wcerr), Tp>::value ? 2 : -1))>
+struct SelectStream {
+ static_assert(ST == -1, "specialization required for ST != -1");
+ static void Print(Tp const&) { std::clog << "Value Not Streamable!\n"; }
+};
+
+template <class Tp>
+struct SelectStream<Tp, 1> {
+ static void Print(Tp const& val) { std::cerr << val; }
+};
+
+template <class Tp>
+struct SelectStream<Tp, 2> {
+ static void Print(Tp const& val) { std::wcerr << val; }
+};
+
+struct AssertData {
+ AssertData(const char* xcheck, const char* xfile, const char* xfunc,
+ unsigned long xline, bool xpassed = true)
+ : passed(xpassed), check(xcheck), file(xfile), func(xfunc), line(xline),
+ msg() {}
+
+ AssertData& SetFailed(std::string xmsg = std::string()) {
+ msg = xmsg;
+ passed = false;
+ return *this;
+ }
+
+ void PrintFailed() const {
+ std::fprintf(stderr, "%s:%lu %s: Assertion '%s' failed.\n", file, line,
+ func, check);
+ if (!msg.empty())
+ std::fprintf(stderr, "%s\n", msg.data());
+ }
+
+ bool passed;
+ const char* check;
+ const char* file;
+ const char* func;
+ unsigned long line;
+ std::string msg;
+};
+
+// AssertHandler is the class constructed by failing CHECK macros. AssertHandler
+// will log information about the failures and abort when it is destructed.
+class AssertHandler {
+public:
+ AssertHandler(AssertData const& Data)
+ : passed(Data.passed) {
+ if (!passed)
+ Data.PrintFailed();
+ }
+
+ ~AssertHandler() TEST_NOEXCEPT_FALSE {
+ if (!passed) {
+ error_log << std::endl;
+ std::abort();
+ }
+ }
+
+ class LogType {
+ friend class AssertHandler;
+
+ template <class Tp>
+ friend LogType& operator<<(LogType& log, Tp const& value) {
+ if (!log.is_disabled) {
+ SelectStream<Tp>::Print(value);
+ }
+ return log;
+ }
+
+ friend LogType& operator<<(LogType& log, EndLType* m) {
+ if (!log.is_disabled) {
+ SelectStream<EndLType*>::Print(m);
+ }
+ return log;
+ }
+
+ private:
+ LogType(bool disable) : is_disabled(disable) {}
+ bool is_disabled;
+
+ LogType(LogType const&);
+ LogType& operator=(LogType const&);
+ };
+
+ LogType& GetLog() {
+ if (passed)
+ return null_log;
+ return error_log;
+ }
+
+private:
+ static LogType null_log;
+ static LogType error_log;
+
+ AssertHandler& operator=(const AssertHandler&) = delete;
+ AssertHandler(const AssertHandler&) = delete;
+ AssertHandler() = delete;
+
+private:
+ bool passed;
+};
+
+AssertHandler::LogType AssertHandler::null_log(true);
+AssertHandler::LogType AssertHandler::error_log(false);
+
+template <class It1>
+std::string PrintRange(const char* Name, It1 F, It1 E) {
+ std::stringstream ss;
+ ss << " " << Name << " = [";
+ while (F != E) {
+ ss << *F;
+ ++F;
+ if (F != E)
+ ss << ", ";
+ }
+ ss << "]\n";
+ return ss.str();
+}
+
+template <class Tp, class Up>
+std::string PrintMismatch(Tp const& LHS, Up const& RHS, int Elem) {
+ std::stringstream ss;
+ ss << " Element " << Elem << " mismatched: `" << LHS << "` != `" << RHS
+ << "`!\n";
+ return ss.str();
+};
+
+struct EqualToComp {
+ template <class Tp, class Up>
+ bool operator()(Tp const& LHS, Up const& RHS) const {
+ return LHS == RHS;
+ }
+};
+
+template <class It1, class It2, class Comp>
+AssertData CheckCollectionsEqual(It1 F1, It1 E1, It2 F2, It2 E2,
+ AssertData Data, Comp C = EqualToComp()) {
+ const It1 F1Orig = F1;
+ const It2 F2Orig = F2;
+ bool Failed = false;
+ std::string ErrorMsg;
+ int Idx = 0;
+ while (F1 != E1 && F2 != E2) {
+ if (!(C(*F1, *F2))) {
+ ErrorMsg += PrintMismatch(*F1, *F2, Idx);
+ Failed = true;
+ break;
+ }
+ ++Idx;
+ ++F1;
+ ++F2;
+ }
+ if (!Failed && (F1 != E1 || F2 != E2)) {
+ ErrorMsg += " Ranges have different sizes!\n";
+ Failed = true;
+ }
+ if (Failed) {
+ ErrorMsg += PrintRange("LHS", F1Orig, E1);
+ ErrorMsg += PrintRange("RHS", F2Orig, E2);
+ Data.SetFailed(ErrorMsg);
+ }
+ return Data;
+}
+} // namespace verbose_assert
+
+#ifdef __GNUC__
+#define ASSERT_FN_NAME() __PRETTY_FUNCTION__
+#else
+#define ASSERT_FN_NAME() __func__
+#endif
+
+#define DISPLAY(...) " " #__VA_ARGS__ " = " << (__VA_ARGS__) << "\n"
+
+#define ASSERT(...) \
+ ::verbose_assert::AssertHandler(::verbose_assert::AssertData( \
+ #__VA_ARGS__, __FILE__, ASSERT_FN_NAME(), __LINE__,(__VA_ARGS__))).GetLog()
+
+#define ASSERT_EQ(LHS, RHS) \
+ ASSERT(LHS == RHS) << DISPLAY(LHS) << DISPLAY(RHS)
+#define ASSERT_NEQ(LHS, RHS) \
+ ASSERT(LHS != RHS) << DISPLAY(LHS) << DISPLAY(RHS)
+#define ASSERT_PRED(PRED, LHS, RHS) \
+ ASSERT(PRED(LHS, RHS)) << DISPLAY(LHS) << DISPLAY(RHS)
+
+#define ASSERT_COLLECTION_EQ_COMP(F1, E1, F2, E2, Comp) \
+ (::verbose_assert::AssertHandler( \
+ ::verbose_assert::CheckCollectionsEqual( \
+ F1, E1, F2, E2, \
+ ::verbose_assert::AssertData("CheckCollectionsEqual(" #F1 ", " #E1 \
+ ", " #F2 ", " #E2 ")", \
+ __FILE__, ASSERT_FN_NAME(), __LINE__), \
+ Comp)) \
+ .GetLog())
+
+#define ASSERT_COLLECTION_EQ(F1, E1, F2, E2) \
+ ASSERT_COLLECTION_EQ_COMP(F1, E1, F2, E2, ::verbose_assert::EqualToComp())
+
+#endif