From 5b08a8a43254ed30bd953e869b0fd9fc1e8b82d0 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 11 May 2010 21:36:01 +0000 Subject: Wiped out some non-ascii characters that snuck into the copyright. llvm-svn: 103516 --- libcxx/test/utilities/date.time/tested_elsewhere.pass.cpp | 2 +- .../utilities/function.objects/arithmetic.operations/divides.pass.cpp | 2 +- .../utilities/function.objects/arithmetic.operations/minus.pass.cpp | 2 +- .../utilities/function.objects/arithmetic.operations/modulus.pass.cpp | 2 +- .../function.objects/arithmetic.operations/multiplies.pass.cpp | 2 +- .../utilities/function.objects/arithmetic.operations/negate.pass.cpp | 2 +- .../test/utilities/function.objects/arithmetic.operations/plus.pass.cpp | 2 +- libcxx/test/utilities/function.objects/base/nothing_to_do.pass.cpp | 2 +- .../bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp | 2 +- .../bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp | 2 +- .../bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp | 2 +- .../bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp | 2 +- .../bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp | 2 +- .../bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp | 2 +- .../bind/func.bind/func.bind.place/placeholders.pass.cpp | 2 +- .../utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/function.objects/bind/nothing_to_do.pass.cpp | 2 +- .../test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp | 2 +- .../test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp | 2 +- .../test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp | 2 +- libcxx/test/utilities/function.objects/comparisons/equal_to.pass.cpp | 2 +- libcxx/test/utilities/function.objects/comparisons/greater.pass.cpp | 2 +- .../test/utilities/function.objects/comparisons/greater_equal.pass.cpp | 2 +- libcxx/test/utilities/function.objects/comparisons/less.pass.cpp | 2 +- libcxx/test/utilities/function.objects/comparisons/less_equal.pass.cpp | 2 +- .../test/utilities/function.objects/comparisons/not_equal_to.pass.cpp | 2 +- libcxx/test/utilities/function.objects/func.def/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/function.objects/func.memfn/member_data.fail.cpp | 2 +- libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp | 2 +- .../test/utilities/function.objects/func.memfn/member_function.pass.cpp | 2 +- .../function.objects/func.memfn/member_function_const.pass.cpp | 2 +- .../function.objects/func.memfn/member_function_const_volatile.pass.cpp | 2 +- .../function.objects/func.memfn/member_function_volatile.pass.cpp | 2 +- .../utilities/function.objects/func.require/binary_function.pass.cpp | 2 +- .../utilities/function.objects/func.require/unary_function.pass.cpp | 2 +- .../func.wrap/func.wrap.badcall/bad_function_call.pass.cpp | 2 +- .../func.wrap.badcall.const/bad_function_call_ctor.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp | 2 +- .../func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp | 2 +- .../func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.mod/assign_F_alloc.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp | 2 +- .../func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp | 2 +- .../func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp | 2 +- .../utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp | 2 +- libcxx/test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp | 2 +- .../function.pointer.adaptors/pointer_to_binary_function.pass.cpp | 2 +- .../function.pointer.adaptors/pointer_to_unary_function.pass.cpp | 2 +- .../function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp | 2 +- .../function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp | 2 +- .../utilities/function.objects/logical.operations/logical_and.pass.cpp | 2 +- .../utilities/function.objects/logical.operations/logical_not.pass.cpp | 2 +- .../utilities/function.objects/logical.operations/logical_or.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp | 2 +- .../member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp | 2 +- .../member.pointer.adaptors/const_mem_fun_ref1.pass.cpp | 2 +- .../member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp | 2 +- .../utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun1.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp | 2 +- .../function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp | 2 +- libcxx/test/utilities/function.objects/negators/binary_negate.pass.cpp | 2 +- libcxx/test/utilities/function.objects/negators/not1.pass.cpp | 2 +- libcxx/test/utilities/function.objects/negators/not2.pass.cpp | 2 +- libcxx/test/utilities/function.objects/negators/unary_negate.pass.cpp | 2 +- libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp | 2 +- .../function.objects/refwrap/refwrap.access/conversion.pass.cpp | 2 +- .../function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp | 2 +- .../utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp | 2 +- .../function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp | 2 +- .../function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp | 2 +- libcxx/test/utilities/function.objects/refwrap/type.pass.cpp | 2 +- libcxx/test/utilities/function.objects/refwrap/unary.pass.cpp | 2 +- libcxx/test/utilities/function.objects/refwrap/weak_result.pass.cpp | 2 +- libcxx/test/utilities/function.objects/unord.hash/floating.pass.cpp | 2 +- libcxx/test/utilities/function.objects/unord.hash/integral.pass.cpp | 2 +- libcxx/test/utilities/function.objects/unord.hash/pointer.pass.cpp | 2 +- libcxx/test/utilities/function.objects/version.pass.cpp | 2 +- .../memory/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp | 2 +- .../allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp | 2 +- .../allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp | 2 +- .../memory/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp | 2 +- .../memory/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp | 2 +- .../allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp | 2 +- .../allocator.adaptor.members/allocate_size_hint.pass.cpp | 2 +- .../allocator.adaptor/allocator.adaptor.members/construct.pass.cpp | 2 +- .../allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp | 2 +- .../memory/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp | 2 +- .../allocator.adaptor.members/inner_allocator.pass.cpp | 2 +- .../allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp | 2 +- .../allocator.adaptor.members/outer_allocator.pass.cpp | 2 +- .../select_on_container_copy_construction.pass.cpp | 2 +- .../allocator.adaptor.types/inner_allocator_type.pass.cpp | 2 +- .../propagate_on_container_copy_assignment.pass.cpp | 2 +- .../propagate_on_container_move_assignment.pass.cpp | 2 +- .../allocator.adaptor.types/propagate_on_container_swap.pass.cpp | 2 +- libcxx/test/utilities/memory/allocator.adaptor/types.pass.cpp | 2 +- libcxx/test/utilities/memory/allocator.tag/allocator_arg.pass.cpp | 2 +- .../memory/allocator.traits/allocator.traits.members/allocate.pass.cpp | 2 +- .../allocator.traits/allocator.traits.members/allocate_hint.pass.cpp | 2 +- .../memory/allocator.traits/allocator.traits.members/construct.pass.cpp | 2 +- .../allocator.traits/allocator.traits.members/deallocate.pass.cpp | 2 +- .../memory/allocator.traits/allocator.traits.members/destroy.pass.cpp | 2 +- .../memory/allocator.traits/allocator.traits.members/max_size.pass.cpp | 2 +- .../select_on_container_copy_construction.pass.cpp | 2 +- .../allocator.traits/allocator.traits.types/const_pointer.pass.cpp | 2 +- .../allocator.traits/allocator.traits.types/const_void_pointer.pass.cpp | 2 +- .../allocator.traits/allocator.traits.types/difference_type.pass.cpp | 2 +- .../memory/allocator.traits/allocator.traits.types/pointer.pass.cpp | 2 +- .../propagate_on_container_copy_assignment.pass.cpp | 2 +- .../propagate_on_container_move_assignment.pass.cpp | 2 +- .../allocator.traits.types/propagate_on_container_swap.pass.cpp | 2 +- .../allocator.traits/allocator.traits.types/rebind_alloc.pass.cpp | 2 +- .../memory/allocator.traits/allocator.traits.types/size_type.pass.cpp | 2 +- .../allocator.traits/allocator.traits.types/void_pointer.pass.cpp | 2 +- libcxx/test/utilities/memory/allocator.traits/allocator_type.pass.cpp | 2 +- libcxx/test/utilities/memory/allocator.traits/rebind_traits.pass.cpp | 2 +- libcxx/test/utilities/memory/allocator.traits/value_type.pass.cpp | 2 +- .../allocator.uses.construction/tested_elsewhere.pass.cpp | 2 +- .../memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp | 2 +- libcxx/test/utilities/memory/allocator.uses/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/memory/c.malloc/nothing_to_do.pass.cpp | 2 +- .../utilities/memory/default.allocator/allocator.globals/eq.pass.cpp | 2 +- .../memory/default.allocator/allocator.members/address.pass.cpp | 2 +- .../memory/default.allocator/allocator.members/allocate.pass.cpp | 2 +- .../memory/default.allocator/allocator.members/construct.pass.cpp | 2 +- .../memory/default.allocator/allocator.members/max_size.pass.cpp | 2 +- libcxx/test/utilities/memory/default.allocator/allocator_types.pass.cpp | 2 +- libcxx/test/utilities/memory/default.allocator/allocator_void.pass.cpp | 2 +- libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp | 2 +- libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp | 2 +- libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp | 2 +- .../memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp | 2 +- .../memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp | 2 +- .../memory/pointer.traits/pointer.traits.types/element_type.pass.cpp | 2 +- .../memory/pointer.traits/pointer.traits.types/rebind.pass.cpp | 2 +- libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp | 2 +- libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp | 2 +- libcxx/test/utilities/memory/ptr.align/align.pass.cpp | 2 +- .../test/utilities/memory/specialized.algorithms/nothing_to_do.pass.cpp | 2 +- .../specialized.algorithms/specialized.addressof/addressof.pass.cpp | 2 +- .../uninitialized.copy/uninitialized_copy.pass.cpp | 2 +- .../uninitialized.copy/uninitialized_copy_n.pass.cpp | 2 +- .../uninitialized.fill.n/uninitialized_fill_n.pass.cpp | 2 +- .../uninitialized.fill/uninitialized_fill.pass.cpp | 2 +- .../test/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp | 2 +- libcxx/test/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp | 2 +- libcxx/test/utilities/memory/unique.ptr/deleter.h | 2 +- libcxx/test/utilities/memory/unique.ptr/nothing_to_do.pass.cpp | 2 +- .../utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp | 2 +- .../unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp | 2 +- .../unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp | 2 +- .../unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp | 2 +- .../unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp | 2 +- .../unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp | 2 +- .../unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp | 2 +- .../unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp | 2 +- .../test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp | 2 +- .../test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp | 2 +- .../test/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp | 2 +- .../test/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp | 2 +- .../test/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp | 2 +- .../utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp | 2 +- .../utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp | 2 +- .../memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp | 2 +- .../unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp | 2 +- .../unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp | 2 +- .../unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp | 2 +- .../unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp | 2 +- .../unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp | 2 +- .../unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp | 2 +- .../unique.ptr.runtime.observers/dereference.fail.cpp | 2 +- .../unique.ptr.runtime.observers/explicit_bool.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp | 2 +- .../unique.ptr.runtime.observers/get_deleter.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp | 2 +- .../unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp | 2 +- .../utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp | 2 +- .../unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp | 2 +- .../unique.ptr.single.observers/explicit_bool.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.observers/get.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.observers/index.fail.cpp | 2 +- .../unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp | 2 +- libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp | 2 +- libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp | 2 +- .../test/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp | 2 +- .../utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp | 2 +- .../utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp | 2 +- .../utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp | 2 +- libcxx/test/utilities/memory/util.smartptr/nothing_to_do.pass.cpp | 2 +- .../util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp | 2 +- .../utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h | 2 +- .../utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.getdeleter/get_deleter.pass.cpp | 2 +- .../util.smartptr.shared.assign/auto_ptr_Y.pass.cpp | 2 +- .../util.smartptr.shared.assign/shared_ptr.pass.cpp | 2 +- .../util.smartptr.shared.assign/shared_ptr_Y.pass.cpp | 2 +- .../util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp | 2 +- .../util.smartptr.shared.assign/shared_ptr_rv.pass.cpp | 2 +- .../util.smartptr.shared.assign/unique_ptr_Y.pass.cpp | 2 +- .../util.smartptr.shared.cast/const_pointer_cast.pass.cpp | 2 +- .../util.smartptr.shared.cast/dynamic_pointer_cast.pass.cpp | 2 +- .../util.smartptr.shared.cast/static_pointer_cast.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.cmp/eq.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.cmp/lt.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/default.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/nullptr_t.pass.cpp | 2 +- .../util.smartptr.shared.const/nullptr_t_deleter.pass.cpp | 2 +- .../util.smartptr.shared.const/nullptr_t_deleter_allocator.pass.cpp | 2 +- .../nullptr_t_deleter_allocator_throw.pass.cpp | 2 +- .../util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp | 2 +- .../util.smartptr.shared.const/pointer_deleter.pass.cpp | 2 +- .../util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp | 2 +- .../util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp | 2 +- .../util.smartptr.shared.const/pointer_deleter_throw.pass.cpp | 2 +- .../util.smartptr.shared.const/pointer_throw.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/shared_ptr.pass.cpp | 2 +- .../util.smartptr.shared.const/shared_ptr_Y.pass.cpp | 2 +- .../util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp | 2 +- .../util.smartptr.shared.const/shared_ptr_pointer.pass.cpp | 2 +- .../util.smartptr.shared.const/shared_ptr_rv.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp | 2 +- .../util.smartptr.shared.create/allocate_shared.pass.cpp | 2 +- .../util.smartptr.shared.create/make_shared.pass.cpp | 2 +- .../util.smartptr.shared.dest/tested_elsewhere.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.io/io.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.mod/reset.pass.cpp | 2 +- .../util.smartptr.shared.mod/reset_pointer.pass.cpp | 2 +- .../util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp | 2 +- .../util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.mod/swap.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.obs/arrow.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.obs/dereference.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp | 2 +- .../util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp | 2 +- .../util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.obs/unique.pass.cpp | 2 +- .../util.smartptr.shared/util.smartptr.shared.spec/swap.pass.cpp | 2 +- .../utilities/memory/util.smartptr/util.smartptr.weak/types.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.assign/shared_ptr_Y.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.assign/weak_ptr_Y.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.const/default.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.const/shared_ptr_Y.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp | 2 +- .../util.smartptr.weak.dest/tested_elsewhere.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.mod/reset.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.mod/swap.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.obs/expired.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.obs/not_less_than.fail.cpp | 2 +- .../util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp | 2 +- .../util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp | 2 +- .../util.smartptr.weak/util.smartptr.weak.spec/swap.pass.cpp | 2 +- .../memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp | 2 +- libcxx/test/utilities/memory/version.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.rel/is_base_of.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.rel/is_convertible.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.rel/is_explicitly_convertible.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.rel/is_same.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.rqmts/nothing_to_do.pass.cpp | 2 +- .../meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp | 2 +- .../test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp | 2 +- .../utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.type.synop/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/array.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/enum.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.comp/floating_point.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/function.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/integral.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.comp/lvalue_ref.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.comp/member_function_pointer.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.comp/member_object_pointer.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/pointer.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/union.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.comp/void.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.prop/alignment_of.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.prop/extent.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.prop/has_move_assign.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_move_constructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp | 2 +- .../meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp | 2 +- .../meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_nothrow_move_assign.pass.cpp | 2 +- .../meta.unary/meta.unary.prop/has_nothrow_move_constructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp | 2 +- .../meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp | 2 +- .../meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_trivial_destructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_trivial_move_assign.pass.cpp | 2 +- .../meta.unary/meta.unary.prop/has_trivial_move_constructor.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp | 2 +- .../utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp | 2 +- .../meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp | 2 +- .../test/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/meta.unary.prop/rank.pass.cpp | 2 +- libcxx/test/utilities/meta/meta.unary/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/meta/version.pass.cpp | 2 +- libcxx/test/utilities/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp | 2 +- .../test/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.comparison/ratio_less.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.ratio/ratio.pass.cpp | 2 +- libcxx/test/utilities/ratio/ratio.ratio/ratio1.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.ratio/ratio2.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.ratio/ratio3.fail.cpp | 2 +- libcxx/test/utilities/ratio/ratio.si/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/ratio/typedefs.pass.cpp | 2 +- libcxx/test/utilities/ratio/version.pass.cpp | 2 +- .../test/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.cons/default.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.hash/bitset.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/all.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/any.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/count.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/flip_all.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/flip_one.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/index.pass.cpp | 2 +- .../test/utilities/template.bitset/bitset.members/index_const.pass.cpp | 2 +- .../test/utilities/template.bitset/bitset.members/left_shift.pass.cpp | 2 +- .../utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/none.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/not_all.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/reset_all.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/reset_one.pass.cpp | 2 +- .../test/utilities/template.bitset/bitset.members/right_shift.pass.cpp | 2 +- .../utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/set_all.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/set_one.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/size.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/test.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/to_string.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.operators/op_and.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.operators/op_not.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/bitset.operators/op_or.pass.cpp | 2 +- .../test/utilities/template.bitset/bitset.operators/stream_in.pass.cpp | 2 +- .../test/utilities/template.bitset/bitset.operators/stream_out.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/includes.pass.cpp | 2 +- libcxx/test/utilities/template.bitset/version.pass.cpp | 2 +- libcxx/test/utilities/time/hours.pass.cpp | 2 +- libcxx/test/utilities/time/microseconds.pass.cpp | 2 +- libcxx/test/utilities/time/milliseconds.pass.cpp | 2 +- libcxx/test/utilities/time/minutes.pass.cpp | 2 +- libcxx/test/utilities/time/nanoseconds.pass.cpp | 2 +- libcxx/test/utilities/time/seconds.pass.cpp | 2 +- libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp | 2 +- .../utilities/time/time.clock/time.clock.hires/consistency.pass.cpp | 2 +- libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp | 2 +- .../utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp | 2 +- libcxx/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp | 2 +- .../utilities/time/time.clock/time.clock.system/consistency.pass.cpp | 2 +- .../utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp | 2 +- libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp | 2 +- .../utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp | 2 +- .../test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp | 2 +- libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp | 2 +- libcxx/test/utilities/time/time.duration/duration.fail.cpp | 2 +- libcxx/test/utilities/time/time.duration/positive_num.fail.cpp | 2 +- libcxx/test/utilities/time/time.duration/ratio.fail.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_++.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_++int.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_+=.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_--.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_--int.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_-=.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp | 2 +- .../time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp | 2 +- .../time/time.duration/time.duration.arithmetic/op_times=.pass.cpp | 2 +- .../time/time.duration/time.duration.cast/duration_cast.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.cast/toduration.fail.cpp | 2 +- .../time/time.duration/time.duration.comparisons/op_equal.pass.cpp | 2 +- .../time/time.duration/time.duration.comparisons/op_less.pass.cpp | 2 +- .../time/time.duration/time.duration.cons/convert_exact.pass.cpp | 2 +- .../time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp | 2 +- .../time/time.duration/time.duration.cons/convert_inexact.fail.cpp | 2 +- .../time/time.duration/time.duration.cons/convert_inexact.pass.cpp | 2 +- .../time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.cons/default.pass.cpp | 2 +- .../test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp | 2 +- .../test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp | 2 +- .../test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp | 2 +- .../test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp | 2 +- .../test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp | 2 +- .../utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp | 2 +- .../time.duration/time.duration.nonmember/op_divide_duration.pass.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp | 2 +- .../time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp | 2 +- .../time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.special/max.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.special/min.pass.cpp | 2 +- .../utilities/time/time.duration/time.duration.special/zero.pass.cpp | 2 +- libcxx/test/utilities/time/time.duration/types.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/default_duration.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/duration.fail.cpp | 2 +- .../test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp | 2 +- .../test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp | 2 +- .../utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp | 2 +- .../test/utilities/time/time.point/time.point.cast/toduration.fail.cpp | 2 +- .../utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp | 2 +- .../utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp | 2 +- .../utilities/time/time.point/time.point.comparisons/op_less.fail.cpp | 2 +- .../utilities/time/time.point/time.point.comparisons/op_less.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp | 2 +- .../test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp | 2 +- .../time/time.point/time.point.nonmember/op_-duration.pass.cpp | 2 +- .../time/time.point/time.point.nonmember/op_-time_point.pass.cpp | 2 +- .../time/time.point/time.point.observer/tested_elsewhere.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp | 2 +- libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp | 2 +- libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp | 2 +- .../utilities/time/time.traits/time.traits.duration_values/max.pass.cpp | 2 +- .../utilities/time/time.traits/time.traits.duration_values/min.pass.cpp | 2 +- .../time/time.traits/time.traits.duration_values/zero.pass.cpp | 2 +- .../time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp | 2 +- .../time/time.traits/time.traits.specializations/duration.pass.cpp | 2 +- .../time/time.traits/time.traits.specializations/time_point.pass.cpp | 2 +- libcxx/test/utilities/time/version.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.general/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/empty_member.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.fail.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.fail.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move_pair.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types2.fail.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.fail.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.fail.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp | 2 +- .../test/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.range/begin.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp | 2 +- libcxx/test/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp | 2 +- .../utilities/tuple/tuple.tuple/tuple.traits/uses_allocator.pass.cpp | 2 +- libcxx/test/utilities/tuple/version.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.hash/hash.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.members/ctor.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.members/eq.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.members/hash_code.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.members/name.pass.cpp | 2 +- .../test/utilities/type.index/type.index.overview/copy_assign.pass.cpp | 2 +- libcxx/test/utilities/type.index/type.index.overview/copy_ctor.pass.cpp | 2 +- .../utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp | 2 +- libcxx/test/utilities/type.index/version.pass.cpp | 2 +- libcxx/test/utilities/utilities.general/nothing_to_do.pass.cpp | 2 +- .../utility.requirements/allocator.requirements/nothing_to_do.pass.cpp | 2 +- .../utility.requirements/hash.requirements/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/utility.requirements/nothing_to_do.pass.cpp | 2 +- .../nullablepointer.requirements/nothing_to_do.pass.cpp | 2 +- .../utility.requirements/swappable.requirements/nothing_to_do.pass.cpp | 2 +- .../utility.arg.requirements/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/utility/declval/declval.pass.cpp | 2 +- libcxx/test/utilities/utility/forward/forward.pass.cpp | 2 +- libcxx/test/utilities/utility/forward/forward1.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/forward2.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/forward3.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/forward4.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/forward5.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/forward6.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/move_copy.pass.cpp | 2 +- libcxx/test/utilities/utility/forward/move_if_noexcept.pass.cpp | 2 +- libcxx/test/utilities/utility/forward/move_only.pass.cpp | 2 +- libcxx/test/utilities/utility/forward/move_only1.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/move_only2.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/move_only3.fail.cpp | 2 +- libcxx/test/utilities/utility/forward/move_only4.fail.cpp | 2 +- libcxx/test/utilities/utility/operators/rel_ops.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.astuple/get_const.fail.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.astuple/get_const.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.astuple/tuple_size.pass.cpp | 2 +- .../utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.range/begin.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pair.range/end.pass.cpp | 2 +- .../test/utilities/utility/pairs/pairs.general/nothing_to_do.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/U_V.pass.cpp | 2 +- .../utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp | 2 +- .../test/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/comparison.pass.cpp | 2 +- .../utility/pairs/pairs.pair/const_first_const_second.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/default.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/make_pair.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/non_member_swap.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/swap.pass.cpp | 2 +- libcxx/test/utilities/utility/pairs/pairs.pair/types.pass.cpp | 2 +- libcxx/test/utilities/utility/utility.swap/swap.pass.cpp | 2 +- libcxx/test/utilities/utility/utility.swap/swap_array.pass.cpp | 2 +- libcxx/test/utilities/utility/version.pass.cpp | 2 +- 769 files changed, 769 insertions(+), 769 deletions(-) (limited to 'libcxx/test/utilities') diff --git a/libcxx/test/utilities/date.time/tested_elsewhere.pass.cpp b/libcxx/test/utilities/date.time/tested_elsewhere.pass.cpp index c9f667cc6f4..bdb4d3403ce 100644 --- a/libcxx/test/utilities/date.time/tested_elsewhere.pass.cpp +++ b/libcxx/test/utilities/date.time/tested_elsewhere.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include #include #ifndef NULL #error NULL not defined #endif #ifndef CLOCKS_PER_SEC #error CLOCKS_PER_SEC not defined #endif int main() { std::clock_t c = 0; std::size_t s = 0; std::time_t t = 0; std::tm tm = {0}; char str[3]; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include #include #ifndef NULL #error NULL not defined #endif #ifndef CLOCKS_PER_SEC #error CLOCKS_PER_SEC not defined #endif int main() { std::clock_t c = 0; std::size_t s = 0; std::time_t t = 0; std::tm tm = {0}; char str[3]; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/divides.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/divides.pass.cpp index 1b05252d9cb..c8528c2303f 100644 --- a/libcxx/test/utilities/function.objects/arithmetic.operations/divides.pass.cpp +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/divides.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // divides #include #include #include int main() { typedef std::divides F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 4) == 9); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // divides #include #include #include int main() { typedef std::divides F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 4) == 9); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/minus.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/minus.pass.cpp index 0667c9b39a0..e21d03f43ba 100644 --- a/libcxx/test/utilities/function.objects/arithmetic.operations/minus.pass.cpp +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/minus.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // minus #include #include #include int main() { typedef std::minus F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(3, 2) == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // minus #include #include #include int main() { typedef std::minus F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(3, 2) == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp index 4d8b4158ae0..39315696625 100644 --- a/libcxx/test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // modulus #include #include #include int main() { typedef std::modulus F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 8) == 4); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // modulus #include #include #include int main() { typedef std::modulus F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 8) == 4); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp index 4a92ef3bd18..f020cd56194 100644 --- a/libcxx/test/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // multiplies #include #include #include int main() { typedef std::multiplies F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(3, 2) == 6); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // multiplies #include #include #include int main() { typedef std::multiplies F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(3, 2) == 6); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/negate.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/negate.pass.cpp index 832e5b07659..59b56a3c62d 100644 --- a/libcxx/test/utilities/function.objects/arithmetic.operations/negate.pass.cpp +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/negate.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // negate #include #include #include int main() { typedef std::negate F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36) == -36); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // negate #include #include #include int main() { typedef std::negate F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36) == -36); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/plus.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/plus.pass.cpp index 6a6e07eb4a1..2e922d2d010 100644 --- a/libcxx/test/utilities/function.objects/arithmetic.operations/plus.pass.cpp +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/plus.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // plus #include #include #include int main() { typedef std::plus F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(3, 2) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // plus #include #include #include int main() { typedef std::plus F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(3, 2) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/base/nothing_to_do.pass.cpp b/libcxx/test/utilities/function.objects/base/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/function.objects/base/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/function.objects/base/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp index e93043efec3..28ec9d4b123 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include template void test(F f, R expected) { assert(f() == expected); } template void test_const(const F& f, R expected) { assert(f() == expected); } int f() {return 1;} struct A_int_0 { int operator()() {return 4;} int operator()() const {return 5;} }; int main() { test(std::bind(f), 1); test(std::bind(&f), 1); test(std::bind(A_int_0()), 4); test_const(std::bind(A_int_0()), 5); test(std::bind(f), 1); test(std::bind(&f), 1); test(std::bind(A_int_0()), 4); test_const(std::bind(A_int_0()), 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include template void test(F f, R expected) { assert(f() == expected); } template void test_const(const F& f, R expected) { assert(f() == expected); } int f() {return 1;} struct A_int_0 { int operator()() {return 4;} int operator()() const {return 5;} }; int main() { test(std::bind(f), 1); test(std::bind(&f), 1); test(std::bind(A_int_0()), 4); test_const(std::bind(A_int_0()), 5); test(std::bind(f), 1); test(std::bind(&f), 1); test(std::bind(A_int_0()), 4); test_const(std::bind(A_int_0()), 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp index 8f87a0d98f7..84afdea2b8c 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {count += 2;} }; void test_void_1() { using namespace std::placeholders; int save_count = count; // function { int i = 2; std::bind(f_void_1, _1)(i); assert(count == save_count + 2); save_count = count; } { int i = 2; std::bind(f_void_1, i)(); assert(count == save_count + 2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; int i = 3; std::bind(fp, _1)(i); assert(count == save_count+3); save_count = count; } { void (*fp)(int) = f_void_1; int i = 3; std::bind(fp, i)(); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; int i = 4; std::bind(a0, _1)(i); assert(count == save_count+4); save_count = count; } { A_void_1 a0; int i = 4; std::bind(a0, i)(); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; A_void_1 a; std::bind(fp, _1)(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; std::bind(fp, _1)(ap); assert(count == save_count+1); save_count = count; } { void (A_void_1::*fp)() = &A_void_1::mem1; A_void_1 a; std::bind(fp, a)(); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; std::bind(fp, ap)(); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; A_void_1 a; std::bind(fp, _1)(a); assert(count == save_count+2); save_count = count; A_void_1* ap = &a; std::bind(fp, _1)(ap); assert(count == save_count+2); save_count = count; } { void (A_void_1::*fp)() const = &A_void_1::mem2; A_void_1 a; std::bind(fp, a)(); assert(count == save_count+2); save_count = count; A_void_1* ap = &a; std::bind(fp, ap)(); assert(count == save_count+2); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { using namespace std::placeholders; // function { int i = 2; assert(std::bind(f_int_1, _1)(i) == 3); assert(std::bind(f_int_1, i)() == 3); } // function pointer { int (*fp)(int) = f_int_1; int i = 3; assert(std::bind(fp, _1)(i) == 4); assert(std::bind(fp, i)() == 4); } // functor { int i = 4; assert(std::bind(A_int_1(), _1)(i) == 3); assert(std::bind(A_int_1(), i)() == 3); } // member function pointer { A_int_1 a; assert(std::bind(&A_int_1::mem1, _1)(a) == 3); assert(std::bind(&A_int_1::mem1, a)() == 3); A_int_1* ap = &a; assert(std::bind(&A_int_1::mem1, _1)(ap) == 3); assert(std::bind(&A_int_1::mem1, ap)() == 3); } // const member function pointer { A_int_1 a; assert(std::bind(&A_int_1::mem2, _1)(A_int_1()) == 4); assert(std::bind(&A_int_1::mem2, A_int_1())() == 4); A_int_1* ap = &a; assert(std::bind(&A_int_1::mem2, _1)(ap) == 4); assert(std::bind(&A_int_1::mem2, ap)() == 4); } // member data pointer { A_int_1 a; assert(std::bind(&A_int_1::data_, _1)(a) == 5); assert(std::bind(&A_int_1::data_, a)() == 5); A_int_1* ap = &a; assert(std::bind(&A_int_1::data_, _1)(a) == 5); std::bind(&A_int_1::data_, _1)(a) = 6; assert(std::bind(&A_int_1::data_, _1)(a) == 6); assert(std::bind(&A_int_1::data_, _1)(ap) == 6); std::bind(&A_int_1::data_, _1)(ap) = 7; assert(std::bind(&A_int_1::data_, _1)(ap) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { using namespace std::placeholders; int save_count = count; // function { int i = 2; int j = 3; std::bind(f_void_2, _1, _2)(i, j); assert(count == save_count+5); save_count = count; std::bind(f_void_2, i, _1)(j); assert(count == save_count+5); save_count = count; std::bind(f_void_2, i, j)(); assert(count == save_count+5); save_count = count; } // member function pointer { int j = 3; std::bind(&A_void_2::mem1, _1, _2)(A_void_2(), j); assert(count == save_count+3); save_count = count; std::bind(&A_void_2::mem1, _2, _1)(j, A_void_2()); assert(count == save_count+3); save_count = count; } } int main() { test_void_1(); test_int_1(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {count += 2;} }; void test_void_1() { using namespace std::placeholders; int save_count = count; // function { int i = 2; std::bind(f_void_1, _1)(i); assert(count == save_count + 2); save_count = count; } { int i = 2; std::bind(f_void_1, i)(); assert(count == save_count + 2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; int i = 3; std::bind(fp, _1)(i); assert(count == save_count+3); save_count = count; } { void (*fp)(int) = f_void_1; int i = 3; std::bind(fp, i)(); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; int i = 4; std::bind(a0, _1)(i); assert(count == save_count+4); save_count = count; } { A_void_1 a0; int i = 4; std::bind(a0, i)(); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; A_void_1 a; std::bind(fp, _1)(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; std::bind(fp, _1)(ap); assert(count == save_count+1); save_count = count; } { void (A_void_1::*fp)() = &A_void_1::mem1; A_void_1 a; std::bind(fp, a)(); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; std::bind(fp, ap)(); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; A_void_1 a; std::bind(fp, _1)(a); assert(count == save_count+2); save_count = count; A_void_1* ap = &a; std::bind(fp, _1)(ap); assert(count == save_count+2); save_count = count; } { void (A_void_1::*fp)() const = &A_void_1::mem2; A_void_1 a; std::bind(fp, a)(); assert(count == save_count+2); save_count = count; A_void_1* ap = &a; std::bind(fp, ap)(); assert(count == save_count+2); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { using namespace std::placeholders; // function { int i = 2; assert(std::bind(f_int_1, _1)(i) == 3); assert(std::bind(f_int_1, i)() == 3); } // function pointer { int (*fp)(int) = f_int_1; int i = 3; assert(std::bind(fp, _1)(i) == 4); assert(std::bind(fp, i)() == 4); } // functor { int i = 4; assert(std::bind(A_int_1(), _1)(i) == 3); assert(std::bind(A_int_1(), i)() == 3); } // member function pointer { A_int_1 a; assert(std::bind(&A_int_1::mem1, _1)(a) == 3); assert(std::bind(&A_int_1::mem1, a)() == 3); A_int_1* ap = &a; assert(std::bind(&A_int_1::mem1, _1)(ap) == 3); assert(std::bind(&A_int_1::mem1, ap)() == 3); } // const member function pointer { A_int_1 a; assert(std::bind(&A_int_1::mem2, _1)(A_int_1()) == 4); assert(std::bind(&A_int_1::mem2, A_int_1())() == 4); A_int_1* ap = &a; assert(std::bind(&A_int_1::mem2, _1)(ap) == 4); assert(std::bind(&A_int_1::mem2, ap)() == 4); } // member data pointer { A_int_1 a; assert(std::bind(&A_int_1::data_, _1)(a) == 5); assert(std::bind(&A_int_1::data_, a)() == 5); A_int_1* ap = &a; assert(std::bind(&A_int_1::data_, _1)(a) == 5); std::bind(&A_int_1::data_, _1)(a) = 6; assert(std::bind(&A_int_1::data_, _1)(a) == 6); assert(std::bind(&A_int_1::data_, _1)(ap) == 6); std::bind(&A_int_1::data_, _1)(ap) = 7; assert(std::bind(&A_int_1::data_, _1)(ap) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { using namespace std::placeholders; int save_count = count; // function { int i = 2; int j = 3; std::bind(f_void_2, _1, _2)(i, j); assert(count == save_count+5); save_count = count; std::bind(f_void_2, i, _1)(j); assert(count == save_count+5); save_count = count; std::bind(f_void_2, i, j)(); assert(count == save_count+5); save_count = count; } // member function pointer { int j = 3; std::bind(&A_void_2::mem1, _1, _2)(A_void_2(), j); assert(count == save_count+3); save_count = count; std::bind(&A_void_2::mem1, _2, _1)(j, A_void_2()); assert(count == save_count+3); save_count = count; } } int main() { test_void_1(); test_int_1(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp index 1340a0cc89f..508caee69c6 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {count += 2;} }; void test_void_1() { using namespace std::placeholders; int save_count = count; // function { std::bind(f_void_1, _1)(2); assert(count == save_count + 2); save_count = count; } { std::bind(f_void_1, 2)(); assert(count == save_count + 2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; std::bind(fp, _1)(3); assert(count == save_count+3); save_count = count; } { void (*fp)(int) = f_void_1; std::bind(fp, 3)(); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; std::bind(a0, _1)(4); assert(count == save_count+4); save_count = count; } { A_void_1 a0; std::bind(a0, 4)(); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; std::bind(fp, _1)(A_void_1()); assert(count == save_count+1); save_count = count; A_void_1 a; std::bind(fp, _1)(&a); assert(count == save_count+1); save_count = count; } { void (A_void_1::*fp)() = &A_void_1::mem1; std::bind(fp, A_void_1())(); assert(count == save_count+1); save_count = count; A_void_1 a; std::bind(fp, &a)(); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; std::bind(fp, _1)(A_void_1()); assert(count == save_count+2); save_count = count; A_void_1 a; std::bind(fp, _1)(&a); assert(count == save_count+2); save_count = count; } { void (A_void_1::*fp)() const = &A_void_1::mem2; std::bind(fp, A_void_1())(); assert(count == save_count+2); save_count = count; A_void_1 a; std::bind(fp, &a)(); assert(count == save_count+2); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { using namespace std::placeholders; // function { assert(std::bind(f_int_1, _1)(2) == 3); assert(std::bind(f_int_1, 2)() == 3); } // function pointer { int (*fp)(int) = f_int_1; assert(std::bind(fp, _1)(3) == 4); assert(std::bind(fp, 3)() == 4); } // functor { assert(std::bind(A_int_1(), _1)(4) == 3); assert(std::bind(A_int_1(), 4)() == 3); } // member function pointer { assert(std::bind(&A_int_1::mem1, _1)(A_int_1()) == 3); assert(std::bind(&A_int_1::mem1, A_int_1())() == 3); A_int_1 a; assert(std::bind(&A_int_1::mem1, _1)(&a) == 3); assert(std::bind(&A_int_1::mem1, &a)() == 3); } // const member function pointer { assert(std::bind(&A_int_1::mem2, _1)(A_int_1()) == 4); assert(std::bind(&A_int_1::mem2, A_int_1())() == 4); A_int_1 a; assert(std::bind(&A_int_1::mem2, _1)(&a) == 4); assert(std::bind(&A_int_1::mem2, &a)() == 4); } // member data pointer { assert(std::bind(&A_int_1::data_, _1)(A_int_1()) == 5); assert(std::bind(&A_int_1::data_, A_int_1())() == 5); A_int_1 a; assert(std::bind(&A_int_1::data_, _1)(a) == 5); std::bind(&A_int_1::data_, _1)(a) = 6; assert(std::bind(&A_int_1::data_, _1)(a) == 6); assert(std::bind(&A_int_1::data_, _1)(&a) == 6); std::bind(&A_int_1::data_, _1)(&a) = 7; assert(std::bind(&A_int_1::data_, _1)(&a) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { using namespace std::placeholders; int save_count = count; // function { std::bind(f_void_2, _1, _2)(2, 3); assert(count == save_count+5); save_count = count; std::bind(f_void_2, 2, _1)(3); assert(count == save_count+5); save_count = count; std::bind(f_void_2, 2, 3)(); assert(count == save_count+5); save_count = count; } // member function pointer { std::bind(&A_void_2::mem1, _1, _2)(A_void_2(), 3); assert(count == save_count+3); save_count = count; std::bind(&A_void_2::mem1, _2, _1)(3, A_void_2()); assert(count == save_count+3); save_count = count; } } int main() { test_void_1(); test_int_1(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {count += 2;} }; void test_void_1() { using namespace std::placeholders; int save_count = count; // function { std::bind(f_void_1, _1)(2); assert(count == save_count + 2); save_count = count; } { std::bind(f_void_1, 2)(); assert(count == save_count + 2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; std::bind(fp, _1)(3); assert(count == save_count+3); save_count = count; } { void (*fp)(int) = f_void_1; std::bind(fp, 3)(); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; std::bind(a0, _1)(4); assert(count == save_count+4); save_count = count; } { A_void_1 a0; std::bind(a0, 4)(); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; std::bind(fp, _1)(A_void_1()); assert(count == save_count+1); save_count = count; A_void_1 a; std::bind(fp, _1)(&a); assert(count == save_count+1); save_count = count; } { void (A_void_1::*fp)() = &A_void_1::mem1; std::bind(fp, A_void_1())(); assert(count == save_count+1); save_count = count; A_void_1 a; std::bind(fp, &a)(); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; std::bind(fp, _1)(A_void_1()); assert(count == save_count+2); save_count = count; A_void_1 a; std::bind(fp, _1)(&a); assert(count == save_count+2); save_count = count; } { void (A_void_1::*fp)() const = &A_void_1::mem2; std::bind(fp, A_void_1())(); assert(count == save_count+2); save_count = count; A_void_1 a; std::bind(fp, &a)(); assert(count == save_count+2); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { using namespace std::placeholders; // function { assert(std::bind(f_int_1, _1)(2) == 3); assert(std::bind(f_int_1, 2)() == 3); } // function pointer { int (*fp)(int) = f_int_1; assert(std::bind(fp, _1)(3) == 4); assert(std::bind(fp, 3)() == 4); } // functor { assert(std::bind(A_int_1(), _1)(4) == 3); assert(std::bind(A_int_1(), 4)() == 3); } // member function pointer { assert(std::bind(&A_int_1::mem1, _1)(A_int_1()) == 3); assert(std::bind(&A_int_1::mem1, A_int_1())() == 3); A_int_1 a; assert(std::bind(&A_int_1::mem1, _1)(&a) == 3); assert(std::bind(&A_int_1::mem1, &a)() == 3); } // const member function pointer { assert(std::bind(&A_int_1::mem2, _1)(A_int_1()) == 4); assert(std::bind(&A_int_1::mem2, A_int_1())() == 4); A_int_1 a; assert(std::bind(&A_int_1::mem2, _1)(&a) == 4); assert(std::bind(&A_int_1::mem2, &a)() == 4); } // member data pointer { assert(std::bind(&A_int_1::data_, _1)(A_int_1()) == 5); assert(std::bind(&A_int_1::data_, A_int_1())() == 5); A_int_1 a; assert(std::bind(&A_int_1::data_, _1)(a) == 5); std::bind(&A_int_1::data_, _1)(a) = 6; assert(std::bind(&A_int_1::data_, _1)(a) == 6); assert(std::bind(&A_int_1::data_, _1)(&a) == 6); std::bind(&A_int_1::data_, _1)(&a) = 7; assert(std::bind(&A_int_1::data_, _1)(&a) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { using namespace std::placeholders; int save_count = count; // function { std::bind(f_void_2, _1, _2)(2, 3); assert(count == save_count+5); save_count = count; std::bind(f_void_2, 2, _1)(3); assert(count == save_count+5); save_count = count; std::bind(f_void_2, 2, 3)(); assert(count == save_count+5); save_count = count; } // member function pointer { std::bind(&A_void_2::mem1, _1, _2)(A_void_2(), 3); assert(count == save_count+3); save_count = count; std::bind(&A_void_2::mem1, _2, _1)(3, A_void_2()); assert(count == save_count+3); save_count = count; } } int main() { test_void_1(); test_int_1(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp index 0eb0c0690e8..d9d7e94df14 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include int count = 0; template void test(F f) { int save_count = count; f(); assert(count == save_count + 1); } template void test_const(const F& f) { int save_count = count; f(); assert(count == save_count + 2); } void f() {++count;} struct A_int_0 { void operator()() {++count;} void operator()() const {count += 2;} }; int main() { test(std::bind(f)); test(std::bind(&f)); test(std::bind(A_int_0())); test_const(std::bind(A_int_0())); test(std::bind(f)); test(std::bind(&f)); test(std::bind(A_int_0())); test_const(std::bind(A_int_0())); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified bind(Fn, Types...); // template // unspecified bind(Fn, Types...); #include #include int count = 0; template void test(F f) { int save_count = count; f(); assert(count == save_count + 1); } template void test_const(const F& f) { int save_count = count; f(); assert(count == save_count + 2); } void f() {++count;} struct A_int_0 { void operator()() {++count;} void operator()() const {count += 2;} }; int main() { test(std::bind(f)); test(std::bind(&f)); test(std::bind(A_int_0())); test_const(std::bind(A_int_0())); test(std::bind(f)); test(std::bind(&f)); test(std::bind(A_int_0())); test_const(std::bind(A_int_0())); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp index 341cf2748f8..54c44a66654 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template struct is_bind_expression #include template void test(const T&) { static_assert(std::is_bind_expression::value == Expected, ""); } struct C {}; int main() { test(std::bind(C())); test(std::bind(C(), std::placeholders::_2)); test(std::bind(C())); test(1); test(std::placeholders::_2); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template struct is_bind_expression #include template void test(const T&) { static_assert(std::is_bind_expression::value == Expected, ""); } struct C {}; int main() { test(std::bind(C())); test(std::bind(C(), std::placeholders::_2)); test(std::bind(C())); test(1); test(std::placeholders::_2); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp index eebe80b8ab5..93fca7be258 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // struct is_placeholder #include template void test(const T&) { static_assert(std::is_placeholder::value == Expected, ""); } struct C {}; int main() { test<1>(std::placeholders::_1); test<2>(std::placeholders::_2); test<3>(std::placeholders::_3); test<4>(std::placeholders::_4); test<5>(std::placeholders::_5); test<6>(std::placeholders::_6); test<7>(std::placeholders::_7); test<8>(std::placeholders::_8); test<9>(std::placeholders::_9); test<10>(std::placeholders::_10); test<0>(4); test<0>(5.5); test<0>('a'); test<0>(C()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // struct is_placeholder #include template void test(const T&) { static_assert(std::is_placeholder::value == Expected, ""); } struct C {}; int main() { test<1>(std::placeholders::_1); test<2>(std::placeholders::_2); test<3>(std::placeholders::_3); test<4>(std::placeholders::_4); test<5>(std::placeholders::_5); test<6>(std::placeholders::_6); test<7>(std::placeholders::_7); test<8>(std::placeholders::_8); test<9>(std::placeholders::_9); test<10>(std::placeholders::_10); test<0>(4); test<0>(5.5); test<0>('a'); test<0>(C()); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp index 5b54c24120a..0414f62c88e 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // placeholders #include template void test(const T& t) { T t2; T t3 = t; } int main() { test(std::placeholders::_1); test(std::placeholders::_2); test(std::placeholders::_3); test(std::placeholders::_4); test(std::placeholders::_5); test(std::placeholders::_6); test(std::placeholders::_7); test(std::placeholders::_8); test(std::placeholders::_9); test(std::placeholders::_10); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // placeholders #include template void test(const T& t) { T t2; T t3 = t; } int main() { test(std::placeholders::_1); test(std::placeholders::_2); test(std::placeholders::_3); test(std::placeholders::_4); test(std::placeholders::_5); test(std::placeholders::_6); test(std::placeholders::_7); test(std::placeholders::_8); test(std::placeholders::_9); test(std::placeholders::_10); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp b/libcxx/test/utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bind/nothing_to_do.pass.cpp b/libcxx/test/utilities/function.objects/bind/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/function.objects/bind/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/function.objects/bind/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp b/libcxx/test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp index 6addf35e7d5..b334dac7f47 100644 --- a/libcxx/test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp +++ b/libcxx/test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // bit_and #include #include #include int main() { typedef std::bit_and F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(0xEA95, 0xEA95) == 0xEA95); assert(f(0xEA95, 0x58D3) == 0x4891); assert(f(0x58D3, 0xEA95) == 0x4891); assert(f(0x58D3, 0) == 0); assert(f(0xFFFF, 0x58D3) == 0x58D3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // bit_and #include #include #include int main() { typedef std::bit_and F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(0xEA95, 0xEA95) == 0xEA95); assert(f(0xEA95, 0x58D3) == 0x4891); assert(f(0x58D3, 0xEA95) == 0x4891); assert(f(0x58D3, 0) == 0); assert(f(0xFFFF, 0x58D3) == 0x58D3); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp b/libcxx/test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp index ef546841bd7..227863b481e 100644 --- a/libcxx/test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp +++ b/libcxx/test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // bit_or #include #include #include int main() { typedef std::bit_or F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(0xEA95, 0xEA95) == 0xEA95); assert(f(0xEA95, 0x58D3) == 0xFAD7); assert(f(0x58D3, 0xEA95) == 0xFAD7); assert(f(0x58D3, 0) == 0x58D3); assert(f(0xFFFF, 0x58D3) == 0xFFFF); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // bit_or #include #include #include int main() { typedef std::bit_or F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(0xEA95, 0xEA95) == 0xEA95); assert(f(0xEA95, 0x58D3) == 0xFAD7); assert(f(0x58D3, 0xEA95) == 0xFAD7); assert(f(0x58D3, 0) == 0x58D3); assert(f(0xFFFF, 0x58D3) == 0xFFFF); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp b/libcxx/test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp index 139763d8816..657498f69fb 100644 --- a/libcxx/test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp +++ b/libcxx/test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // bit_xor #include #include #include int main() { typedef std::bit_xor F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(0xEA95, 0xEA95) == 0); assert(f(0xEA95, 0x58D3) == 0xB246); assert(f(0x58D3, 0xEA95) == 0xB246); assert(f(0x58D3, 0) == 0x58D3); assert(f(0xFFFF, 0x58D3) == 0xA72C); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // bit_xor #include #include #include int main() { typedef std::bit_xor F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(0xEA95, 0xEA95) == 0); assert(f(0xEA95, 0x58D3) == 0xB246); assert(f(0x58D3, 0xEA95) == 0xB246); assert(f(0x58D3, 0) == 0x58D3); assert(f(0xFFFF, 0x58D3) == 0xA72C); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/comparisons/equal_to.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/equal_to.pass.cpp index 55796f8276a..282d410219f 100644 --- a/libcxx/test/utilities/function.objects/comparisons/equal_to.pass.cpp +++ b/libcxx/test/utilities/function.objects/comparisons/equal_to.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // equal_to #include #include #include int main() { typedef std::equal_to F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(!f(36, 6)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // equal_to #include #include #include int main() { typedef std::equal_to F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(!f(36, 6)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/comparisons/greater.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/greater.pass.cpp index ee36c538cf1..4595c9742fe 100644 --- a/libcxx/test/utilities/function.objects/comparisons/greater.pass.cpp +++ b/libcxx/test/utilities/function.objects/comparisons/greater.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // greater #include #include #include int main() { typedef std::greater F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert(f(36, 6)); assert(!f(6, 36)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // greater #include #include #include int main() { typedef std::greater F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert(f(36, 6)); assert(!f(6, 36)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/comparisons/greater_equal.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/greater_equal.pass.cpp index a6d114c675b..52089e07991 100644 --- a/libcxx/test/utilities/function.objects/comparisons/greater_equal.pass.cpp +++ b/libcxx/test/utilities/function.objects/comparisons/greater_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // greater_equal #include #include #include int main() { typedef std::greater_equal F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(f(36, 6)); assert(!f(6, 36)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // greater_equal #include #include #include int main() { typedef std::greater_equal F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(f(36, 6)); assert(!f(6, 36)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/comparisons/less.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/less.pass.cpp index 6a40ba0491f..178378a4f39 100644 --- a/libcxx/test/utilities/function.objects/comparisons/less.pass.cpp +++ b/libcxx/test/utilities/function.objects/comparisons/less.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // less #include #include #include int main() { typedef std::less F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert(!f(36, 6)); assert(f(6, 36)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // less #include #include #include int main() { typedef std::less F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert(!f(36, 6)); assert(f(6, 36)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/comparisons/less_equal.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/less_equal.pass.cpp index 84976701724..9df852816d2 100644 --- a/libcxx/test/utilities/function.objects/comparisons/less_equal.pass.cpp +++ b/libcxx/test/utilities/function.objects/comparisons/less_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // less_equal #include #include #include int main() { typedef std::less_equal F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(!f(36, 6)); assert(f(6, 36)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // less_equal #include #include #include int main() { typedef std::less_equal F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(!f(36, 6)); assert(f(6, 36)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/comparisons/not_equal_to.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/not_equal_to.pass.cpp index fb99ee56b3a..d3793340cba 100644 --- a/libcxx/test/utilities/function.objects/comparisons/not_equal_to.pass.cpp +++ b/libcxx/test/utilities/function.objects/comparisons/not_equal_to.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // not_equal_to #include #include #include int main() { typedef std::not_equal_to F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert(f(36, 6)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // not_equal_to #include #include #include int main() { typedef std::not_equal_to F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert(f(36, 6)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.def/nothing_to_do.pass.cpp b/libcxx/test/utilities/function.objects/func.def/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/function.objects/func.def/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.def/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_data.fail.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_data.fail.cpp index 4cc6644809d..4a284d25167 100644 --- a/libcxx/test/utilities/function.objects/func.memfn/member_data.fail.cpp +++ b/libcxx/test/utilities/function.objects/func.memfn/member_data.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template unspecified mem_fn(R T::* pm); #include #include struct A { double data_; }; template void test(F f) { { A a; f(a) = 5; assert(a.data_ == 5); A* ap = &a; f(ap) = 6; assert(a.data_ == 6); const A* cap = ap; assert(f(cap) == f(ap)); f(cap) = 7; } } int main() { test(std::mem_fn(&A::data_)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template unspecified mem_fn(R T::* pm); #include #include struct A { double data_; }; template void test(F f) { { A a; f(a) = 5; assert(a.data_ == 5); A* ap = &a; f(ap) = 6; assert(a.data_ == 6); const A* cap = ap; assert(f(cap) == f(ap)); f(cap) = 7; } } int main() { test(std::mem_fn(&A::data_)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp index 303097e936e..54cf2d3dfb2 100644 --- a/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template unspecified mem_fn(R T::* pm); #include #include struct A { double data_; }; template void test(F f) { { A a; f(a) = 5; assert(a.data_ == 5); A* ap = &a; f(ap) = 6; assert(a.data_ == 6); const A* cap = ap; assert(f(cap) == f(ap)); } } int main() { test(std::mem_fn(&A::data_)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template unspecified mem_fn(R T::* pm); #include #include struct A { double data_; }; template void test(F f) { { A a; f(a) = 5; assert(a.data_ == 5); A* ap = &a; f(ap) = 6; assert(a.data_ == 6); const A* cap = ap; assert(f(cap) == f(ap)); } } int main() { test(std::mem_fn(&A::data_)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp index 774a507a4a4..5995c618c74 100644 --- a/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...)); #include #include struct A { char test0() {return 'a';} char test1(int) {return 'b';} char test2(int, double) {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...)); #include #include struct A { char test0() {return 'a';} char test1(int) {return 'b';} char test2(int, double) {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp index b8b24d9c182..f927474b4ca 100644 --- a/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...) const); #include #include struct A { char test0() const {return 'a';} char test1(int) const {return 'b';} char test2(int, double) const {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); const A* cap = &a; assert(f(cap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); const A* cap = &a; assert(f(cap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); const A* cap = &a; assert(f(cap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...) const); #include #include struct A { char test0() const {return 'a';} char test1(int) const {return 'b';} char test2(int, double) const {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); const A* cap = &a; assert(f(cap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); const A* cap = &a; assert(f(cap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); const A* cap = &a; assert(f(cap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp index 9523f537bda..a33c13c5679 100644 --- a/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...) const volatile); #include #include struct A { char test0() const volatile {return 'a';} char test1(int) const volatile {return 'b';} char test2(int, double) const volatile {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); const volatile A* cap = &a; assert(f(cap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); const volatile A* cap = &a; assert(f(cap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); const volatile A* cap = &a; assert(f(cap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...) const volatile); #include #include struct A { char test0() const volatile {return 'a';} char test1(int) const volatile {return 'b';} char test2(int, double) const volatile {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); const volatile A* cap = &a; assert(f(cap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); const volatile A* cap = &a; assert(f(cap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); const volatile A* cap = &a; assert(f(cap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp index bf028b3cf13..3f445f5fb3d 100644 --- a/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...) volatile); #include #include struct A { char test0() volatile {return 'a';} char test1(int) volatile {return 'b';} char test2(int, double) volatile {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); volatile A* cap = &a; assert(f(cap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); volatile A* cap = &a; assert(f(cap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); volatile A* cap = &a; assert(f(cap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // unspecified mem_fn(R (T::* pm)(Args...) volatile); #include #include struct A { char test0() volatile {return 'a';} char test1(int) volatile {return 'b';} char test2(int, double) volatile {return 'c';} }; template void test0(F f) { { A a; assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); volatile A* cap = &a; assert(f(cap) == 'a'); } } template void test1(F f) { { A a; assert(f(a, 1) == 'b'); A* ap = &a; assert(f(ap, 2) == 'b'); volatile A* cap = &a; assert(f(cap, 2) == 'b'); } } template void test2(F f) { { A a; assert(f(a, 1, 2) == 'c'); A* ap = &a; assert(f(ap, 2, 3.5) == 'c'); volatile A* cap = &a; assert(f(cap, 2, 3.5) == 'c'); } } int main() { test0(std::mem_fn(&A::test0)); test1(std::mem_fn(&A::test1)); test2(std::mem_fn(&A::test2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.require/binary_function.pass.cpp b/libcxx/test/utilities/function.objects/func.require/binary_function.pass.cpp index e03dfe2c71e..53ac5c57f39 100644 --- a/libcxx/test/utilities/function.objects/func.require/binary_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.require/binary_function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // binary_function #include #include int main() { typedef std::binary_function bf; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // binary_function #include #include int main() { typedef std::binary_function bf; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.require/unary_function.pass.cpp b/libcxx/test/utilities/function.objects/func.require/unary_function.pass.cpp index b5c944cffb2..5f251260e0b 100644 --- a/libcxx/test/utilities/function.objects/func.require/unary_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.require/unary_function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unary_function #include #include int main() { typedef std::unary_function uf; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unary_function #include #include int main() { typedef std::unary_function uf; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/bad_function_call.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/bad_function_call.pass.cpp index 22af67ebf10..b39198f8d73 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/bad_function_call.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/bad_function_call.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Class bad_function_call // class bad_function_call // : public exception // { // public: // // 20.7.16.1.1, constructor: // bad_function_call(); // }; #include #include int main() { static_assert((std::is_base_of::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Class bad_function_call // class bad_function_call // : public exception // { // public: // // 20.7.16.1.1, constructor: // bad_function_call(); // }; #include #include int main() { static_assert((std::is_base_of::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/func.wrap.badcall.const/bad_function_call_ctor.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/func.wrap.badcall.const/bad_function_call_ctor.pass.cpp index 682399afacb..d9fb5fd1d60 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/func.wrap.badcall.const/bad_function_call_ctor.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.badcall/func.wrap.badcall.const/bad_function_call_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Class bad_function_call // bad_function_call(); #include #include int main() { std::bad_function_call ex; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Class bad_function_call // bad_function_call(); #include #include int main() { std::bad_function_call ex; } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp index b21c5522d66..12f95a7201b 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // void swap(function&, function&); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; explicit A(int j) { ++count; data_[0] = j; } A(const A& a) { ++count; for (int i = 0; i < 10; ++i) data_[i] = a.data_[i]; } ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int id() const {return data_[0];} }; int A::count = 0; int g(int) {return 0;} int h(int) {return 1;} int main() { assert(new_called == 0); { std::function f1 = A(1); std::function f2 = A(2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 1); assert(f2.target()->id() == 2); swap(f1, f2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 2); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = A(1); std::function f2 = g; assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); swap(f1, f2); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = A(1); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); swap(f1, f2); assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = h; assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == g); assert(*f2.target() == h); swap(f1, f2); assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == h); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // void swap(function&, function&); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; explicit A(int j) { ++count; data_[0] = j; } A(const A& a) { ++count; for (int i = 0; i < 10; ++i) data_[i] = a.data_[i]; } ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int id() const {return data_[0];} }; int A::count = 0; int g(int) {return 0;} int h(int) {return 1;} int main() { assert(new_called == 0); { std::function f1 = A(1); std::function f2 = A(2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 1); assert(f2.target()->id() == 2); swap(f1, f2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 2); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = A(1); std::function f2 = g; assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); swap(f1, f2); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = A(1); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); swap(f1, f2); assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = h; assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == g); assert(*f2.target() == h); swap(f1, f2); assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == h); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp index 6ecb531243f..44327baed3b 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // explicit operator bool() const #include #include int g(int) {return 0;} int main() { { std::function f; assert(!f); f = g; assert(f); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // explicit operator bool() const #include #include int g(int) {return 0;} int main() { { std::function f; assert(!f); f = g; assert(f); } } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp index 1cce025809b..06368fe3e89 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function(nullptr_t); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); } assert(new_called == 0); { std::function f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); } { std::function f = &A::foo; assert(f); assert(new_called == 0); assert(f.target() != 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function(nullptr_t); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); } assert(new_called == 0); { std::function f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); } { std::function f = &A::foo; assert(f); assert(new_called == 0); assert(f.target() != 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp index 9b090f3e5b9..2d6ab4b94cf 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // requires CopyConstructible && Callable // && Convertible::result_type // operator=(F f); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f; f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f; f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); } assert(new_called == 0); { std::function f; f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); } { std::function f; f = &A::foo; assert(f); assert(new_called == 0); assert(f.target() != 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // requires CopyConstructible && Callable // && Convertible::result_type // operator=(F f); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f; f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f; f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); } assert(new_called == 0); { std::function f; f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); } { std::function f; f = &A::foo; assert(f); assert(new_called == 0); assert(f.target() != 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp index bf2b3318650..c6628718576 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp index e3a1e7b2b90..01ffad74de8 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp index 3b55eb8df10..893949cc655 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp index 28edd858f82..048b7f6bd5c 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp index 2facbf7b59d..15e4dad2323 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp index 78dcc58d84c..d41975262fd 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function(const function& f); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target()); assert(f2.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); std::function f2 = f; assert(new_called == 0); assert(f2.target()); assert(f2.target() == 0); } assert(new_called == 0); { std::function f; assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); std::function f2 = f; assert(new_called == 0); assert(f2.target() == 0); assert(f2.target() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target()); assert(f2.target() == 0); assert(f.target() == 0); assert(f.target() == 0); } #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function(const function& f); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target()); assert(f2.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); std::function f2 = f; assert(new_called == 0); assert(f2.target()); assert(f2.target() == 0); } assert(new_called == 0); { std::function f; assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); std::function f2 = f; assert(new_called == 0); assert(f2.target() == 0); assert(f2.target() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target()); assert(f2.target() == 0); assert(f.target() == 0); assert(f.target() == 0); } #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp index 2b168064e9f..2dc88a93c84 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function& operator=(const function& f); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2; f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target()); assert(f2.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); std::function f2; f2 = f; assert(new_called == 0); assert(f2.target()); assert(f2.target() == 0); } assert(new_called == 0); { std::function f; assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); std::function f2; f2 = f; assert(new_called == 0); assert(f2.target() == 0); assert(f2.target() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2; f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target()); assert(f2.target() == 0); assert(f.target() == 0); assert(f.target() == 0); } #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function& operator=(const function& f); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2; f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target()); assert(f2.target() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); std::function f2; f2 = f; assert(new_called == 0); assert(f2.target()); assert(f2.target() == 0); } assert(new_called == 0); { std::function f; assert(new_called == 0); assert(f.target() == 0); assert(f.target() == 0); std::function f2; f2 = f; assert(new_called == 0); assert(f2.target() == 0); assert(f2.target() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); assert(f.target() == 0); std::function f2; f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target()); assert(f2.target() == 0); assert(f.target() == 0); assert(f.target() == 0); } #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp index b63544fc1d7..98e11620cfb 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // explicit function(); #include #include int main() { std::function f; assert(!f); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // explicit function(); #include #include int main() { std::function f; assert(!f); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp index e493ccfdb72..e812070ff0f 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function(nullptr_t); #include #include int main() { std::function f(nullptr); assert(!f); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function(nullptr_t); #include #include int main() { std::function f(nullptr); assert(!f); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp index 4361d4a4a50..aa00a04f16e 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function& operator=(nullptr_t); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); f = nullptr; assert(A::count == 0); assert(new_called == 0); assert(f.target() == 0); } { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); f = nullptr; assert(new_called == 0); assert(f.target() == 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // function& operator=(nullptr_t); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target()); f = nullptr; assert(A::count == 0); assert(new_called == 0); assert(f.target() == 0); } { std::function f = g; assert(new_called == 0); assert(f.target()); assert(f.target() == 0); f = nullptr; assert(new_called == 0); assert(f.target() == 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp index e3626ef3c95..9df88e8c110 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include // member data pointer: cv qualifiers should transfer from argument to return type struct A_int_1 { A_int_1() : data_(5) {} int data_; }; void test_int_1() { // member data pointer { int A_int_1::*fp = &A_int_1::data_; A_int_1 a; std::function r2(fp); const A_int_1* ap = &a; assert(r2(ap) == 6); r2(ap) = 7; assert(r2(ap) == 7); } } int main() { test_int_1(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include // member data pointer: cv qualifiers should transfer from argument to return type struct A_int_1 { A_int_1() : data_(5) {} int data_; }; void test_int_1() { // member data pointer { int A_int_1::*fp = &A_int_1::data_; A_int_1 a; std::function r2(fp); const A_int_1* ap = &a; assert(r2(ap) == 6); r2(ap) = 7; assert(r2(ap) == 7); } } int main() { test_int_1(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp index 4babee7af17..f95f082cf64 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {++count;} }; void test_void_1() { int save_count = count; // function { std::function r1(f_void_1); int i = 2; r1(i); assert(count == save_count+2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; std::function r1(fp); int i = 3; r1(i); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; std::function r1(a0); int i = 4; r1(i); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; std::function r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; std::function r2 = fp; r2(ap); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; std::function r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; std::function r2(fp); A_void_1* ap = &a; r2(ap); assert(count == save_count+1); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { // function { std::function r1(f_int_1); int i = 2; assert(r1(i) == 3); } // function pointer { int (*fp)(int) = f_int_1; std::function r1(fp); int i = 3; assert(r1(i) == 4); } // functor { A_int_1 a0; std::function r1(a0); int i = 4; assert(r1(i) == 3); } // member function pointer { int (A_int_1::*fp)() = &A_int_1::mem1; std::function r1(fp); A_int_1 a; assert(r1(a) == 3); std::function r2(fp); A_int_1* ap = &a; assert(r2(ap) == 3); } // const member function pointer { int (A_int_1::*fp)() const = &A_int_1::mem2; std::function r1(fp); A_int_1 a; assert(r1(a) == 4); std::function r2(fp); A_int_1* ap = &a; assert(r2(ap) == 4); } // member data pointer { int A_int_1::*fp = &A_int_1::data_; std::function r1(fp); A_int_1 a; assert(r1(a) == 5); r1(a) = 6; assert(r1(a) == 6); std::function r2(fp); A_int_1* ap = &a; assert(r2(ap) == 6); r2(ap) = 7; assert(r2(ap) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { int save_count = count; // function { std::function r1(f_void_2); int i = 2; int j = 3; r1(i, j); assert(count == save_count+5); save_count = count; } // function pointer { void (*fp)(int, int) = f_void_2; std::function r1(fp); int i = 3; int j = 4; r1(i, j); assert(count == save_count+7); save_count = count; } // functor { A_void_2 a0; std::function r1(a0); int i = 4; int j = 5; r1(i, j); assert(count == save_count+9); save_count = count; } // member function pointer { void (A_void_2::*fp)(int) = &A_void_2::mem1; std::function r1(fp); A_void_2 a; int i = 3; r1(a, i); assert(count == save_count+3); save_count = count; std::function r2(fp); A_void_2* ap = &a; r2(ap, i); assert(count == save_count+3); save_count = count; } // const member function pointer { void (A_void_2::*fp)(int) const = &A_void_2::mem2; std::function r1(fp); A_void_2 a; int i = 4; r1(a, i); assert(count == save_count+4); save_count = count; std::function r2(fp); A_void_2* ap = &a; r2(ap, i); assert(count == save_count+4); save_count = count; } } // 2 arg, return int int f_int_2(int i, int j) { return i+j; } struct A_int_2 { int operator()(int i, int j) { return i+j; } int mem1(int i) {return i+1;} int mem2(int i) const {return i+2;} }; void testint_2() { // function { std::function r1(f_int_2); int i = 2; int j = 3; assert(r1(i, j) == i+j); } // function pointer { int (*fp)(int, int) = f_int_2; std::function r1(fp); int i = 3; int j = 4; assert(r1(i, j) == i+j); } // functor { A_int_2 a0; std::function r1(a0); int i = 4; int j = 5; assert(r1(i, j) == i+j); } // member function pointer { int(A_int_2::*fp)(int) = &A_int_2::mem1; std::function r1(fp); A_int_2 a; int i = 3; assert(r1(a, i) == i+1); std::function r2(fp); A_int_2* ap = &a; assert(r2(ap, i) == i+1); } // const member function pointer { int (A_int_2::*fp)(int) const = &A_int_2::mem2; std::function r1(fp); A_int_2 a; int i = 4; assert(r1(a, i) == i+2); std::function r2(fp); A_int_2* ap = &a; assert(r2(ap, i) == i+2); } } int main() { test_void_1(); test_int_1(); test_void_2(); testint_2(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {++count;} }; void test_void_1() { int save_count = count; // function { std::function r1(f_void_1); int i = 2; r1(i); assert(count == save_count+2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; std::function r1(fp); int i = 3; r1(i); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; std::function r1(a0); int i = 4; r1(i); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; std::function r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; std::function r2 = fp; r2(ap); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; std::function r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; std::function r2(fp); A_void_1* ap = &a; r2(ap); assert(count == save_count+1); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { // function { std::function r1(f_int_1); int i = 2; assert(r1(i) == 3); } // function pointer { int (*fp)(int) = f_int_1; std::function r1(fp); int i = 3; assert(r1(i) == 4); } // functor { A_int_1 a0; std::function r1(a0); int i = 4; assert(r1(i) == 3); } // member function pointer { int (A_int_1::*fp)() = &A_int_1::mem1; std::function r1(fp); A_int_1 a; assert(r1(a) == 3); std::function r2(fp); A_int_1* ap = &a; assert(r2(ap) == 3); } // const member function pointer { int (A_int_1::*fp)() const = &A_int_1::mem2; std::function r1(fp); A_int_1 a; assert(r1(a) == 4); std::function r2(fp); A_int_1* ap = &a; assert(r2(ap) == 4); } // member data pointer { int A_int_1::*fp = &A_int_1::data_; std::function r1(fp); A_int_1 a; assert(r1(a) == 5); r1(a) = 6; assert(r1(a) == 6); std::function r2(fp); A_int_1* ap = &a; assert(r2(ap) == 6); r2(ap) = 7; assert(r2(ap) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { int save_count = count; // function { std::function r1(f_void_2); int i = 2; int j = 3; r1(i, j); assert(count == save_count+5); save_count = count; } // function pointer { void (*fp)(int, int) = f_void_2; std::function r1(fp); int i = 3; int j = 4; r1(i, j); assert(count == save_count+7); save_count = count; } // functor { A_void_2 a0; std::function r1(a0); int i = 4; int j = 5; r1(i, j); assert(count == save_count+9); save_count = count; } // member function pointer { void (A_void_2::*fp)(int) = &A_void_2::mem1; std::function r1(fp); A_void_2 a; int i = 3; r1(a, i); assert(count == save_count+3); save_count = count; std::function r2(fp); A_void_2* ap = &a; r2(ap, i); assert(count == save_count+3); save_count = count; } // const member function pointer { void (A_void_2::*fp)(int) const = &A_void_2::mem2; std::function r1(fp); A_void_2 a; int i = 4; r1(a, i); assert(count == save_count+4); save_count = count; std::function r2(fp); A_void_2* ap = &a; r2(ap, i); assert(count == save_count+4); save_count = count; } } // 2 arg, return int int f_int_2(int i, int j) { return i+j; } struct A_int_2 { int operator()(int i, int j) { return i+j; } int mem1(int i) {return i+1;} int mem2(int i) const {return i+2;} }; void testint_2() { // function { std::function r1(f_int_2); int i = 2; int j = 3; assert(r1(i, j) == i+j); } // function pointer { int (*fp)(int, int) = f_int_2; std::function r1(fp); int i = 3; int j = 4; assert(r1(i, j) == i+j); } // functor { A_int_2 a0; std::function r1(a0); int i = 4; int j = 5; assert(r1(i, j) == i+j); } // member function pointer { int(A_int_2::*fp)(int) = &A_int_2::mem1; std::function r1(fp); A_int_2 a; int i = 3; assert(r1(a, i) == i+1); std::function r2(fp); A_int_2* ap = &a; assert(r2(ap, i) == i+1); } // const member function pointer { int (A_int_2::*fp)(int) const = &A_int_2::mem2; std::function r1(fp); A_int_2 a; int i = 4; assert(r1(a, i) == i+2); std::function r2(fp); A_int_2* ap = &a; assert(r2(ap, i) == i+2); } } int main() { test_void_1(); test_int_1(); test_void_2(); testint_2(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp index 6bab12a9c79..1f84b3c7853 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include // 0 args, return int int count = 0; int f_int_0() { return 3; } struct A_int_0 { int operator()() {return 4;} }; void test_int_0() { // function { std::function r1(f_int_0); assert(r1() == 3); } // function pointer { int (*fp)() = f_int_0; std::function r1(fp); assert(r1() == 3); } // functor { A_int_0 a0; std::function r1(a0); assert(r1() == 4); } } int main() { test_int_0(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include // 0 args, return int int count = 0; int f_int_0() { return 3; } struct A_int_0 { int operator()() {return 4;} }; void test_int_0() { // function { std::function r1(f_int_0); assert(r1() == 3); } // function pointer { int (*fp)() = f_int_0; std::function r1(fp); assert(r1() == 3); } // functor { A_int_0 a0; std::function r1(a0); assert(r1() == 4); } } int main() { test_int_0(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp index 5df26064f1e..d9f92d39870 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include #include #include // 0 args, return void int count = 0; void f_void_0() { ++count; } struct A_void_0 { void operator()() {++count;} }; void test_void_0() { int save_count = count; // function { std::function r1(f_void_0); r1(); assert(count == save_count+1); save_count = count; } // function pointer { void (*fp)() = f_void_0; std::function r1(fp); r1(); assert(count == save_count+1); save_count = count; } // functor { A_void_0 a0; std::function r1(a0); r1(); assert(count == save_count+1); save_count = count; } } int main() { test_void_0(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // R operator()(ArgTypes... args) const #include #include #include #include // 0 args, return void int count = 0; void f_void_0() { ++count; } struct A_void_0 { void operator()() {++count;} }; void test_void_0() { int save_count = count; // function { std::function r1(f_void_0); r1(); assert(count == save_count+1); save_count = count; } // function pointer { void (*fp)() = f_void_0; std::function r1(fp); r1(); assert(count == save_count+1); save_count = count; } // functor { A_void_0 a0; std::function r1(a0); r1(); assert(count == save_count+1); save_count = count; } } int main() { test_void_0(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/assign_F_alloc.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/assign_F_alloc.pass.cpp index bbb84aae410..eeb6956012a 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/assign_F_alloc.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/assign_F_alloc.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp index 1e19ee2aa8b..935bc839d5e 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // void swap(function& other); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; explicit A(int j) { ++count; data_[0] = j; } A(const A& a) { ++count; for (int i = 0; i < 10; ++i) data_[i] = a.data_[i]; } ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int id() const {return data_[0];} }; int A::count = 0; int g(int) {return 0;} int h(int) {return 1;} int main() { assert(new_called == 0); { std::function f1 = A(1); std::function f2 = A(2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 1); assert(f2.target()->id() == 2); f1.swap(f2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 2); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = A(1); std::function f2 = g; assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); f1.swap(f2); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = A(1); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); f1.swap(f2); assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = h; assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == g); assert(*f2.target() == h); f1.swap(f2); assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == h); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // void swap(function& other); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; explicit A(int j) { ++count; data_[0] = j; } A(const A& a) { ++count; for (int i = 0; i < 10; ++i) data_[i] = a.data_[i]; } ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int id() const {return data_[0];} }; int A::count = 0; int g(int) {return 0;} int h(int) {return 1;} int main() { assert(new_called == 0); { std::function f1 = A(1); std::function f2 = A(2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 1); assert(f2.target()->id() == 2); f1.swap(f2); assert(A::count == 2); assert(new_called == 2); assert(f1.target()->id() == 2); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = A(1); std::function f2 = g; assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); f1.swap(f2); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = A(1); assert(A::count == 1); assert(new_called == 1); assert(*f1.target() == g); assert(f2.target()->id() == 1); f1.swap(f2); assert(A::count == 1); assert(new_called == 1); assert(f1.target()->id() == 1); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); { std::function f1 = g; std::function f2 = h; assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == g); assert(*f2.target() == h); f1.swap(f2); assert(A::count == 0); assert(new_called == 0); assert(*f1.target() == h); assert(*f2.target() == g); } assert(A::count == 0); assert(new_called == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp index 8a2ae86b7ba..6ea89d4c125 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // bool operator==(const function&, nullptr_t); // // template // bool operator==(nullptr_t, const function&); // // template // bool operator!=(const function&, nullptr_t); // // template // bool operator!=(nullptr_t, const function&); #include #include int g(int) {return 0;} int main() { { std::function f; assert(f == nullptr); assert(nullptr == f); f = g; assert(f != nullptr); assert(nullptr != f); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // bool operator==(const function&, nullptr_t); // // template // bool operator==(nullptr_t, const function&); // // template // bool operator!=(const function&, nullptr_t); // // template // bool operator!=(nullptr_t, const function&); #include #include int g(int) {return 0;} int main() { { std::function f; assert(f == nullptr); assert(nullptr == f); f = g; assert(f != nullptr); assert(nullptr != f); } } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp index 53fa50ba87e..718aedcb2b0 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // requires Callable && Convertible::result_type, R> // T* // target(); // template // requires Callable && Convertible::result_type, R> // const T* // target() const; #include #include #include #include class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { { std::function f = A(); assert(A::count == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); { std::function f = g; assert(A::count == 0); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); { const std::function f = A(); assert(A::count == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); { const std::function f = g; assert(A::count == 0); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // template // requires Callable && Convertible::result_type, R> // T* // target(); // template // requires Callable && Convertible::result_type, R> // const T* // target() const; #include #include #include #include class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { { std::function f = A(); assert(A::count == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); { std::function f = g; assert(A::count == 0); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); { const std::function f = A(); assert(A::count == 1); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); { const std::function f = g; assert(A::count == 0); assert(f.target()); assert(f.target() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp index 08abfadc360..36bd29fcfb9 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // const std::type_info& target_type() const; #include #include #include class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { { std::function f = A(); assert(f.target_type() == typeid(A)); } { std::function f; assert(f.target_type() == typeid(void)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class function // const std::type_info& target_type() const; #include #include #include class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { { std::function f = A(); assert(f.target_type() == typeid(A)); } { std::function f; assert(f.target_type() == typeid(void)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp index 17a8794bd5c..819c8fd1ba2 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class function // : public unary_function // iff sizeof...(ArgTypes) == 1 and // // ArgTypes contains T1 // : public binary_function // iff sizeof...(ArgTypes) == 2 and // // ArgTypes contains T1 and T2 // { // public: // typedef R result_type; // ... // }; #include #include int main() { static_assert((!std::is_base_of, std::function >::value), ""); static_assert((!std::is_base_of, std::function >::value), ""); static_assert(( std::is_same< std::function::result_type, int>::value), ""); static_assert(( std::is_base_of, std::function >::value), ""); static_assert((!std::is_base_of, std::function >::value), ""); static_assert(( std::is_same< std::function::result_type, double>::value), ""); static_assert((!std::is_base_of, std::function >::value), ""); static_assert(( std::is_base_of, std::function >::value), ""); static_assert(( std::is_same< std::function::result_type, double>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class function // : public unary_function // iff sizeof...(ArgTypes) == 1 and // // ArgTypes contains T1 // : public binary_function // iff sizeof...(ArgTypes) == 2 and // // ArgTypes contains T1 and T2 // { // public: // typedef R result_type; // ... // }; #include #include int main() { static_assert((!std::is_base_of, std::function >::value), ""); static_assert((!std::is_base_of, std::function >::value), ""); static_assert(( std::is_same< std::function::result_type, int>::value), ""); static_assert(( std::is_base_of, std::function >::value), ""); static_assert((!std::is_base_of, std::function >::value), ""); static_assert(( std::is_same< std::function::result_type, double>::value), ""); static_assert((!std::is_base_of, std::function >::value), ""); static_assert(( std::is_base_of, std::function >::value), ""); static_assert(( std::is_same< std::function::result_type, double>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_binary_function.pass.cpp b/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_binary_function.pass.cpp index f3f2c0a7297..0538c6ea3b8 100644 --- a/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_binary_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_binary_function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // pointer_to_binary_function #include #include #include double binary_f(int i, short j) {return i - j + .75;} int main() { typedef std::pointer_to_binary_function F; static_assert((std::is_base_of, F>::value), ""); const F f(binary_f); assert(f(36, 27) == 9.75); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // pointer_to_binary_function #include #include #include double binary_f(int i, short j) {return i - j + .75;} int main() { typedef std::pointer_to_binary_function F; static_assert((std::is_base_of, F>::value), ""); const F f(binary_f); assert(f(36, 27) == 9.75); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_unary_function.pass.cpp b/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_unary_function.pass.cpp index 70a9cebc973..9ff953e5550 100644 --- a/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_unary_function.pass.cpp +++ b/libcxx/test/utilities/function.objects/function.pointer.adaptors/pointer_to_unary_function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // pointer_to_unary_function #include #include #include double unary_f(int i) {return 0.5 - i;} int main() { typedef std::pointer_to_unary_function F; static_assert((std::is_base_of, F>::value), ""); const F f(unary_f); assert(f(36) == -35.5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // pointer_to_unary_function #include #include #include double unary_f(int i) {return 0.5 - i;} int main() { typedef std::pointer_to_unary_function F; static_assert((std::is_base_of, F>::value), ""); const F f(unary_f); assert(f(36) == -35.5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp b/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp index 4f377ef17ea..a4f16d0a83c 100644 --- a/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp +++ b/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // pointer_to_unary_function // ptr_fun(Result (*f)(Arg)); #include #include #include double unary_f(int i) {return 0.5 - i;} int main() { assert(std::ptr_fun(unary_f)(36) == -35.5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // pointer_to_unary_function // ptr_fun(Result (*f)(Arg)); #include #include #include double unary_f(int i) {return 0.5 - i;} int main() { assert(std::ptr_fun(unary_f)(36) == -35.5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp b/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp index 93c6376efba..84622320965 100644 --- a/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp +++ b/libcxx/test/utilities/function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // pointer_to_binary_function // ptr_fun(Result (*f)(Arg1, Arg2)); #include #include #include double binary_f(int i, short j) {return i - j + .75;} int main() { assert(std::ptr_fun(binary_f)(36, 27) == 9.75); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // pointer_to_binary_function // ptr_fun(Result (*f)(Arg1, Arg2)); #include #include #include double binary_f(int i, short j) {return i - j + .75;} int main() { assert(std::ptr_fun(binary_f)(36, 27) == 9.75); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/logical.operations/logical_and.pass.cpp b/libcxx/test/utilities/function.objects/logical.operations/logical_and.pass.cpp index e193c90a6b9..ae03d2c74ae 100644 --- a/libcxx/test/utilities/function.objects/logical.operations/logical_and.pass.cpp +++ b/libcxx/test/utilities/function.objects/logical.operations/logical_and.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // logical_and #include #include #include int main() { typedef std::logical_and F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(!f(36, 0)); assert(!f(0, 36)); assert(!f(0, 0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // logical_and #include #include #include int main() { typedef std::logical_and F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(!f(36, 0)); assert(!f(0, 36)); assert(!f(0, 0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/logical.operations/logical_not.pass.cpp b/libcxx/test/utilities/function.objects/logical.operations/logical_not.pass.cpp index 16bb419b5ed..471b145aa0f 100644 --- a/libcxx/test/utilities/function.objects/logical.operations/logical_not.pass.cpp +++ b/libcxx/test/utilities/function.objects/logical.operations/logical_not.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // logical_not #include #include #include int main() { typedef std::logical_not F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36)); assert(f(0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // logical_not #include #include #include int main() { typedef std::logical_not F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(!f(36)); assert(f(0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/logical.operations/logical_or.pass.cpp b/libcxx/test/utilities/function.objects/logical.operations/logical_or.pass.cpp index 0f2518acf94..35c1f815b31 100644 --- a/libcxx/test/utilities/function.objects/logical.operations/logical_or.pass.cpp +++ b/libcxx/test/utilities/function.objects/logical.operations/logical_or.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // logical_or #include #include #include int main() { typedef std::logical_or F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(f(36, 0)); assert(f(0, 36)); assert(!f(0, 0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // logical_or #include #include #include int main() { typedef std::logical_or F; const F f = F(); static_assert((std::is_base_of, F>::value), ""); assert(f(36, 36)); assert(f(36, 0)); assert(f(0, 36)); assert(!f(0, 0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp index b206b0001d2..7c1fb7432bf 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun_t // mem_fun(S (T::*f)() const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun(&A::a3)(&a) == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun_t // mem_fun(S (T::*f)() const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun(&A::a3)(&a) == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp index c2d6407cf6a..b23389abb4e 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun1_t // mem_fun(S (T::*f)(A) const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun(&A::a4)(&a, 6) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun1_t // mem_fun(S (T::*f)(A) const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun(&A::a4)(&a, 6) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp index 933842e2884..a7b5d50c2fa 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun1_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun1_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a4); const A a = A(); assert(f(a, 6) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun1_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun1_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a4); const A a = A(); assert(f(a, 6) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp index 8071810984a..8989ae778c8 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun1_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun1_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a4); const A a = A(); assert(f(&a, 6) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun1_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun1_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a4); const A a = A(); assert(f(&a, 6) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp index d8c3dbb019e..987b4c72ff7 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun_ref_t // mem_fun_ref(S (T::*f)() const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun_ref(&A::a3)(a) == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun_ref_t // mem_fun_ref(S (T::*f)() const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun_ref(&A::a3)(a) == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp index 5cba2c9b0fe..60aadc79921 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun1_ref_t // mem_fun_ref(S (T::*f)(A) const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun_ref(&A::a4)(a, 6) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // const_mem_fun1_ref_t // mem_fun_ref(S (T::*f)(A) const); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun_ref(&A::a4)(a, 6) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp index f28a36af9f1..424622ed3aa 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a3); const A a = A(); assert(f(a) == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a3); const A a = A(); assert(f(a) == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp index fdcd440c064..6eebb0edbed 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a3); const A a = A(); assert(f(&a) == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // const_mem_fun_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a3); const A a = A(); assert(f(&a) == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp index 0ea08e8d84b..144691bf850 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun_t // mem_fun(S (T::*f)()); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun(&A::a1)(&a) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun_t // mem_fun(S (T::*f)()); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun(&A::a1)(&a) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp index e47fb6cc6ca..514fac9301e 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun1_t // mem_fun(S (T::*f)(A)); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun(&A::a2)(&a, 5) == 6); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun1_t // mem_fun(S (T::*f)(A)); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun(&A::a2)(&a, 5) == 6); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp index adc00597cbe..b451d680bc0 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun1_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun1_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a2); A a; assert(f(a, 5) == 6); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun1_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun1_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a2); A a; assert(f(a, 5) == 6); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp index ab29d9a67f8..a9a62e05033 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun1_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun1_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a2); A a; assert(f(&a, 5) == 6); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun1_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun1_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a2); A a; assert(f(&a, 5) == 6); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp index 8d79e7ac768..785305eaa74 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun_ref_t // mem_fun_ref(S (T::*f)()); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun_ref(&A::a1)(a) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun_ref_t // mem_fun_ref(S (T::*f)()); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun_ref(&A::a1)(a) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp index bbc64a14ba7..733db16ee41 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun1_ref_t // mem_fun_ref(S (T::*f)(A)); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun_ref(&A::a2)(a, 5) == 6); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // mem_fun1_ref_t // mem_fun_ref(S (T::*f)(A)); #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun_ref(&A::a2)(a, 5) == 6); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp index 9a9e9dd718c..d92f378f6b6 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a1); A a; assert(f(a) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun_ref_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun_ref_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a1); A a; assert(f(a) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp index 5db73e169dc..721e9266d6f 100644 --- a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp +++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a1); A a; assert(f(&a) == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // mem_fun_t #include #include #include struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun_t F; static_assert((std::is_base_of, F>::value), ""); const F f(&A::a1); A a; assert(f(&a) == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/negators/binary_negate.pass.cpp b/libcxx/test/utilities/function.objects/negators/binary_negate.pass.cpp index 25f79144899..da48bbd4f31 100644 --- a/libcxx/test/utilities/function.objects/negators/binary_negate.pass.cpp +++ b/libcxx/test/utilities/function.objects/negators/binary_negate.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // binary_negate #include #include #include int main() { typedef std::binary_negate > F; const F f = F(std::logical_and()); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert( f(36, 0)); assert( f(0, 36)); assert( f(0, 0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // binary_negate #include #include #include int main() { typedef std::binary_negate > F; const F f = F(std::logical_and()); static_assert((std::is_base_of, F>::value), ""); assert(!f(36, 36)); assert( f(36, 0)); assert( f(0, 36)); assert( f(0, 0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/negators/not1.pass.cpp b/libcxx/test/utilities/function.objects/negators/not1.pass.cpp index 03bb7a7c9ec..6b399307e4f 100644 --- a/libcxx/test/utilities/function.objects/negators/not1.pass.cpp +++ b/libcxx/test/utilities/function.objects/negators/not1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // not1 #include #include int main() { typedef std::logical_not F; assert(std::not1(F())(36)); assert(!std::not1(F())(0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // not1 #include #include int main() { typedef std::logical_not F; assert(std::not1(F())(36)); assert(!std::not1(F())(0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/negators/not2.pass.cpp b/libcxx/test/utilities/function.objects/negators/not2.pass.cpp index 1f32fb1004b..9e65415cb2b 100644 --- a/libcxx/test/utilities/function.objects/negators/not2.pass.cpp +++ b/libcxx/test/utilities/function.objects/negators/not2.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // not2 #include #include int main() { typedef std::logical_and F; assert(!std::not2(F())(36, 36)); assert( std::not2(F())(36, 0)); assert( std::not2(F())(0, 36)); assert( std::not2(F())(0, 0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // not2 #include #include int main() { typedef std::logical_and F; assert(!std::not2(F())(36, 36)); assert( std::not2(F())(36, 0)); assert( std::not2(F())(0, 36)); assert( std::not2(F())(0, 0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/negators/unary_negate.pass.cpp b/libcxx/test/utilities/function.objects/negators/unary_negate.pass.cpp index 55696b8619e..9c5c2592b19 100644 --- a/libcxx/test/utilities/function.objects/negators/unary_negate.pass.cpp +++ b/libcxx/test/utilities/function.objects/negators/unary_negate.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unary_negate #include #include #include int main() { typedef std::unary_negate > F; const F f = F(std::logical_not()); static_assert((std::is_base_of, F>::value), ""); assert(f(36)); assert(!f(0)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unary_negate #include #include #include int main() { typedef std::unary_negate > F; const F f = F(std::logical_not()); static_assert((std::is_base_of, F>::value), ""); assert(f(36)); assert(!f(0)); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp index 3dfae3e73db..e9d7dda00a3 100644 --- a/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for deriving from binary_function #include #include class functor1 : public std::unary_function { }; class functor2 : public std::binary_function { }; class functor3 : public std::unary_function, public std::binary_function { public: typedef float result_type; }; class functor4 : public std::unary_function, public std::binary_function { public: }; struct C { typedef int argument_type; typedef int result_type; }; int main() { static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for deriving from binary_function #include #include class functor1 : public std::unary_function { }; class functor2 : public std::binary_function { }; class functor3 : public std::unary_function, public std::binary_function { public: typedef float result_type; }; class functor4 : public std::unary_function, public std::binary_function { public: }; struct C { typedef int argument_type; typedef int result_type; }; int main() { static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp index c7bb7a0c7b5..76986162b49 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // operator T& () const; #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); T& r2 = r; assert(&r2 == &t); } void f() {} int main() { void (*fp)() = f; test(fp); test(f); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // operator T& () const; #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); T& r2 = r; assert(&r2 == &t); } void f() {} int main() { void (*fp)() = f; test(fp); test(f); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp index c49105778bc..bccafd746e2 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper& operator=(const reference_wrapper& x); #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); T t2 = t; std::reference_wrapper r2(t2); r2 = r; assert(&r2.get() == &t); } void f() {} void g() {} void test_function() { std::reference_wrapper r(f); std::reference_wrapper r2(g); r2 = r; assert(&r2.get() == &f); } int main() { void (*fp)() = f; test(fp); test_function(); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper& operator=(const reference_wrapper& x); #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); T t2 = t; std::reference_wrapper r2(t2); r2 = r; assert(&r2.get() == &t); } void f() {} void g() {} void test_function() { std::reference_wrapper r(f); std::reference_wrapper r2(g); r2 = r; assert(&r2.get() == &f); } int main() { void (*fp)() = f; test(fp); test_function(); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp index a866a41201e..8bdbec5a75c 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper(const reference_wrapper& x); #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); std::reference_wrapper r2 = r; assert(&r2.get() == &t); } void f() {} int main() { void (*fp)() = f; test(fp); test(f); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper(const reference_wrapper& x); #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); std::reference_wrapper r2 = r; assert(&r2.get() == &t); } void f() {} int main() { void (*fp)() = f; test(fp); test(f); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp index 633725b5e61..f07592db475 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper(T&&) = delete; #include #include int main() { std::reference_wrapper r(3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper(T&&) = delete; #include #include int main() { std::reference_wrapper r(3); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp index 5f141400679..a4c2c8727b1 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper(T& t); #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); assert(&r.get() == &t); } void f() {} int main() { void (*fp)() = f; test(fp); test(f); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // reference_wrapper(T& t); #include #include class functor1 : public std::unary_function { }; template void test(T& t) { std::reference_wrapper r(t); assert(&r.get() == &t); } void f() {} int main() { void (*fp)() = f; test(fp); test(f); functor1 f1; test(f1); int i = 0; test(i); const int j = 0; test(j); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp index 7264e4fc3fb..f60de648d96 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper cref(const T& t); #include #include int main() { int i = 0; std::reference_wrapper r = std::cref(i); assert(&r.get() == &i); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper cref(const T& t); #include #include int main() { int i = 0; std::reference_wrapper r = std::cref(i); assert(&r.get() == &i); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp index db712ceba33..2f05d467eb3 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper cref(reference_wrapper t); #include #include int main() { const int i = 0; std::reference_wrapper r1 = std::cref(i); std::reference_wrapper r2 = std::cref(r1); assert(&r2.get() == &i); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper cref(reference_wrapper t); #include #include int main() { const int i = 0; std::reference_wrapper r1 = std::cref(i); std::reference_wrapper r2 = std::cref(r1); assert(&r2.get() == &i); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp index 934a9a8dac0..7fe32d7b023 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper ref(T& t); // Don't allow binding to a temp #include struct A {}; const A source() {return A();} int main() { std::reference_wrapper r = std::ref(source()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper ref(T& t); // Don't allow binding to a temp #include struct A {}; const A source() {return A();} int main() { std::reference_wrapper r = std::ref(source()); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp index 684b1b358a0..d4e493e0906 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper ref(T& t); #include #include int main() { int i = 0; std::reference_wrapper r = std::ref(i); assert(&r.get() == &i); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper ref(T& t); #include #include int main() { int i = 0; std::reference_wrapper r = std::ref(i); assert(&r.get() == &i); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp index e8221665bc5..f486a00aed4 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper ref(reference_wrappert); #include #include int main() { int i = 0; std::reference_wrapper r1 = std::ref(i); std::reference_wrapper r2 = std::ref(r1); assert(&r2.get() == &i); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template reference_wrapper ref(reference_wrappert); #include #include int main() { int i = 0; std::reference_wrapper r1 = std::ref(i); std::reference_wrapper r2 = std::ref(r1); assert(&r2.get() == &i); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp index 99a7fe2ddc3..d7b94ab6064 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include // member data pointer: cv qualifiers should transfer from argument to return type struct A_int_1 { A_int_1() : data_(5) {} int data_; }; void test_int_1() { // member data pointer { int A_int_1::*fp = &A_int_1::data_; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 5); r1(a) = 6; assert(r1(a) == 6); const A_int_1* ap = &a; assert(r1(ap) == 6); r1(ap) = 7; assert(r1(ap) == 7); } } int main() { test_int_1(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include // member data pointer: cv qualifiers should transfer from argument to return type struct A_int_1 { A_int_1() : data_(5) {} int data_; }; void test_int_1() { // member data pointer { int A_int_1::*fp = &A_int_1::data_; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 5); r1(a) = 6; assert(r1(a) == 6); const A_int_1* ap = &a; assert(r1(ap) == 6); r1(ap) = 7; assert(r1(ap) == 7); } } int main() { test_int_1(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp index 79a90b20357..ca7f226b682 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {++count;} }; void test_void_1() { int save_count = count; // function { std::reference_wrapper r1(f_void_1); int i = 2; r1(i); assert(count == save_count+2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; std::reference_wrapper r1(fp); int i = 3; r1(i); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; std::reference_wrapper r1(a0); int i = 4; r1(i); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; std::reference_wrapper r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; r1(ap); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; std::reference_wrapper r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; r1(ap); assert(count == save_count+1); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { // function { std::reference_wrapper r1(f_int_1); int i = 2; assert(r1(i) == 3); } // function pointer { int (*fp)(int) = f_int_1; std::reference_wrapper r1(fp); int i = 3; assert(r1(i) == 4); } // functor { A_int_1 a0; std::reference_wrapper r1(a0); int i = 4; assert(r1(i) == 3); } // member function pointer { int (A_int_1::*fp)() = &A_int_1::mem1; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 3); A_int_1* ap = &a; assert(r1(ap) == 3); } // const member function pointer { int (A_int_1::*fp)() const = &A_int_1::mem2; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 4); A_int_1* ap = &a; assert(r1(ap) == 4); } // member data pointer { int A_int_1::*fp = &A_int_1::data_; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 5); r1(a) = 6; assert(r1(a) == 6); A_int_1* ap = &a; assert(r1(ap) == 6); r1(ap) = 7; assert(r1(ap) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { int save_count = count; // function { std::reference_wrapper r1(f_void_2); int i = 2; int j = 3; r1(i, j); assert(count == save_count+5); save_count = count; } // function pointer { void (*fp)(int, int) = f_void_2; std::reference_wrapper r1(fp); int i = 3; int j = 4; r1(i, j); assert(count == save_count+7); save_count = count; } // functor { A_void_2 a0; std::reference_wrapper r1(a0); int i = 4; int j = 5; r1(i, j); assert(count == save_count+9); save_count = count; } // member function pointer { void (A_void_2::*fp)(int) = &A_void_2::mem1; std::reference_wrapper r1(fp); A_void_2 a; int i = 3; r1(a, i); assert(count == save_count+3); save_count = count; A_void_2* ap = &a; r1(ap, i); assert(count == save_count+3); save_count = count; } // const member function pointer { void (A_void_2::*fp)(int) const = &A_void_2::mem2; std::reference_wrapper r1(fp); A_void_2 a; int i = 4; r1(a, i); assert(count == save_count+4); save_count = count; A_void_2* ap = &a; r1(ap, i); assert(count == save_count+4); save_count = count; } } // 2 arg, return int int f_int_2(int i, int j) { return i+j; } struct A_int_2 { int operator()(int i, int j) { return i+j; } int mem1(int i) {return i+1;} int mem2(int i) const {return i+2;} }; void testint_2() { // function { std::reference_wrapper r1(f_int_2); int i = 2; int j = 3; assert(r1(i, j) == i+j); } // function pointer { int (*fp)(int, int) = f_int_2; std::reference_wrapper r1(fp); int i = 3; int j = 4; assert(r1(i, j) == i+j); } // functor { A_int_2 a0; std::reference_wrapper r1(a0); int i = 4; int j = 5; assert(r1(i, j) == i+j); } // member function pointer { int(A_int_2::*fp)(int) = &A_int_2::mem1; std::reference_wrapper r1(fp); A_int_2 a; int i = 3; assert(r1(a, i) == i+1); A_int_2* ap = &a; assert(r1(ap, i) == i+1); } // const member function pointer { int (A_int_2::*fp)(int) const = &A_int_2::mem2; std::reference_wrapper r1(fp); A_int_2 a; int i = 4; assert(r1(a, i) == i+2); A_int_2* ap = &a; assert(r1(ap, i) == i+2); } } int main() { test_void_1(); test_int_1(); test_void_2(); testint_2(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include int count = 0; // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } void mem1() {++count;} void mem2() const {++count;} }; void test_void_1() { int save_count = count; // function { std::reference_wrapper r1(f_void_1); int i = 2; r1(i); assert(count == save_count+2); save_count = count; } // function pointer { void (*fp)(int) = f_void_1; std::reference_wrapper r1(fp); int i = 3; r1(i); assert(count == save_count+3); save_count = count; } // functor { A_void_1 a0; std::reference_wrapper r1(a0); int i = 4; r1(i); assert(count == save_count+4); save_count = count; } // member function pointer { void (A_void_1::*fp)() = &A_void_1::mem1; std::reference_wrapper r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; r1(ap); assert(count == save_count+1); save_count = count; } // const member function pointer { void (A_void_1::*fp)() const = &A_void_1::mem2; std::reference_wrapper r1(fp); A_void_1 a; r1(a); assert(count == save_count+1); save_count = count; A_void_1* ap = &a; r1(ap); assert(count == save_count+1); save_count = count; } } // 1 arg, return int int f_int_1(int i) { return i + 1; } struct A_int_1 { A_int_1() : data_(5) {} int operator()(int i) { return i - 1; } int mem1() {return 3;} int mem2() const {return 4;} int data_; }; void test_int_1() { // function { std::reference_wrapper r1(f_int_1); int i = 2; assert(r1(i) == 3); } // function pointer { int (*fp)(int) = f_int_1; std::reference_wrapper r1(fp); int i = 3; assert(r1(i) == 4); } // functor { A_int_1 a0; std::reference_wrapper r1(a0); int i = 4; assert(r1(i) == 3); } // member function pointer { int (A_int_1::*fp)() = &A_int_1::mem1; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 3); A_int_1* ap = &a; assert(r1(ap) == 3); } // const member function pointer { int (A_int_1::*fp)() const = &A_int_1::mem2; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 4); A_int_1* ap = &a; assert(r1(ap) == 4); } // member data pointer { int A_int_1::*fp = &A_int_1::data_; std::reference_wrapper r1(fp); A_int_1 a; assert(r1(a) == 5); r1(a) = 6; assert(r1(a) == 6); A_int_1* ap = &a; assert(r1(ap) == 6); r1(ap) = 7; assert(r1(ap) == 7); } } // 2 arg, return void void f_void_2(int i, int j) { count += i+j; } struct A_void_2 { void operator()(int i, int j) { count += i+j; } void mem1(int i) {count += i;} void mem2(int i) const {count += i;} }; void test_void_2() { int save_count = count; // function { std::reference_wrapper r1(f_void_2); int i = 2; int j = 3; r1(i, j); assert(count == save_count+5); save_count = count; } // function pointer { void (*fp)(int, int) = f_void_2; std::reference_wrapper r1(fp); int i = 3; int j = 4; r1(i, j); assert(count == save_count+7); save_count = count; } // functor { A_void_2 a0; std::reference_wrapper r1(a0); int i = 4; int j = 5; r1(i, j); assert(count == save_count+9); save_count = count; } // member function pointer { void (A_void_2::*fp)(int) = &A_void_2::mem1; std::reference_wrapper r1(fp); A_void_2 a; int i = 3; r1(a, i); assert(count == save_count+3); save_count = count; A_void_2* ap = &a; r1(ap, i); assert(count == save_count+3); save_count = count; } // const member function pointer { void (A_void_2::*fp)(int) const = &A_void_2::mem2; std::reference_wrapper r1(fp); A_void_2 a; int i = 4; r1(a, i); assert(count == save_count+4); save_count = count; A_void_2* ap = &a; r1(ap, i); assert(count == save_count+4); save_count = count; } } // 2 arg, return int int f_int_2(int i, int j) { return i+j; } struct A_int_2 { int operator()(int i, int j) { return i+j; } int mem1(int i) {return i+1;} int mem2(int i) const {return i+2;} }; void testint_2() { // function { std::reference_wrapper r1(f_int_2); int i = 2; int j = 3; assert(r1(i, j) == i+j); } // function pointer { int (*fp)(int, int) = f_int_2; std::reference_wrapper r1(fp); int i = 3; int j = 4; assert(r1(i, j) == i+j); } // functor { A_int_2 a0; std::reference_wrapper r1(a0); int i = 4; int j = 5; assert(r1(i, j) == i+j); } // member function pointer { int(A_int_2::*fp)(int) = &A_int_2::mem1; std::reference_wrapper r1(fp); A_int_2 a; int i = 3; assert(r1(a, i) == i+1); A_int_2* ap = &a; assert(r1(ap, i) == i+1); } // const member function pointer { int (A_int_2::*fp)(int) const = &A_int_2::mem2; std::reference_wrapper r1(fp); A_int_2 a; int i = 4; assert(r1(a, i) == i+2); A_int_2* ap = &a; assert(r1(ap, i) == i+2); } } int main() { test_void_1(); test_int_1(); test_void_2(); testint_2(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp index 283177b9a35..2bef95e6d60 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include // 0 args, return int int count = 0; int f_int_0() { return 3; } struct A_int_0 { int operator()() {return 4;} }; void test_int_0() { // function { std::reference_wrapper r1(f_int_0); assert(r1() == 3); } // function pointer { int (*fp)() = f_int_0; std::reference_wrapper r1(fp); assert(r1() == 3); } // functor { A_int_0 a0; std::reference_wrapper r1(a0); assert(r1() == 4); } } // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } }; int main() { test_int_0(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include // 0 args, return int int count = 0; int f_int_0() { return 3; } struct A_int_0 { int operator()() {return 4;} }; void test_int_0() { // function { std::reference_wrapper r1(f_int_0); assert(r1() == 3); } // function pointer { int (*fp)() = f_int_0; std::reference_wrapper r1(fp); assert(r1() == 3); } // functor { A_int_0 a0; std::reference_wrapper r1(a0); assert(r1() == 4); } } // 1 arg, return void void f_void_1(int i) { count += i; } struct A_void_1 { void operator()(int i) { count += i; } }; int main() { test_int_0(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp index 649c5c0bbf0..e7445217cc0 100644 --- a/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include // 0 args, return void int count = 0; void f_void_0() { ++count; } struct A_void_0 { void operator()() {++count;} }; void test_void_0() { int save_count = count; // function { std::reference_wrapper r1(f_void_0); r1(); assert(count == save_count+1); save_count = count; } // function pointer { void (*fp)() = f_void_0; std::reference_wrapper r1(fp); r1(); assert(count == save_count+1); save_count = count; } // functor { A_void_0 a0; std::reference_wrapper r1(a0); r1(); assert(count == save_count+1); save_count = count; } } int main() { test_void_0(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // template // requires Callable // Callable::result_type // operator()(ArgTypes&&... args) const; #include #include // 0 args, return void int count = 0; void f_void_0() { ++count; } struct A_void_0 { void operator()() {++count;} }; void test_void_0() { int save_count = count; // function { std::reference_wrapper r1(f_void_0); r1(); assert(count == save_count+1); save_count = count; } // function pointer { void (*fp)() = f_void_0; std::reference_wrapper r1(fp); r1(); assert(count == save_count+1); save_count = count; } // functor { A_void_0 a0; std::reference_wrapper r1(a0); r1(); assert(count == save_count+1); save_count = count; } } int main() { test_void_0(); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/type.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/type.pass.cpp index a151625bcca..0ff12536803 100644 --- a/libcxx/test/utilities/function.objects/refwrap/type.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for member typedef type #include #include class C {}; int main() { static_assert((std::is_same::type, C>::value), ""); static_assert((std::is_same::type, void ()>::value), ""); static_assert((std::is_same::type, int* (double*)>::value), ""); static_assert((std::is_same::type, void(*)()>::value), ""); static_assert((std::is_same::type, int*(*)(double*)>::value), ""); static_assert((std::is_same::type, int*(C::*)(double*)>::value), ""); static_assert((std::is_same::type, int (C::*)(double*) const volatile>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for member typedef type #include #include class C {}; int main() { static_assert((std::is_same::type, C>::value), ""); static_assert((std::is_same::type, void ()>::value), ""); static_assert((std::is_same::type, int* (double*)>::value), ""); static_assert((std::is_same::type, void(*)()>::value), ""); static_assert((std::is_same::type, int*(*)(double*)>::value), ""); static_assert((std::is_same::type, int*(C::*)(double*)>::value), ""); static_assert((std::is_same::type, int (C::*)(double*) const volatile>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/unary.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/unary.pass.cpp index c572920853a..411d34fa26f 100644 --- a/libcxx/test/utilities/function.objects/refwrap/unary.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/unary.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for deriving from unary_function #include #include class functor1 : public std::unary_function { }; class functor2 : public std::binary_function { }; class functor3 : public std::unary_function, public std::binary_function { public: typedef float result_type; }; class functor4 : public std::unary_function, public std::binary_function { public: }; struct C { typedef int argument_type; typedef int result_type; }; int main() { static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for deriving from unary_function #include #include class functor1 : public std::unary_function { }; class functor2 : public std::binary_function { }; class functor3 : public std::unary_function, public std::binary_function { public: typedef float result_type; }; class functor4 : public std::unary_function, public std::binary_function { public: }; struct C { typedef int argument_type; typedef int result_type; }; int main() { static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); static_assert((!std::is_base_of, std::reference_wrapper >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/refwrap/weak_result.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/weak_result.pass.cpp index f0935fd396b..09cef664298 100644 --- a/libcxx/test/utilities/function.objects/refwrap/weak_result.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/weak_result.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // has weak result type #include #include class functor1 : public std::unary_function { }; class functor2 : public std::binary_function { }; class functor3 : public std::unary_function, public std::binary_function { public: typedef float result_type; }; class functor4 : public std::unary_function, public std::binary_function { public: }; class C {}; template struct has_result_type { private: struct two {char _; char __;}; template static two test(...); template static char test(typename U::result_type* = 0); public: static const bool value = sizeof(test(0)) == 1; }; int main() { static_assert((std::is_same::result_type, char>::value), ""); static_assert((std::is_same::result_type, double>::value), ""); static_assert((std::is_same::result_type, float>::value), ""); static_assert((std::is_same::result_type, void>::value), ""); static_assert((std::is_same::result_type, int*>::value), ""); static_assert((std::is_same::result_type, void>::value), ""); static_assert((std::is_same::result_type, int*>::value), ""); static_assert((std::is_same::result_type, int*>::value), ""); static_assert((std::is_same::result_type, int>::value), ""); static_assert((std::is_same::result_type, C>::value), ""); static_assert(has_result_type >::value, ""); static_assert(!has_result_type >::value, ""); static_assert(!has_result_type >::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // has weak result type #include #include class functor1 : public std::unary_function { }; class functor2 : public std::binary_function { }; class functor3 : public std::unary_function, public std::binary_function { public: typedef float result_type; }; class functor4 : public std::unary_function, public std::binary_function { public: }; class C {}; template struct has_result_type { private: struct two {char _; char __;}; template static two test(...); template static char test(typename U::result_type* = 0); public: static const bool value = sizeof(test(0)) == 1; }; int main() { static_assert((std::is_same::result_type, char>::value), ""); static_assert((std::is_same::result_type, double>::value), ""); static_assert((std::is_same::result_type, float>::value), ""); static_assert((std::is_same::result_type, void>::value), ""); static_assert((std::is_same::result_type, int*>::value), ""); static_assert((std::is_same::result_type, void>::value), ""); static_assert((std::is_same::result_type, int*>::value), ""); static_assert((std::is_same::result_type, int*>::value), ""); static_assert((std::is_same::result_type, int>::value), ""); static_assert((std::is_same::result_type, C>::value), ""); static_assert(has_result_type >::value, ""); static_assert(!has_result_type >::value, ""); static_assert(!has_result_type >::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/function.objects/unord.hash/floating.pass.cpp b/libcxx/test/utilities/function.objects/unord.hash/floating.pass.cpp index 003ba198c64..397bcafcfd7 100644 --- a/libcxx/test/utilities/function.objects/unord.hash/floating.pass.cpp +++ b/libcxx/test/utilities/function.objects/unord.hash/floating.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/unord.hash/integral.pass.cpp b/libcxx/test/utilities/function.objects/unord.hash/integral.pass.cpp index 1e6c0d559de..6e5c9add528 100644 --- a/libcxx/test/utilities/function.objects/unord.hash/integral.pass.cpp +++ b/libcxx/test/utilities/function.objects/unord.hash/integral.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/unord.hash/pointer.pass.cpp b/libcxx/test/utilities/function.objects/unord.hash/pointer.pass.cpp index 1a66b5b8cd4..5cbe83ad910 100644 --- a/libcxx/test/utilities/function.objects/unord.hash/pointer.pass.cpp +++ b/libcxx/test/utilities/function.objects/unord.hash/pointer.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/function.objects/version.pass.cpp b/libcxx/test/utilities/function.objects/version.pass.cpp index 5b53d1884e9..293168ba490 100644 --- a/libcxx/test/utilities/function.objects/version.pass.cpp +++ b/libcxx/test/utilities/function.objects/version.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp index 9f37e7fc55b..cee773472cc 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp index de8e3ffc03c..5cb097d94c6 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp index 533c01c83eb..19b8ebdd39a 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp index 02397ce0ec2..3fe3f4e3998 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp index 770f68ad8da..49dafc198b8 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp index c413df66807..87b8a43284d 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp index 711d6df9993..23bafc34c6f 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp index f66da6be809..20fd0359d2a 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp index 6a8b2da55f0..488d475d36d 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp index d3af8b6bc87..c27b6dff414 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp index 5c66dde759c..06dd728329a 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp index 033c6cd82db..903819625b4 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp index 94ffd877180..c4039f37466 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp index aa731f97db1..6b3c4c37119 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp index fd5c7cffcc3..569c05da8eb 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp index 2fb1ee1ce95..b067f14da75 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp index b52e281d4c2..3c2aaf50aab 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp index 98773a4c9d8..8ef79907da3 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.adaptor/types.pass.cpp b/libcxx/test/utilities/memory/allocator.adaptor/types.pass.cpp index ebac49a667e..64457fd8d32 100644 --- a/libcxx/test/utilities/memory/allocator.adaptor/types.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.adaptor/types.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/allocator.tag/allocator_arg.pass.cpp b/libcxx/test/utilities/memory/allocator.tag/allocator_arg.pass.cpp index ad19abbd046..fb0b9f69aa5 100644 --- a/libcxx/test/utilities/memory/allocator.tag/allocator_arg.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.tag/allocator_arg.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // struct allocator_arg_t { }; // const allocator_arg_t allocator_arg = allocator_arg_t(); #include void test(std::allocator_arg_t) {} int main() { test(std::allocator_arg); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // struct allocator_arg_t { }; // const allocator_arg_t allocator_arg = allocator_arg_t(); #include void test(std::allocator_arg_t) {} int main() { test(std::allocator_arg); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp index 2fb633b8b09..c797b1020bc 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static pointer allocate(allocator_type& a, size_type n); // ... // }; #include #include template struct A { typedef T value_type; value_type* allocate(std::size_t n) { assert(n == 10); return (value_type*)0xDEADBEEF; } }; int main() { A a; assert(std::allocator_traits >::allocate(a, 10) == (int*)0xDEADBEEF); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static pointer allocate(allocator_type& a, size_type n); // ... // }; #include #include template struct A { typedef T value_type; value_type* allocate(std::size_t n) { assert(n == 10); return (value_type*)0xDEADBEEF; } }; int main() { A a; assert(std::allocator_traits >::allocate(a, 10) == (int*)0xDEADBEEF); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp index 4613b608df6..9847c2a6053 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // ... // }; #include #include template struct A { typedef T value_type; value_type* allocate(std::size_t n) { assert(n == 10); return (value_type*)0xDEADBEEF; } }; template struct B { typedef T value_type; value_type* allocate(std::size_t n) { assert(n == 12); return (value_type*)0xEEADBEEF; } value_type* allocate(std::size_t n, const void* p) { assert(n == 11); assert(p == 0); return (value_type*)0xFEADBEEF; } }; int main() { #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE A a; assert(std::allocator_traits >::allocate(a, 10, nullptr) == (int*)0xDEADBEEF); #endif B b; assert(std::allocator_traits >::allocate(b, 11, nullptr) == (int*)0xFEADBEEF); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // ... // }; #include #include template struct A { typedef T value_type; value_type* allocate(std::size_t n) { assert(n == 10); return (value_type*)0xDEADBEEF; } }; template struct B { typedef T value_type; value_type* allocate(std::size_t n) { assert(n == 12); return (value_type*)0xEEADBEEF; } value_type* allocate(std::size_t n, const void* p) { assert(n == 11); assert(p == 0); return (value_type*)0xFEADBEEF; } }; int main() { #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE A a; assert(std::allocator_traits >::allocate(a, 10, nullptr) == (int*)0xDEADBEEF); #endif B b; assert(std::allocator_traits >::allocate(b, 11, nullptr) == (int*)0xFEADBEEF); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp index 4a662550307..4dda58f8c7a 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template // static void construct(allocator_type& a, Ptr p, Args&&... args); // ... // }; #include #include #include #include template struct A { typedef T value_type; }; int b_construct = 0; template struct B { typedef T value_type; #ifndef _LIBCPP_HAS_NO_VARIADICS template void construct(U* p, Args&& ...args) { ++b_construct; ::new ((void*)p) U(std::forward(args)...); } #endif }; struct A0 { static int count; A0() {++count;} }; int A0::count = 0; struct A1 { static int count; A1(char c) { assert(c == 'c'); ++count; } }; int A1::count = 0; struct A2 { static int count; A2(char c, int i) { assert(c == 'd'); assert(i == 5); ++count; } }; int A2::count = 0; int main() { { A0::count = 0; A a; std::aligned_storage::type a0; assert(A0::count == 0); std::allocator_traits >::construct(a, (A0*)&a0); assert(A0::count == 1); } { A1::count = 0; A a; std::aligned_storage::type a1; assert(A1::count == 0); std::allocator_traits >::construct(a, (A1*)&a1, 'c'); assert(A1::count == 1); } { A2::count = 0; A a; std::aligned_storage::type a2; assert(A2::count == 0); std::allocator_traits >::construct(a, (A2*)&a2, 'd', 5); assert(A2::count == 1); } #ifndef _LIBCPP_HAS_NO_VARIADICS { A0::count = 0; b_construct = 0; B b; std::aligned_storage::type a0; assert(A0::count == 0); assert(b_construct == 0); std::allocator_traits >::construct(b, (A0*)&a0); assert(A0::count == 1); assert(b_construct == 1); } { A1::count = 0; b_construct = 0; B b; std::aligned_storage::type a1; assert(A1::count == 0); assert(b_construct == 0); std::allocator_traits >::construct(b, (A1*)&a1, 'c'); assert(A1::count == 1); assert(b_construct == 1); } { A2::count = 0; b_construct = 0; B b; std::aligned_storage::type a2; assert(A2::count == 0); assert(b_construct == 0); std::allocator_traits >::construct(b, (A2*)&a2, 'd', 5); assert(A2::count == 1); assert(b_construct == 1); } #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template // static void construct(allocator_type& a, Ptr p, Args&&... args); // ... // }; #include #include #include #include template struct A { typedef T value_type; }; int b_construct = 0; template struct B { typedef T value_type; #ifndef _LIBCPP_HAS_NO_VARIADICS template void construct(U* p, Args&& ...args) { ++b_construct; ::new ((void*)p) U(std::forward(args)...); } #endif }; struct A0 { static int count; A0() {++count;} }; int A0::count = 0; struct A1 { static int count; A1(char c) { assert(c == 'c'); ++count; } }; int A1::count = 0; struct A2 { static int count; A2(char c, int i) { assert(c == 'd'); assert(i == 5); ++count; } }; int A2::count = 0; int main() { { A0::count = 0; A a; std::aligned_storage::type a0; assert(A0::count == 0); std::allocator_traits >::construct(a, (A0*)&a0); assert(A0::count == 1); } { A1::count = 0; A a; std::aligned_storage::type a1; assert(A1::count == 0); std::allocator_traits >::construct(a, (A1*)&a1, 'c'); assert(A1::count == 1); } { A2::count = 0; A a; std::aligned_storage::type a2; assert(A2::count == 0); std::allocator_traits >::construct(a, (A2*)&a2, 'd', 5); assert(A2::count == 1); } #ifndef _LIBCPP_HAS_NO_VARIADICS { A0::count = 0; b_construct = 0; B b; std::aligned_storage::type a0; assert(A0::count == 0); assert(b_construct == 0); std::allocator_traits >::construct(b, (A0*)&a0); assert(A0::count == 1); assert(b_construct == 1); } { A1::count = 0; b_construct = 0; B b; std::aligned_storage::type a1; assert(A1::count == 0); assert(b_construct == 0); std::allocator_traits >::construct(b, (A1*)&a1, 'c'); assert(A1::count == 1); assert(b_construct == 1); } { A2::count = 0; b_construct = 0; B b; std::aligned_storage::type a2; assert(A2::count == 0); assert(b_construct == 0); std::allocator_traits >::construct(b, (A2*)&a2, 'd', 5); assert(A2::count == 1); assert(b_construct == 1); } #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp index 4c648e11980..b4bd79a96e3 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static void deallocate(allocator_type& a, pointer p, size_type n); // ... // }; #include #include int called = 0; template struct A { typedef T value_type; void deallocate(value_type* p, std::size_t n) { assert(p == (value_type*)0xDEADBEEF); assert(n == 10); ++called; } }; int main() { A a; std::allocator_traits >::deallocate(a, (int*)0xDEADBEEF, 10); assert(called == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static void deallocate(allocator_type& a, pointer p, size_type n); // ... // }; #include #include int called = 0; template struct A { typedef T value_type; void deallocate(value_type* p, std::size_t n) { assert(p == (value_type*)0xDEADBEEF); assert(n == 10); ++called; } }; int main() { A a; std::allocator_traits >::deallocate(a, (int*)0xDEADBEEF, 10); assert(called == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp index 282c70886c6..7996ea42033 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template // static void destroy(allocator_type& a, Ptr p); // ... // }; #include #include #include #include template struct A { typedef T value_type; }; int b_destroy = 0; template struct B { typedef T value_type; template void destroy(U* p) { ++b_destroy; p->~U(); } }; struct A0 { static int count; ~A0() {++count;} }; int A0::count = 0; int main() { { A0::count = 0; A a; std::aligned_storage::type a0; std::allocator_traits >::construct(a, (A0*)&a0); assert(A0::count == 0); std::allocator_traits >::destroy(a, (A0*)&a0); assert(A0::count == 1); } #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE { A0::count = 0; b_destroy = 0; B b; std::aligned_storage::type a0; std::allocator_traits >::construct(b, (A0*)&a0); assert(A0::count == 0); assert(b_destroy == 0); std::allocator_traits >::destroy(b, (A0*)&a0); assert(A0::count == 1); assert(b_destroy == 1); } #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template // static void destroy(allocator_type& a, Ptr p); // ... // }; #include #include #include #include template struct A { typedef T value_type; }; int b_destroy = 0; template struct B { typedef T value_type; template void destroy(U* p) { ++b_destroy; p->~U(); } }; struct A0 { static int count; ~A0() {++count;} }; int A0::count = 0; int main() { { A0::count = 0; A a; std::aligned_storage::type a0; std::allocator_traits >::construct(a, (A0*)&a0); assert(A0::count == 0); std::allocator_traits >::destroy(a, (A0*)&a0); assert(A0::count == 1); } #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE { A0::count = 0; b_destroy = 0; B b; std::aligned_storage::type a0; std::allocator_traits >::construct(b, (A0*)&a0); assert(A0::count == 0); assert(b_destroy == 0); std::allocator_traits >::destroy(b, (A0*)&a0); assert(A0::count == 1); assert(b_destroy == 1); } #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp index 1f85bd20da2..c021ea8c108 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static size_type max_size(const allocator_type& a); // ... // }; #include #include #include #include template struct A { typedef T value_type; }; template struct B { typedef T value_type; size_t max_size() const { return 100; } }; int main() { #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE { A a; assert(std::allocator_traits >::max_size(a) == std::numeric_limits::max()); } { const A a = {}; assert(std::allocator_traits >::max_size(a) == std::numeric_limits::max()); } #endif { B b; assert(std::allocator_traits >::max_size(b) == 100); } { const B b = {}; assert(std::allocator_traits >::max_size(b) == 100); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static size_type max_size(const allocator_type& a); // ... // }; #include #include #include #include template struct A { typedef T value_type; }; template struct B { typedef T value_type; size_t max_size() const { return 100; } }; int main() { #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE { A a; assert(std::allocator_traits >::max_size(a) == std::numeric_limits::max()); } { const A a = {}; assert(std::allocator_traits >::max_size(a) == std::numeric_limits::max()); } #endif { B b; assert(std::allocator_traits >::max_size(b) == 100); } { const B b = {}; assert(std::allocator_traits >::max_size(b) == 100); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp index 5a7df84f5a9..8fe2365bc10 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static allocator_type // select_on_container_copy_construction(const allocator_type& a); // ... // }; #include #include #include #include template struct A { typedef T value_type; int id; explicit A(int i = 0) : id(i) {} }; template struct B { typedef T value_type; int id; explicit B(int i = 0) : id(i) {} B select_on_container_copy_construction() const { return B(100); } }; int main() { { A a; assert(std::allocator_traits >::select_on_container_copy_construction(a).id == 0); } { const A a(0); assert(std::allocator_traits >::select_on_container_copy_construction(a).id == 0); } #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE { B b; assert(std::allocator_traits >::select_on_container_copy_construction(b).id == 100); } { const B b(0); assert(std::allocator_traits >::select_on_container_copy_construction(b).id == 100); } #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // static allocator_type // select_on_container_copy_construction(const allocator_type& a); // ... // }; #include #include #include #include template struct A { typedef T value_type; int id; explicit A(int i = 0) : id(i) {} }; template struct B { typedef T value_type; int id; explicit B(int i = 0) : id(i) {} B select_on_container_copy_construction() const { return B(100); } }; int main() { { A a; assert(std::allocator_traits >::select_on_container_copy_construction(a).id == 0); } { const A a(0); assert(std::allocator_traits >::select_on_container_copy_construction(a).id == 0); } #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE { B b; assert(std::allocator_traits >::select_on_container_copy_construction(b).id == 100); } { const B b(0); assert(std::allocator_traits >::select_on_container_copy_construction(b).id == 100); } #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_pointer.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_pointer.pass.cpp index cab032cb9a9..680583ac3a8 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_pointer.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::const_pointer // | pointer_traits::rebind // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; template struct CPtr {}; template struct C { typedef T value_type; typedef CPtr pointer; typedef CPtr const_pointer; }; int main() { static_assert((std::is_same >::const_pointer, Ptr >::value), ""); static_assert((std::is_same >::const_pointer, const char*>::value), ""); static_assert((std::is_same >::const_pointer, CPtr >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::const_pointer // | pointer_traits::rebind // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; template struct CPtr {}; template struct C { typedef T value_type; typedef CPtr pointer; typedef CPtr const_pointer; }; int main() { static_assert((std::is_same >::const_pointer, Ptr >::value), ""); static_assert((std::is_same >::const_pointer, const char*>::value), ""); static_assert((std::is_same >::const_pointer, CPtr >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_void_pointer.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_void_pointer.pass.cpp index 0fcc13cc2b8..afa0cf29d1e 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_void_pointer.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/const_void_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::const_void_pointer // | pointer_traits::rebind // const_void_pointer; // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; template struct CPtr {}; template struct C { typedef T value_type; typedef CPtr const_void_pointer; }; int main() { static_assert((std::is_same >::const_void_pointer, Ptr >::value), ""); static_assert((std::is_same >::const_void_pointer, const void*>::value), ""); static_assert((std::is_same >::const_void_pointer, CPtr >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::const_void_pointer // | pointer_traits::rebind // const_void_pointer; // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; template struct CPtr {}; template struct C { typedef T value_type; typedef CPtr const_void_pointer; }; int main() { static_assert((std::is_same >::const_void_pointer, Ptr >::value), ""); static_assert((std::is_same >::const_void_pointer, const void*>::value), ""); static_assert((std::is_same >::const_void_pointer, CPtr >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/difference_type.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/difference_type.pass.cpp index 20cc70f326a..7eab2fc5af5 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/difference_type.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/difference_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::difference_type // | ptrdiff_t difference_type; // ... // }; #include #include template struct A { typedef T value_type; typedef short difference_type; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::difference_type, short>::value), ""); static_assert((std::is_same >::difference_type, std::ptrdiff_t>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::difference_type // | ptrdiff_t difference_type; // ... // }; #include #include template struct A { typedef T value_type; typedef short difference_type; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::difference_type, short>::value), ""); static_assert((std::is_same >::difference_type, std::ptrdiff_t>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/pointer.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/pointer.pass.cpp index bd2ddc418ca..6b479cee2a7 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/pointer.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::pointer | value_type* pointer; // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::pointer, Ptr >::value), ""); static_assert((std::is_same >::pointer, char*>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::pointer | value_type* pointer; // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::pointer, Ptr >::value), ""); static_assert((std::is_same >::pointer, char*>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_copy_assignment.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_copy_assignment.pass.cpp index 83be6e3583a..8340b582373 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_copy_assignment.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_copy_assignment.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::propagate_on_container_copy_assignment // | false_type propagate_on_container_copy_assignment; // ... // }; #include #include template struct A { typedef T value_type; typedef std::true_type propagate_on_container_copy_assignment; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::propagate_on_container_copy_assignment, std::true_type>::value), ""); static_assert((std::is_same >::propagate_on_container_copy_assignment, std::false_type>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::propagate_on_container_copy_assignment // | false_type propagate_on_container_copy_assignment; // ... // }; #include #include template struct A { typedef T value_type; typedef std::true_type propagate_on_container_copy_assignment; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::propagate_on_container_copy_assignment, std::true_type>::value), ""); static_assert((std::is_same >::propagate_on_container_copy_assignment, std::false_type>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_move_assignment.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_move_assignment.pass.cpp index 1c25b7fd9f2..827201625cd 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_move_assignment.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_move_assignment.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::propagate_on_container_move_assignment // | false_type propagate_on_container_move_assignment; // ... // }; #include #include template struct A { typedef T value_type; typedef std::true_type propagate_on_container_move_assignment; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::propagate_on_container_move_assignment, std::true_type>::value), ""); static_assert((std::is_same >::propagate_on_container_move_assignment, std::false_type>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::propagate_on_container_move_assignment // | false_type propagate_on_container_move_assignment; // ... // }; #include #include template struct A { typedef T value_type; typedef std::true_type propagate_on_container_move_assignment; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::propagate_on_container_move_assignment, std::true_type>::value), ""); static_assert((std::is_same >::propagate_on_container_move_assignment, std::false_type>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_swap.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_swap.pass.cpp index 6abc1cd9e48..7c4d36afe0a 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_swap.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/propagate_on_container_swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::propagate_on_container_swap // | false_type propagate_on_container_swap; // ... // }; #include #include template struct A { typedef T value_type; typedef std::true_type propagate_on_container_swap; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::propagate_on_container_swap, std::true_type>::value), ""); static_assert((std::is_same >::propagate_on_container_swap, std::false_type>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::propagate_on_container_swap // | false_type propagate_on_container_swap; // ... // }; #include #include template struct A { typedef T value_type; typedef std::true_type propagate_on_container_swap; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::propagate_on_container_swap, std::true_type>::value), ""); static_assert((std::is_same >::propagate_on_container_swap, std::false_type>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/rebind_alloc.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/rebind_alloc.pass.cpp index c342835d147..443ce269725 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/rebind_alloc.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/rebind_alloc.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template using rebind_alloc = Alloc::rebind::other | Alloc; // ... // }; #include #include template struct ReboundA {}; template struct A { typedef T value_type; template struct rebind {typedef ReboundA other;}; }; template struct ReboundB {}; template struct B { typedef T value_type; template struct rebind {typedef ReboundB other;}; }; template struct C { typedef T value_type; }; template struct D { typedef T value_type; }; template struct E { typedef T value_type; template struct rebind {typedef ReboundA otter;}; }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind_alloc, ReboundA >::value), ""); static_assert((std::is_same >::rebind_alloc, ReboundB >::value), ""); static_assert((std::is_same >::rebind_alloc, C >::value), ""); static_assert((std::is_same >::rebind_alloc, D >::value), ""); static_assert((std::is_same >::rebind_alloc, E >::value), ""); #else static_assert((std::is_same >::rebind_alloc::other, ReboundA >::value), ""); static_assert((std::is_same >::rebind_alloc::other, ReboundB >::value), ""); static_assert((std::is_same >::rebind_alloc::other, C >::value), ""); static_assert((std::is_same >::rebind_alloc::other, D >::value), ""); static_assert((std::is_same >::rebind_alloc::other, E >::value), ""); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template using rebind_alloc = Alloc::rebind::other | Alloc; // ... // }; #include #include template struct ReboundA {}; template struct A { typedef T value_type; template struct rebind {typedef ReboundA other;}; }; template struct ReboundB {}; template struct B { typedef T value_type; template struct rebind {typedef ReboundB other;}; }; template struct C { typedef T value_type; }; template struct D { typedef T value_type; }; template struct E { typedef T value_type; template struct rebind {typedef ReboundA otter;}; }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind_alloc, ReboundA >::value), ""); static_assert((std::is_same >::rebind_alloc, ReboundB >::value), ""); static_assert((std::is_same >::rebind_alloc, C >::value), ""); static_assert((std::is_same >::rebind_alloc, D >::value), ""); static_assert((std::is_same >::rebind_alloc, E >::value), ""); #else static_assert((std::is_same >::rebind_alloc::other, ReboundA >::value), ""); static_assert((std::is_same >::rebind_alloc::other, ReboundB >::value), ""); static_assert((std::is_same >::rebind_alloc::other, C >::value), ""); static_assert((std::is_same >::rebind_alloc::other, D >::value), ""); static_assert((std::is_same >::rebind_alloc::other, E >::value), ""); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/size_type.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/size_type.pass.cpp index a0bb3d1fa1c..2eef5d435c7 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/size_type.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/size_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::size_type | size_t size_type; // ... // }; #include #include template struct A { typedef T value_type; typedef unsigned short size_type; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::size_type, unsigned short>::value), ""); static_assert((std::is_same >::size_type, std::size_t>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::size_type | size_t size_type; // ... // }; #include #include template struct A { typedef T value_type; typedef unsigned short size_type; }; template struct B { typedef T value_type; }; int main() { static_assert((std::is_same >::size_type, unsigned short>::value), ""); static_assert((std::is_same >::size_type, std::size_t>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/void_pointer.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/void_pointer.pass.cpp index 4efa5ab8061..e08dd388b4f 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/void_pointer.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator.traits.types/void_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::void_pointer // | pointer_traits::rebind // void_pointer; // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; template struct CPtr {}; template struct C { typedef T value_type; typedef CPtr void_pointer; }; int main() { static_assert((std::is_same >::void_pointer, Ptr >::value), ""); static_assert((std::is_same >::void_pointer, void*>::value), ""); static_assert((std::is_same >::void_pointer, CPtr >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc::void_pointer // | pointer_traits::rebind // void_pointer; // ... // }; #include #include template struct Ptr {}; template struct A { typedef T value_type; typedef Ptr pointer; }; template struct B { typedef T value_type; }; template struct CPtr {}; template struct C { typedef T value_type; typedef CPtr void_pointer; }; int main() { static_assert((std::is_same >::void_pointer, Ptr >::value), ""); static_assert((std::is_same >::void_pointer, void*>::value), ""); static_assert((std::is_same >::void_pointer, CPtr >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/allocator_type.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/allocator_type.pass.cpp index 0c8a21e95c0..df2539a3a33 100644 --- a/libcxx/test/utilities/memory/allocator.traits/allocator_type.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/allocator_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc allocator_type; // ... // }; #include #include template struct A { typedef T value_type; }; int main() { static_assert((std::is_same >::allocator_type, A >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef Alloc allocator_type; // ... // }; #include #include template struct A { typedef T value_type; }; int main() { static_assert((std::is_same >::allocator_type, A >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/rebind_traits.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/rebind_traits.pass.cpp index 9605a12faa6..6a4dd13df80 100644 --- a/libcxx/test/utilities/memory/allocator.traits/rebind_traits.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/rebind_traits.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template using rebind_traits = allocator_traits>; // ... // }; #include #include template struct ReboundA {}; template struct A { typedef T value_type; template struct rebind {typedef ReboundA other;}; }; template struct ReboundB {}; template struct B { typedef T value_type; template struct rebind {typedef ReboundB other;}; }; template struct C { typedef T value_type; }; template struct D { typedef T value_type; }; template struct E { typedef T value_type; template struct rebind {typedef ReboundA otter;}; }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); #else static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // template using rebind_traits = allocator_traits>; // ... // }; #include #include template struct ReboundA {}; template struct A { typedef T value_type; template struct rebind {typedef ReboundA other;}; }; template struct ReboundB {}; template struct B { typedef T value_type; template struct rebind {typedef ReboundB other;}; }; template struct C { typedef T value_type; }; template struct D { typedef T value_type; }; template struct E { typedef T value_type; template struct rebind {typedef ReboundA otter;}; }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); #else static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.traits/value_type.pass.cpp b/libcxx/test/utilities/memory/allocator.traits/value_type.pass.cpp index 9070ed2aa88..20015088451 100644 --- a/libcxx/test/utilities/memory/allocator.traits/value_type.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.traits/value_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef typename Alloc::value_type value_type; // ... // }; #include #include template struct A { typedef T value_type; }; int main() { static_assert((std::is_same >::value_type, char>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct allocator_traits // { // typedef typename Alloc::value_type value_type; // ... // }; #include #include template struct A { typedef T value_type; }; int main() { static_assert((std::is_same >::value_type, char>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.uses/allocator.uses.construction/tested_elsewhere.pass.cpp b/libcxx/test/utilities/memory/allocator.uses/allocator.uses.construction/tested_elsewhere.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/allocator.uses/allocator.uses.construction/tested_elsewhere.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.uses/allocator.uses.construction/tested_elsewhere.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp b/libcxx/test/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp index 12b140604de..23aa45e31bb 100644 --- a/libcxx/test/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template struct uses_allocator; #include #include struct A { }; struct B { typedef int allocator_type; }; int main() { static_assert((!std::uses_allocator >::value), ""); static_assert(( std::uses_allocator, std::allocator >::value), ""); static_assert((!std::uses_allocator >::value), ""); static_assert((!std::uses_allocator >::value), ""); static_assert(( std::uses_allocator::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template struct uses_allocator; #include #include struct A { }; struct B { typedef int allocator_type; }; int main() { static_assert((!std::uses_allocator >::value), ""); static_assert(( std::uses_allocator, std::allocator >::value), ""); static_assert((!std::uses_allocator >::value), ""); static_assert((!std::uses_allocator >::value), ""); static_assert(( std::uses_allocator::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/allocator.uses/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/allocator.uses/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/allocator.uses/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/allocator.uses/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/c.malloc/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/c.malloc/nothing_to_do.pass.cpp index 4c1f61cab18..27846cf94e6 100644 --- a/libcxx/test/utilities/memory/c.malloc/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/c.malloc/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // and are already tested elsewhere int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // and are already tested elsewhere int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator.globals/eq.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator.globals/eq.pass.cpp index fd462640f83..49d39da4034 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator.globals/eq.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator.globals/eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // template // bool // operator==(const allocator&, const allocator&) throw(); // // template // bool // operator!=(const allocator&, const allocator&) throw(); #include #include int main() { std::allocator a1; std::allocator a2; assert(a1 == a2); assert(!(a1 != a2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // template // bool // operator==(const allocator&, const allocator&) throw(); // // template // bool // operator!=(const allocator&, const allocator&) throw(); #include #include int main() { std::allocator a1; std::allocator a2; assert(a1 == a2); assert(!(a1 != a2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator.members/address.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator.members/address.pass.cpp index a434c7e5b56..c14607f6cfb 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator.members/address.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator.members/address.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // pointer address(reference x) const; // const_pointer address(const_reference x) const; #include #include template void test_address() { T* tp = new T(); const T* ctp = tp; const std::allocator a; assert(a.address(*tp) == tp); assert(a.address(*ctp) == tp); delete tp; } struct A { void operator&() const {} }; int main() { test_address(); test_address(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // pointer address(reference x) const; // const_pointer address(const_reference x) const; #include #include template void test_address() { T* tp = new T(); const T* ctp = tp; const std::allocator a; assert(a.address(*tp) == tp); assert(a.address(*ctp) == tp); delete tp; } struct A { void operator&() const {} }; int main() { test_address(); test_address(); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp index 9856770a5f0..161d3835b3f 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // pointer allocate(size_type n, allocator::const_pointer hint=0); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; assert(s == 3 * sizeof(int)); return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } int A_constructed = 0; struct A { int data; A() {++A_constructed;} A(const A&) {++A_constructed;} ~A() {--A_constructed;} }; int main() { std::allocator a; assert(new_called == 0); assert(A_constructed == 0); A* ap = a.allocate(3); assert(new_called == 1); assert(A_constructed == 0); a.deallocate(ap, 3); assert(new_called == 0); assert(A_constructed == 0); A* ap2 = a.allocate(3, (const void*)5); assert(new_called == 1); assert(A_constructed == 0); a.deallocate(ap2, 3); assert(new_called == 0); assert(A_constructed == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // pointer allocate(size_type n, allocator::const_pointer hint=0); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; assert(s == 3 * sizeof(int)); return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } int A_constructed = 0; struct A { int data; A() {++A_constructed;} A(const A&) {++A_constructed;} ~A() {--A_constructed;} }; int main() { std::allocator a; assert(new_called == 0); assert(A_constructed == 0); A* ap = a.allocate(3); assert(new_called == 1); assert(A_constructed == 0); a.deallocate(ap, 3); assert(new_called == 0); assert(A_constructed == 0); A* ap2 = a.allocate(3, (const void*)5); assert(new_called == 1); assert(A_constructed == 0); a.deallocate(ap2, 3); assert(new_called == 0); assert(A_constructed == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp index 6718d10b1f6..bf6e20ab1f6 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator.members/construct.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // template void construct(pointer p, Args&&... args); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; assert(s == 3 * sizeof(int)); return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } int A_constructed = 0; struct A { int data; A() {++A_constructed;} A(const A&) {++A_constructed;} explicit A(int) {++A_constructed;} A(int, int*) {++A_constructed;} ~A() {--A_constructed;} }; int move_only_constructed = 0; class move_only { int data; #ifdef _LIBCPP_MOVE move_only(const move_only&); move_only& operator=(const move_only&); #else move_only(move_only&); move_only& operator=(move_only&); #endif public: #ifdef _LIBCPP_MOVE move_only(move_only&&) {++move_only_constructed;} move_only& operator=(move_only&&) {} #else operator std::__rv () {return std::__rv(*this);} move_only(std::__rv) {++move_only_constructed;} #endif move_only() {++move_only_constructed;} ~move_only() {--move_only_constructed;} }; int main() { { std::allocator a; assert(new_called == 0); assert(A_constructed == 0); A* ap = a.allocate(3); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap, A()); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap, 5); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap, 5, (int*)0); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.deallocate(ap, 3); assert(new_called == 0); assert(A_constructed == 0); } { std::allocator a; assert(new_called == 0); assert(move_only_constructed == 0); move_only* ap = a.allocate(3); assert(new_called == 1); assert(move_only_constructed == 0); a.construct(ap); assert(new_called == 1); assert(move_only_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(move_only_constructed == 0); a.construct(ap, move_only()); assert(new_called == 1); assert(move_only_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(move_only_constructed == 0); a.deallocate(ap, 3); assert(new_called == 0); assert(move_only_constructed == 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // template void construct(pointer p, Args&&... args); #include #include #include #include int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; assert(s == 3 * sizeof(int)); return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } int A_constructed = 0; struct A { int data; A() {++A_constructed;} A(const A&) {++A_constructed;} explicit A(int) {++A_constructed;} A(int, int*) {++A_constructed;} ~A() {--A_constructed;} }; int move_only_constructed = 0; class move_only { int data; #ifdef _LIBCPP_MOVE move_only(const move_only&); move_only& operator=(const move_only&); #else move_only(move_only&); move_only& operator=(move_only&); #endif public: #ifdef _LIBCPP_MOVE move_only(move_only&&) {++move_only_constructed;} move_only& operator=(move_only&&) {} #else operator std::__rv () {return std::__rv(*this);} move_only(std::__rv) {++move_only_constructed;} #endif move_only() {++move_only_constructed;} ~move_only() {--move_only_constructed;} }; int main() { { std::allocator a; assert(new_called == 0); assert(A_constructed == 0); A* ap = a.allocate(3); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap, A()); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap, 5); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.construct(ap, 5, (int*)0); assert(new_called == 1); assert(A_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(A_constructed == 0); a.deallocate(ap, 3); assert(new_called == 0); assert(A_constructed == 0); } { std::allocator a; assert(new_called == 0); assert(move_only_constructed == 0); move_only* ap = a.allocate(3); assert(new_called == 1); assert(move_only_constructed == 0); a.construct(ap); assert(new_called == 1); assert(move_only_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(move_only_constructed == 0); a.construct(ap, move_only()); assert(new_called == 1); assert(move_only_constructed == 1); a.destroy(ap); assert(new_called == 1); assert(move_only_constructed == 0); a.deallocate(ap, 3); assert(new_called == 0); assert(move_only_constructed == 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp index b6736ec3530..eb596f42f2c 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // size_type max_size() const throw(); #include #include #include #include int new_called = 0; int main() { const std::allocator a; std::size_t M = a.max_size() * sizeof(int); assert(M > 0xFFFF && M <= std::numeric_limits::max()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // allocator: // size_type max_size() const throw(); #include #include #include #include int new_called = 0; int main() { const std::allocator a; std::size_t M = a.max_size() * sizeof(int); assert(M > 0xFFFF && M <= std::numeric_limits::max()); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator_types.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator_types.pass.cpp index e3ac76514a7..7ee46ff06fc 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator_types.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator_types.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // check nested types: // template // class allocator // { // public: // typedef size_t size_type; // typedef ptrdiff_t difference_type; // typedef T* pointer; // typedef const T* const_pointer; // typedef typename add_lvalue_reference::type reference; // typedef typename add_lvalue_reference::type const_reference; // typedef T value_type; // // template struct rebind {typedef allocator other;}; // ... // }; #include #include #include int main() { static_assert((std::is_same::size_type, std::size_t>::value), ""); static_assert((std::is_same::difference_type, std::ptrdiff_t>::value), ""); static_assert((std::is_same::pointer, char*>::value), ""); static_assert((std::is_same::const_pointer, const char*>::value), ""); static_assert((std::is_same::value_type, char>::value), ""); static_assert((std::is_same::reference, char&>::value), ""); static_assert((std::is_same::const_reference, const char&>::value), ""); static_assert((std::is_same::rebind::other, std::allocator >::value), ""); std::allocator a; std::allocator a2 = a; a2 = a; std::allocator a3 = a2; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // check nested types: // template // class allocator // { // public: // typedef size_t size_type; // typedef ptrdiff_t difference_type; // typedef T* pointer; // typedef const T* const_pointer; // typedef typename add_lvalue_reference::type reference; // typedef typename add_lvalue_reference::type const_reference; // typedef T value_type; // // template struct rebind {typedef allocator other;}; // ... // }; #include #include #include int main() { static_assert((std::is_same::size_type, std::size_t>::value), ""); static_assert((std::is_same::difference_type, std::ptrdiff_t>::value), ""); static_assert((std::is_same::pointer, char*>::value), ""); static_assert((std::is_same::const_pointer, const char*>::value), ""); static_assert((std::is_same::value_type, char>::value), ""); static_assert((std::is_same::reference, char&>::value), ""); static_assert((std::is_same::const_reference, const char&>::value), ""); static_assert((std::is_same::rebind::other, std::allocator >::value), ""); std::allocator a; std::allocator a2 = a; a2 = a; std::allocator a3 = a2; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/default.allocator/allocator_void.pass.cpp b/libcxx/test/utilities/memory/default.allocator/allocator_void.pass.cpp index 9d948fbb82d..79b0690f3a9 100644 --- a/libcxx/test/utilities/memory/default.allocator/allocator_void.pass.cpp +++ b/libcxx/test/utilities/memory/default.allocator/allocator_void.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template <> // class allocator // { // public: // typedef void* pointer; // typedef const void* const_pointer; // typedef void value_type; // // template struct rebind {typedef allocator<_Up> other;}; // }; #include #include int main() { static_assert((std::is_same::pointer, void*>::value), ""); static_assert((std::is_same::const_pointer, const void*>::value), ""); static_assert((std::is_same::value_type, void>::value), ""); static_assert((std::is_same::rebind::other, std::allocator >::value), ""); std::allocator a; std::allocator a2 = a; a2 = a; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template <> // class allocator // { // public: // typedef void* pointer; // typedef const void* const_pointer; // typedef void value_type; // // template struct rebind {typedef allocator<_Up> other;}; // }; #include #include int main() { static_assert((std::is_same::pointer, void*>::value), ""); static_assert((std::is_same::const_pointer, const void*>::value), ""); static_assert((std::is_same::value_type, void>::value), ""); static_assert((std::is_same::rebind::other, std::allocator >::value), ""); std::allocator a; std::allocator a2 = a; a2 = a; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp index 23a5b47d6ac..f28e42f28bd 100644 --- a/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/difference_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef ptrdiff_t difference_type; // ... // }; #include #include int main() { static_assert((std::is_same::difference_type, std::ptrdiff_t>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef ptrdiff_t difference_type; // ... // }; #include #include int main() { static_assert((std::is_same::difference_type, std::ptrdiff_t>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp index e329842e917..e944dc8ff35 100644 --- a/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/element_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef T element_type; // ... // }; #include #include int main() { static_assert((std::is_same::element_type, const short>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef T element_type; // ... // }; #include #include int main() { static_assert((std::is_same::element_type, const short>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp index 898a54a64e3..34fa69454ab 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef Ptr pointer; // ... // }; #include #include struct A { typedef short element_type; typedef char difference_type; }; int main() { static_assert((std::is_same::pointer, A>::value), ""); static_assert((std::is_same::pointer, int*>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef Ptr pointer; // ... // }; #include #include struct A { typedef short element_type; typedef char difference_type; }; int main() { static_assert((std::is_same::pointer, A>::value), ""); static_assert((std::is_same::pointer, int*>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp index c43fbf6eb21..8ed66297f31 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // static pointer pointer_to(
); // ... // }; #include #include template struct A { private: struct nat {}; public: typedef T element_type; element_type* t_; A(element_type* t) : t_(t) {} static A pointer_to(typename std::conditional::value, nat, element_type>::type& et) {return A(&et);} }; int main() { { int i = 0; A a = std::pointer_traits >::pointer_to(i); assert(a.t_ = &i); } { (std::pointer_traits >::element_type)0; } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // static pointer pointer_to(
); // ... // }; #include #include template struct A { private: struct nat {}; public: typedef T element_type; element_type* t_; A(element_type* t) : t_(t) {} static A pointer_to(typename std::conditional::value, nat, element_type>::type& et) {return A(&et);} }; int main() { { int i = 0; A a = std::pointer_traits >::pointer_to(i); assert(a.t_ = &i); } { (std::pointer_traits >::element_type)0; } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp index baa3538c366..e2a78d1ddfa 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/difference_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef
difference_type; // ... // }; #include #include struct A { typedef short element_type; typedef char difference_type; }; struct B { typedef short element_type; }; template struct C {}; template struct D { typedef char difference_type; }; int main() { static_assert((std::is_same::difference_type, char>::value), ""); static_assert((std::is_same::difference_type, std::ptrdiff_t>::value), ""); static_assert((std::is_same >::difference_type, std::ptrdiff_t>::value), ""); static_assert((std::is_same >::difference_type, char>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef
difference_type; // ... // }; #include #include struct A { typedef short element_type; typedef char difference_type; }; struct B { typedef short element_type; }; template struct C {}; template struct D { typedef char difference_type; }; int main() { static_assert((std::is_same::difference_type, char>::value), ""); static_assert((std::is_same::difference_type, std::ptrdiff_t>::value), ""); static_assert((std::is_same >::difference_type, std::ptrdiff_t>::value), ""); static_assert((std::is_same >::difference_type, char>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp index defdb996243..ca464370c6e 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/element_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef
element_type; // ... // }; #include #include struct A { typedef char element_type; }; template struct B { typedef char element_type; }; template struct C { }; template struct D { }; int main() { static_assert((std::is_same::element_type, char>::value), ""); static_assert((std::is_same >::element_type, char>::value), ""); static_assert((std::is_same >::element_type, int>::value), ""); static_assert((std::is_same >::element_type, double>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // typedef
element_type; // ... // }; #include #include struct A { typedef char element_type; }; template struct B { typedef char element_type; }; template struct C { }; template struct D { }; int main() { static_assert((std::is_same::element_type, char>::value), ""); static_assert((std::is_same >::element_type, char>::value), ""); static_assert((std::is_same >::element_type, int>::value), ""); static_assert((std::is_same >::element_type, double>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp index 19178c53330..ca8a3a27629 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.types/rebind.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // template using rebind =
; // ... // }; #include #include template struct A { }; template struct B1 {}; template struct B { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind = B1; #else template struct rebind {typedef B1 other;}; #endif }; template struct C { }; template struct D1 {}; template struct D { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind = D1; #else template struct rebind {typedef D1 other;}; #endif }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind, A >::value), ""); static_assert((std::is_same >::rebind, B1 >::value), ""); static_assert((std::is_same >::rebind, C >::value), ""); static_assert((std::is_same >::rebind, D1 >::value), ""); #else static_assert((std::is_same >::rebind::other, A >::value), ""); static_assert((std::is_same >::rebind::other, B1 >::value), ""); static_assert((std::is_same >::rebind::other, C >::value), ""); static_assert((std::is_same >::rebind::other, D1 >::value), ""); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // template using rebind =
; // ... // }; #include #include template struct A { }; template struct B1 {}; template struct B { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind = B1; #else template struct rebind {typedef B1 other;}; #endif }; template struct C { }; template struct D1 {}; template struct D { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind = D1; #else template struct rebind {typedef D1 other;}; #endif }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind, A >::value), ""); static_assert((std::is_same >::rebind, B1 >::value), ""); static_assert((std::is_same >::rebind, C >::value), ""); static_assert((std::is_same >::rebind, D1 >::value), ""); #else static_assert((std::is_same >::rebind::other, A >::value), ""); static_assert((std::is_same >::rebind::other, B1 >::value), ""); static_assert((std::is_same >::rebind::other, C >::value), ""); static_assert((std::is_same >::rebind::other, D1 >::value), ""); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp index 28dc3f2c33a..42fd9300b7d 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer_to.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // static pointer pointer_to(
); // ... // }; #include #include int main() { { int i = 0; int* a = std::pointer_traits::pointer_to(i); assert(a = &i); } { (std::pointer_traits::element_type)0; } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // static pointer pointer_to(
); // ... // }; #include #include int main() { { int i = 0; int* a = std::pointer_traits::pointer_to(i); assert(a = &i); } { (std::pointer_traits::element_type)0; } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp index c60cbd4ff59..f63c03521a0 100644 --- a/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/rebind.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // template using rebind = U*; // ... // }; #include #include int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same::rebind, double*>::value), ""); #else static_assert((std::is_same::rebind::other, double*>::value), ""); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // template using rebind = U*; // ... // }; #include #include int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same::rebind, double*>::value), ""); #else static_assert((std::is_same::rebind::other, double*>::value), ""); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/ptr.align/align.pass.cpp b/libcxx/test/utilities/memory/ptr.align/align.pass.cpp index 85558dafe1e..5c847c15b97 100644 --- a/libcxx/test/utilities/memory/ptr.align/align.pass.cpp +++ b/libcxx/test/utilities/memory/ptr.align/align.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/specialized.algorithms/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/specialized.algorithms/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/specialized.algorithms/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp index 3eb092820e9..c4b14d3160c 100644 --- a/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp +++ b/libcxx/test/utilities/memory/specialized.algorithms/specialized.addressof/addressof.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template T* addressof(T& r); #include #include struct A { void operator&() const {} }; int main() { int i; double d; assert(std::addressof(i) == &i); assert(std::addressof(d) == &d); A* tp = new A; const A* ctp = tp; assert(std::addressof(*tp) == tp); assert(std::addressof(*ctp) == tp); delete tp; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template T* addressof(T& r); #include #include struct A { void operator&() const {} }; int main() { int i; double d; assert(std::addressof(i) == &i); assert(std::addressof(d) == &d); A* tp = new A; const A* ctp = tp; assert(std::addressof(*tp) == tp); assert(std::addressof(*ctp) == tp); delete tp; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp index dd94c51e71d..d592386557a 100644 --- a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp +++ b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // ForwardIterator // uninitialized_copy(InputIterator first, InputIterator last, // ForwardIterator result); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; B b[N]; try { std::uninitialized_copy(b, b+N, bp); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_copy(b, b+2, bp); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // ForwardIterator // uninitialized_copy(InputIterator first, InputIterator last, // ForwardIterator result); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; B b[N]; try { std::uninitialized_copy(b, b+N, bp); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_copy(b, b+2, bp); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp index 0bc3e25061f..0971c61b402 100644 --- a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp +++ b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // ForwardIterator // uninitialized_copy_n(InputIterator first, Size n, // ForwardIterator result); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; B b[N]; try { std::uninitialized_copy_n(b, 5, bp); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_copy_n(b, 2, bp); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // ForwardIterator // uninitialized_copy_n(InputIterator first, Size n, // ForwardIterator result); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; B b[N]; try { std::uninitialized_copy_n(b, 5, bp); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_copy_n(b, 2, bp); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp index 03578593b07..15518e00f71 100644 --- a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp +++ b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // void // uninitialized_fill_n(ForwardIterator first, Size n, const T& x); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; try { std::uninitialized_fill_n(bp, 5, B()); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_fill_n(bp, 2, B()); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // void // uninitialized_fill_n(ForwardIterator first, Size n, const T& x); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; try { std::uninitialized_fill_n(bp, 5, B()); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_fill_n(bp, 2, B()); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp index 843eece33e4..eaaa6ca8188 100644 --- a/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp +++ b/libcxx/test/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // void // uninitialized_fill(ForwardIterator first, ForwardIterator last, // const T& x); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; try { std::uninitialized_fill(bp, bp+N, B()); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_fill(bp, bp+2, B()); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // void // uninitialized_fill(ForwardIterator first, ForwardIterator last, // const T& x); #include #include struct B { static int count_; int data_; explicit B() : data_(1) {} B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;} ~B() {data_ = 0;} }; int B::count_ = 0; int main() { const int N = 5; char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; try { std::uninitialized_fill(bp, bp+N, B()); assert(false); } catch (...) { for (int i = 0; i < N; ++i) assert(bp[i].data_ == 0); } B::count_ = 0; std::uninitialized_fill(bp, bp+2, B()); for (int i = 0; i < 2; ++i) assert(bp[i].data_ == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp b/libcxx/test/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp index 8e3f14509f2..3f356890915 100644 --- a/libcxx/test/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp +++ b/libcxx/test/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // raw_storage_iterator #include #include #include int A_constructed = 0; struct A { int data_; public: explicit A(int i) : data_(i) {++A_constructed;} A(const A& a) : data_(a.data_) {++A_constructed;} ~A() {--A_constructed; data_ = 0;} bool operator==(int i) const {return data_ == i;} }; int main() { typedef std::aligned_storage<3*sizeof(A), std::alignment_of::value>::type Storage; Storage buffer; std::raw_storage_iterator it((A*)&buffer); assert(A_constructed == 0); for (int i = 0; i < 3; ++i) { *it++ = A(i+1); A* ap = (A*)&buffer + i; assert(*ap == i+1); assert(A_constructed == i+1); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // raw_storage_iterator #include #include #include int A_constructed = 0; struct A { int data_; public: explicit A(int i) : data_(i) {++A_constructed;} A(const A& a) : data_(a.data_) {++A_constructed;} ~A() {--A_constructed; data_ = 0;} bool operator==(int i) const {return data_ == i;} }; int main() { typedef std::aligned_storage<3*sizeof(A), std::alignment_of::value>::type Storage; Storage buffer; std::raw_storage_iterator it((A*)&buffer); assert(A_constructed == 0); for (int i = 0; i < 3; ++i) { *it++ = A(i+1); A* ap = (A*)&buffer + i; assert(*ap == i+1); assert(A_constructed == i+1); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp b/libcxx/test/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp index 40beea8ff42..129bae834b9 100644 --- a/libcxx/test/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp +++ b/libcxx/test/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // pair // get_temporary_buffer(ptrdiff_t n); // // template // void // return_temporary_buffer(T* p); #include #include int main() { std::pair ip = std::get_temporary_buffer(5); assert(ip.first); assert(ip.second == 5); std::return_temporary_buffer(ip.first); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // pair // get_temporary_buffer(ptrdiff_t n); // // template // void // return_temporary_buffer(T* p); #include #include int main() { std::pair ip = std::get_temporary_buffer(5); assert(ip.first); assert(ip.second == 5); std::return_temporary_buffer(ip.first); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/deleter.h b/libcxx/test/utilities/memory/unique.ptr/deleter.h index 6c5c9a4b1f4..df8b894e1e2 100644 --- a/libcxx/test/utilities/memory/unique.ptr/deleter.h +++ b/libcxx/test/utilities/memory/unique.ptr/deleter.h @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Example move-only deleter #ifndef DELETER_H #define DELETER_H #include #include template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(0) {} explicit Deleter(int s) : state_(s) {} ~Deleter() {assert(state_ >= 0); state_ = -1;} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(0) {} explicit Deleter(int s) : state_(s) {} ~Deleter() {assert(state_ >= 0); state_ = -1;} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete [] p;} }; template void swap(Deleter& x, Deleter& y) { Deleter t(std::move(x)); x = std::move(y); y = std::move(t); } template class CDeleter { int state_; public: CDeleter() : state_(0) {} explicit CDeleter(int s) : state_(s) {} ~CDeleter() {assert(state_ >= 0); state_ = -1;} template CDeleter(const CDeleter& d) : state_(d.state()) {} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; template class CDeleter { int state_; public: CDeleter() : state_(0) {} explicit CDeleter(int s) : state_(s) {} ~CDeleter() {assert(state_ >= 0); state_ = -1;} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete [] p;} }; template void swap(CDeleter& x, CDeleter& y) { CDeleter t(std::move(x)); x = std::move(y); y = std::move(t); } #endif \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Example move-only deleter #ifndef DELETER_H #define DELETER_H #include #include template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(0) {} explicit Deleter(int s) : state_(s) {} ~Deleter() {assert(state_ >= 0); state_ = -1;} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(0) {} explicit Deleter(int s) : state_(s) {} ~Deleter() {assert(state_ >= 0); state_ = -1;} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete [] p;} }; template void swap(Deleter& x, Deleter& y) { Deleter t(std::move(x)); x = std::move(y); y = std::move(t); } template class CDeleter { int state_; public: CDeleter() : state_(0) {} explicit CDeleter(int s) : state_(s) {} ~CDeleter() {assert(state_ >= 0); state_ = -1;} template CDeleter(const CDeleter& d) : state_(d.state()) {} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; template class CDeleter { int state_; public: CDeleter() : state_(0) {} explicit CDeleter(int s) : state_(s) {} ~CDeleter() {assert(state_ >= 0); state_ = -1;} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete [] p;} }; template void swap(CDeleter& x, CDeleter& y) { CDeleter t(std::move(x)); x = std::move(y); y = std::move(t); } #endif \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/unique.ptr/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp index 4fe3a66cbdb..c96b5b980ba 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { std::default_delete d2; std::default_delete d1 = d2; A* p = new B; assert(A::count == 1); assert(B::count == 1); d1(p); assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { std::default_delete d2; std::default_delete d1 = d2; A* p = new B; assert(A::count == 1); assert(B::count == 1); d1(p); assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp index 26bd82a5320..5f033a36893 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { std::default_delete d; A* p = new A; assert(A::count == 1); d(p); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { std::default_delete d; A* p = new A; assert(A::count == 1); d(p); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp index f259c7cb568..a1662526860 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete's operator() requires a complete type #include #include struct A; int main() { std::default_delete d; A* p = 0; d(p); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete's operator() requires a complete type #include #include struct A; int main() { std::default_delete d; A* p = 0; d(p); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp index 7084e3403a0..e1248de8712 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete does not have a working converting constructor #include #include struct A { }; struct B : public A { }; int main() { std::default_delete d2; std::default_delete d1 = d2; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete does not have a working converting constructor #include #include struct A { }; struct B : public A { }; int main() { std::default_delete d2; std::default_delete d1 = d2; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp index e83346e288b..1b41e961912 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete has a working default constructor #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { std::default_delete d; A* p = new A[3]; assert(A::count == 3); d(p); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete has a working default constructor #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { std::default_delete d; A* p = new A[3]; assert(A::count == 3); d(p); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp index 120306fb877..6fcb94c5637 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete's operator() requires a complete type #include #include struct A; int main() { std::default_delete d; A* p = 0; d(p); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // default_delete // Test that default_delete's operator() requires a complete type #include #include struct A; int main() { std::default_delete d; A* p = 0; d(p); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp index cd29056f142..6360686f745 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A); std::unique_ptr s2; s2 = s; } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A); std::unique_ptr s2; s2 = s; } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp index 2524f3b3311..dfd6a7136ae 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment // test move assignment. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s1(new A[3]); A* p = s1.get(); assert(A::count == 3); std::unique_ptr s2(new A[2]); assert(A::count == 5); s2 = std::move(s1); assert(A::count == 3); assert(s2.get() == p); assert(s1.get() == 0); } assert(A::count == 0); { std::unique_ptr > s1(new A[4], Deleter(5)); A* p = s1.get(); assert(A::count == 4); std::unique_ptr > s2(new A[5]); assert(A::count == 9); s2 = std::move(s1); assert(s2.get() == p); assert(s1.get() == 0); assert(A::count == 4); assert(s2.get_deleter().state() == 5); assert(s1.get_deleter().state() == 0); } assert(A::count == 0); { CDeleter d1(5); std::unique_ptr&> s1(new A[6], d1); A* p = s1.get(); assert(A::count == 6); CDeleter d2(6); std::unique_ptr&> s2(new A[3], d2); assert(A::count == 9); s2 = std::move(s1); assert(A::count == 6); assert(s2.get() == p); assert(s1.get() == 0); assert(d1.state() == 5); assert(d2.state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment // test move assignment. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s1(new A[3]); A* p = s1.get(); assert(A::count == 3); std::unique_ptr s2(new A[2]); assert(A::count == 5); s2 = std::move(s1); assert(A::count == 3); assert(s2.get() == p); assert(s1.get() == 0); } assert(A::count == 0); { std::unique_ptr > s1(new A[4], Deleter(5)); A* p = s1.get(); assert(A::count == 4); std::unique_ptr > s2(new A[5]); assert(A::count == 9); s2 = std::move(s1); assert(s2.get() == p); assert(s1.get() == 0); assert(A::count == 4); assert(s2.get_deleter().state() == 5); assert(s1.get_deleter().state() == 0); } assert(A::count == 0); { CDeleter d1(5); std::unique_ptr&> s1(new A[6], d1); A* p = s1.get(); assert(A::count == 6); CDeleter d2(6); std::unique_ptr&> s2(new A[3], d2); assert(A::count == 9); s2 = std::move(s1); assert(A::count == 6); assert(s2.get() == p); assert(s1.get() == 0); assert(d1.state() == 5); assert(d2.state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp index 030a53c4bfd..5e1e5f81483 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A[3]); std::unique_ptr s2; s2 = s; } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A[3]); std::unique_ptr s2; s2 = s; } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp index 2c2fdd96e82..594704f2a83 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp index dc0b46eedf1..89267738d13 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp index 0d7cfe8bfcb..45196b630fb 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp index 7a741375f64..9831ab2283b 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { boost::unique_ptr > s(new B); A* p = s.get(); boost::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { boost::unique_ptr > s(new B); A* p = s.get(); boost::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp index 84faeb3ed31..67e5f36435d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); boost::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); boost::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); boost::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); boost::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp index 81d7e498d1d..64aff20ef4a 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const boost::unique_ptr s(new B); A* p = s.get(); boost::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const boost::unique_ptr s(new B); A* p = s.get(); boost::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp index 704314663f6..96ef756e099 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const boost::unique_ptr > s(new B); A* p = s.get(); boost::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const boost::unique_ptr > s(new B); A* p = s.get(); boost::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp index 7ade7c8200e..5ecec761ae4 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); const boost::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); boost::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); const boost::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); boost::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp index cf5c6d11ac6..5e959134c66 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { boost::unique_ptr s(new B); A* p = s.get(); boost::unique_ptr s2(new A); assert(A::count == 2); s2 = boost::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { boost::unique_ptr s(new B); A* p = s.get(); boost::unique_ptr s2(new A); assert(A::count == 2); s2 = boost::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp index 2337053d66d..e408aae3f9d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { boost::unique_ptr > s(new B); A* p = s.get(); boost::unique_ptr > s2(new A); assert(A::count == 2); s2 = (boost::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { boost::unique_ptr > s(new B); A* p = s.get(); boost::unique_ptr > s2(new A); assert(A::count == 2); s2 = (boost::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp index a21e545aa87..a1328d62a6f 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // test converting move assignment with reference deleters #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); boost::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); boost::unique_ptr&> s2(new A, da); s2 = boost::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // test converting move assignment with reference deleters #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); boost::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); boost::unique_ptr&> s2(new A, da); s2 = boost::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp index be3292a41c4..da5d287e4c7 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A); assert(A::count == 1); s2 = 0; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A); assert(A::count == 1); s2 = 0; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp index d1331522458..31248d50912 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // The deleter is not called if get() == 0 #include #include class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(0) {} int state() const {return state_;} void operator()(void*) {++state_;} }; int main() { Deleter d; assert(d.state() == 0); { std::unique_ptr p(0, d); assert(p.get() == 0); assert(&p.get_deleter() == &d); } assert(d.state() == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // The deleter is not called if get() == 0 #include #include class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(0) {} int state() const {return state_;} void operator()(void*) {++state_;} }; int main() { Deleter d; assert(d.state() == 0); { std::unique_ptr p(0, d); assert(p.get() == 0); assert(&p.get_deleter() == &d); } assert(d.state() == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp index a4f5540f706..a168fdc01ca 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A[3]); assert(A::count == 3); s2 = nullptr; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A[3]); assert(A::count == 3); s2 = nullptr; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp index 9d0e40f2873..690237e5833 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr::pointer type #include #include struct Deleter { struct pointer {}; }; int main() { { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr::pointer type #include #include struct Deleter { struct pointer {}; }; int main() { { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp index ae9a0154a8f..4a8c0915405 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should require default Deleter ctor #include class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should require default Deleter ctor #include class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp index bf375a5cda5..280cfd235d6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should only require default Deleter ctor #include #include class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p; assert(p.get() == 0); } { std::unique_ptr p; assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should only require default Deleter ctor #include #include class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p; assert(p.get() == 0); } { std::unique_ptr p; assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp index 5edf3f8ee91..b94f9b9c24d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should require non-reference Deleter ctor #include class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should require non-reference Deleter ctor #include class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp index 5229a900515..41d143996af 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test default unique_ptr ctor // default unique_ptr ctor shouldn't require complete type #include #include struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; B(); ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; int main() { { B<> s; assert(s.get() == 0); } check(0); { B s; assert(s.get() == 0); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; void Deleter::operator()(A* p) {delete p;} void check(int i) { assert(A::count == i); } template B::B() {} template B::~B() {} \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test default unique_ptr ctor // default unique_ptr ctor shouldn't require complete type #include #include struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; B(); ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; int main() { { B<> s; assert(s.get() == 0); } check(0); { B s; assert(s.get() == 0); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; void Deleter::operator()(A* p) {delete p;} void check(int i) { assert(A::count == i); } template B::B() {} template B::~B() {} \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp index 7f8cc0f07bc..dfa0434ee70 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should require non-pointer Deleter #include int main() { std::unique_ptr p; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor // default unique_ptr ctor should require non-pointer Deleter #include int main() { std::unique_ptr p; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp index 72a7449c949..b9c23628c79 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp index 94363206583..f58b18f90dd 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class NCDeleter { int state_; NCDeleter(NCDeleter&); NCDeleter& operator=(NCDeleter&); public: NCDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; int main() { { std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 3); } assert(A::count == 0); { std::unique_ptr > s(new A[3], Deleter(5)); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 3); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); { NCDeleter d; std::unique_ptr s(new A[3], d); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 3); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class NCDeleter { int state_; NCDeleter(NCDeleter&); NCDeleter& operator=(NCDeleter&); public: NCDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; int main() { { std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 3); } assert(A::count == 0); { std::unique_ptr > s(new A[3], Deleter(5)); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 3); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); { NCDeleter d; std::unique_ptr s(new A[3], d); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 3); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp index 8c11b517cfd..9d387d97a01 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Can't copy from const lvalue #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Can't copy from const lvalue #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp index 4b0a5fd4ad7..0cf6da30b3f 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class NCDeleter { int state_; NCDeleter(NCDeleter&); NCDeleter& operator=(NCDeleter&); public: NCDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; std::unique_ptr source1() { return std::unique_ptr(new A[3]); } void sink1(std::unique_ptr p) { } std::unique_ptr > source2() { return std::unique_ptr >(new A[3]); } void sink2(std::unique_ptr > p) { } std::unique_ptr source3() { static NCDeleter d; return std::unique_ptr(new A[3], d); } void sink3(std::unique_ptr p) { } int main() { sink1(source1()); sink2(source2()); sink3(source3()); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class NCDeleter { int state_; NCDeleter(NCDeleter&); NCDeleter& operator=(NCDeleter&); public: NCDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; std::unique_ptr source1() { return std::unique_ptr(new A[3]); } void sink1(std::unique_ptr p) { } std::unique_ptr > source2() { return std::unique_ptr >(new A[3]); } void sink2(std::unique_ptr > p) { } std::unique_ptr source3() { static NCDeleter d; return std::unique_ptr(new A[3], d); } void sink3(std::unique_ptr p) { } int main() { sink1(source1()); sink2(source2()); sink3(source3()); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp index f2a8263b0d1..d3df6146625 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Can't copy from lvalue #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Can't copy from lvalue #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp index 8c77d475190..6d11937f567 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Can't copy from const lvalue #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { const std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor // test move ctor. Can't copy from const lvalue #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { const std::unique_ptr s(new A[3]); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp index 9f07dec9813..9a580449fdd 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp index 5217a866b87..86a2cf68ed6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp index 2e562d81c4c..9822dc2b3ba 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp index e2d24222949..b0a9bc71075 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp index d7d5e16c97b..983d6c8c51d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp index 6765031800d..ae87cfe2f56 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp index 136857df3d7..ce5883a9ad6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp index b65ad1fb3d0..3203f29e82f 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp index dabe4ac5e54..d2c5eb92224 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp index 780c392fc8c..ec576470bc1 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp index f16ea7b365f..f3c299c0bab 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp index 7b0a42cfb23..26b925da4a8 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp index 5a5d9177374..a6040720ef6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp index 96ae4bd7333..2b5b27c68c4 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp index abf31eb836f..ddcdb453a6b 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp index 0e4e64f046d..d9f4d99ad7e 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp index ab772bdc285..96ebb838013 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp index c54882bbbaa..2852c472e6d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp index e291d98258f..d0fdb9a2d9d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // unique_ptr(nullptr_t); #include #include // default unique_ptr ctor should only require default Deleter ctor class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p(nullptr); assert(p.get() == 0); } { std::unique_ptr p(nullptr); assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // unique_ptr(nullptr_t); #include #include // default unique_ptr ctor should only require default Deleter ctor class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p(nullptr); assert(p.get() == 0); } { std::unique_ptr p(nullptr); assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp index 1aabf2124b9..bdcd371b5be 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should require default Deleter ctor #include class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should require default Deleter ctor #include class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp index de0cd262dcf..25e41cace94 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should only require default Deleter ctor #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); std::unique_ptr s(p); assert(s.get() == p); } assert(A::count == 0); { A* p = new A[3]; assert(A::count == 3); std::unique_ptr s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should only require default Deleter ctor #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); std::unique_ptr s(p); assert(s.get() == p); } assert(A::count == 0); { A* p = new A[3]; assert(A::count == 3); std::unique_ptr s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp index aa01ffd51d5..8f3767dc5f7 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require non-reference Deleter ctor class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require non-reference Deleter ctor class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp index 4146d5684cb..f70f9851e10 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor shouldn't require complete type #include #include struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; explicit B(A*); ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; A* get(); int main() { { A* p = get(); check(3); B<> s(p); assert(s.get() == p); } check(0); { A* p = get(); check(3); B s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; A* get() {return new A[3];} void Deleter::operator()(A* p) {delete [] p;} void check(int i) { assert(A::count == i); } template B::B(A* a) : a_(a) {} template B::~B() {} \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor shouldn't require complete type #include #include struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; explicit B(A*); ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; A* get(); int main() { { A* p = get(); check(3); B<> s(p); assert(s.get() == p); } check(0); { A* p = get(); check(3); B s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; A* get() {return new A[3];} void Deleter::operator()(A* p) {delete [] p;} void check(int i) { assert(A::count == i); } template B::B(A* a) : a_(a) {} template B::~B() {} \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp index e826b997df9..35c1c764e46 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should require non-pointer Deleter #include int main() { std::unique_ptr p(new int); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should require non-pointer Deleter #include int main() { std::unique_ptr p(new int); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp index 6db86df129a..507610bb2ab 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should not work with derived pointers #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { B* p = new B[3]; std::unique_ptr s(p); } { B* p = new B[3]; std::unique_ptr s(p); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor // unique_ptr(pointer) ctor should not work with derived pointers #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { { B* p = new B[3]; std::unique_ptr s(p); } { B* p = new B[3]; std::unique_ptr s(p); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp index ab3899e04bd..4d27319f3ba 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, deleter()) only requires MoveConstructible deleter #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* p = new A[3]; assert(A::count == 3); std::unique_ptr > s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, deleter()) only requires MoveConstructible deleter #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* p = new A[3]; assert(A::count == 3); std::unique_ptr > s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp index 6bb16db0344..e25c5b1f8ea 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, d) requires CopyConstructible deleter #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, d) requires CopyConstructible deleter #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp index a5e7b93aaab..8f4594c5f78 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, d) does not requires CopyConstructible deleter #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 6); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, d) does not requires CopyConstructible deleter #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 6); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp index 8350829f7d5..42b84c174c5 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, D()) should not compile #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); std::unique_ptr s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, D()) should not compile #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); std::unique_ptr s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp index b9c8f83fe30..34b426e16d9 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, d) does not requires CopyConstructible deleter #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, d) does not requires CopyConstructible deleter #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete [] p;} }; int main() { { A* p = new A[3]; assert(A::count == 3); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp index 7c09b169107..66a314ae656 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, deleter) should not work with derived pointers #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { B* p = new B[3]; std::unique_ptr s(p, Deleter()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor // unique_ptr(pointer, deleter) should not work with derived pointers #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete [] p;} }; int main() { B* p = new B[3]; std::unique_ptr s(p, Deleter()); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp index d3cc0bfd4cf..1f80c9e5a1a 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test release #include #include int main() { std::unique_ptr p(new int[3]); int* i = p.get(); int* j = p.release(); assert(p.get() == 0); assert(i == j); delete [] j; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test release #include #include int main() { std::unique_ptr p(new int[3]); int* i = p.get(); int* j = p.release(); assert(p.get() == 0); assert(i == j); delete [] j; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp index 4753b027f86..1cbea933a87 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr p(new A[3]); assert(A::count == 3); A* i = p.get(); p.reset(); assert(A::count == 0); assert(p.get() == 0); } assert(A::count == 0); { std::unique_ptr p(new A[4]); assert(A::count == 4); A* i = p.get(); p.reset(new A[5]); assert(A::count == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr p(new A[3]); assert(A::count == 3); A* i = p.get(); p.reset(); assert(A::count == 0); assert(p.get() == 0); } assert(A::count == 0); { std::unique_ptr p(new A[4]); assert(A::count == 4); A* i = p.get(); p.reset(new A[5]); assert(A::count == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp index 8466a6c0a5d..43bb562e7f4 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr p(new A); assert(A::count == 1); assert(B::count == 0); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { std::unique_ptr p(new B); assert(A::count == 1); assert(B::count == 1); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr p(new A); assert(A::count == 1); assert(B::count == 0); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { std::unique_ptr p(new B); assert(A::count == 1); assert(B::count == 1); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp index 0c70ce79471..07eac0228b3 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test swap #include #include #include "../../deleter.h" struct A { int state_; static int count; A() : state_(0) {++count;} explicit A(int i) : state_(i) {++count;} A(const A& a) : state_(a.state_) {++count;} A& operator=(const A& a) {state_ = a.state_; return *this;} ~A() {--count;} friend bool operator==(const A& x, const A& y) {return x.state_ == y.state_;} }; int A::count = 0; int main() { { A* p1 = new A[3]; std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A[3]; std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(s2.get_deleter().state() == 2); s1.swap(s2); assert(s1.get() == p2); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(s2.get_deleter().state() == 1); assert(A::count == 6); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test swap #include #include #include "../../deleter.h" struct A { int state_; static int count; A() : state_(0) {++count;} explicit A(int i) : state_(i) {++count;} A(const A& a) : state_(a.state_) {++count;} A& operator=(const A& a) {state_ = a.state_; return *this;} ~A() {--count;} friend bool operator==(const A& x, const A& y) {return x.state_ == y.state_;} }; int A::count = 0; int main() { { A* p1 = new A[3]; std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A[3]; std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(s2.get_deleter().state() == 2); s1.swap(s2); assert(s1.get() == p2); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(s2.get_deleter().state() == 1); assert(A::count == 6); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp index 51747d1fdbf..5bfb4de49d0 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { std::unique_ptr p(new int(3)); assert(*p == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { std::unique_ptr p(new int(3)); assert(*p == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp index 23253858338..f3b7f01d829 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { { std::unique_ptr p(new int [3]); if (p) ; else assert(false); if (!p) assert(false); } { std::unique_ptr p; if (!p) ; else assert(false); if (p) assert(false); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { { std::unique_ptr p(new int [3]); if (p) ; else assert(false); if (!p) assert(false); } { std::unique_ptr p; if (!p) ; else assert(false); if (p) assert(false); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp index 74967938d3e..5ed1a201a3e 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get #include #include int main() { int* p = new int[3]; std::unique_ptr s(p); assert(s.get() == p); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get #include #include int main() { int* p = new int[3]; std::unique_ptr s(p); assert(s.get() == p); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp index 3f4ab3f078d..0d58c7ac2ce 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get_deleter() #include #include struct Deleter { void operator()(void*) {} int test() {return 5;} int test() const {return 6;} }; int main() { { std::unique_ptr p; assert(p.get_deleter().test() == 5); } { const std::unique_ptr p; assert(p.get_deleter().test() == 6); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get_deleter() #include #include struct Deleter { void operator()(void*) {} int test() {return 5;} int test() const {return 6;} }; int main() { { std::unique_ptr p; assert(p.get_deleter().test() == 5); } { const std::unique_ptr p; assert(p.get_deleter().test() == 6); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp index f8af29a2549..95ad2f26fb3 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op[](size_t) #include #include class A { int state_; static int next_; public: A() : state_(++next_) {} int get() const {return state_;} friend bool operator==(const A& x, int y) {return x.state_ == y;} A& operator=(int i) {state_ = i; return *this;} }; int A::next_ = 0; int main() { std::unique_ptr p(new A[3]); assert(p[0] == 1); assert(p[1] == 2); assert(p[2] == 3); p[0] = 3; p[1] = 2; p[2] = 1; assert(p[0] == 3); assert(p[1] == 2); assert(p[2] == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op[](size_t) #include #include class A { int state_; static int next_; public: A() : state_(++next_) {} int get() const {return state_;} friend bool operator==(const A& x, int y) {return x.state_ == y;} A& operator=(int i) {state_ = i; return *this;} }; int A::next_ = 0; int main() { std::unique_ptr p(new A[3]); assert(p[0] == 1); assert(p[1] == 2); assert(p[2] == 3); p[0] = 3; p[1] = 2; p[2] = 1; assert(p[0] == 3); assert(p[1] == 2); assert(p[2] == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp index 1defbc6b80a..f8973e17504 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op->() #include #include struct A { int i_; A() : i_(7) {} }; int main() { std::unique_ptr p(new A); assert(p->i_ == 7); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op->() #include #include struct A { int i_; A() : i_(7) {} }; int main() { std::unique_ptr p(new A); assert(p->i_ == 7); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp index d00f5b820d9..daa83841cd7 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr::pointer type #include #include struct Deleter { struct pointer {}; }; int main() { { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr::pointer type #include #include struct Deleter { struct pointer {}; }; int main() { { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } { typedef std::unique_ptr P; static_assert((std::is_same::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp index cd29056f142..6360686f745 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A); std::unique_ptr s2; s2 = s; } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A); std::unique_ptr s2; s2 = s; } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp index 99b7c5e5dd1..94c8b5b1581 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment // test move assignment. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s1(new A); A* p = s1.get(); std::unique_ptr s2(new A); assert(A::count == 2); s2 = std::move(s1); assert(A::count == 1); assert(s2.get() == p); assert(s1.get() == 0); } assert(A::count == 0); { std::unique_ptr > s1(new A, Deleter(5)); A* p = s1.get(); std::unique_ptr > s2(new A); assert(A::count == 2); s2 = std::move(s1); assert(s2.get() == p); assert(s1.get() == 0); assert(A::count == 1); assert(s2.get_deleter().state() == 5); assert(s1.get_deleter().state() == 0); } assert(A::count == 0); { CDeleter d1(5); std::unique_ptr&> s1(new A, d1); A* p = s1.get(); CDeleter d2(6); std::unique_ptr&> s2(new A, d2); s2 = std::move(s1); assert(s2.get() == p); assert(s1.get() == 0); assert(A::count == 1); assert(d1.state() == 5); assert(d2.state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment // test move assignment. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s1(new A); A* p = s1.get(); std::unique_ptr s2(new A); assert(A::count == 2); s2 = std::move(s1); assert(A::count == 1); assert(s2.get() == p); assert(s1.get() == 0); } assert(A::count == 0); { std::unique_ptr > s1(new A, Deleter(5)); A* p = s1.get(); std::unique_ptr > s2(new A); assert(A::count == 2); s2 = std::move(s1); assert(s2.get() == p); assert(s1.get() == 0); assert(A::count == 1); assert(s2.get_deleter().state() == 5); assert(s1.get_deleter().state() == 0); } assert(A::count == 0); { CDeleter d1(5); std::unique_ptr&> s1(new A, d1); A* p = s1.get(); CDeleter d2(6); std::unique_ptr&> s2(new A, d2); s2 = std::move(s1); assert(s2.get() == p); assert(s1.get() == 0); assert(A::count == 1); assert(d1.state() == 5); assert(d2.state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp index 0d47e023805..e245105ae40 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A); std::unique_ptr s2; s2 = s; } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A); std::unique_ptr s2; s2 = s; } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp index 2c2fdd96e82..594704f2a83 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp index dc0b46eedf1..89267738d13 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp index 4a7a278033c..dc9e6cc731e 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp index 9319ff880c2..68aa7be4f8d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(new A); assert(A::count == 2); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(new A); assert(A::count == 2); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp index c42dbf6db39..01cdc5754b2 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include #include "../../deleter.h" // Can't assign from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include #include "../../deleter.h" // Can't assign from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp index c2336e87993..97217d0ac42 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B, Deleter(5)); A* p = s.get(); std::unique_ptr > s2(new A); assert(A::count == 2); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B, Deleter(5)); A* p = s.get(); std::unique_ptr > s2(new A); assert(A::count == 2); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp index b9f49330a15..e5b5cb25418 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from lvalue #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); std::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); std::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from lvalue #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); std::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); std::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp index cfdf15de8f8..2c421dfe3e6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // test converting move assignment with reference deleters #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { CDeleter db(5); std::unique_ptr&> s(new B, db); A* p = s.get(); CDeleter da(6); std::unique_ptr&> s2(new A, da); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s.get_deleter().state() == 5); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // test converting move assignment with reference deleters #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { CDeleter db(5); std::unique_ptr&> s(new B, db); A* p = s.get(); CDeleter da(6); std::unique_ptr&> s2(new A, da); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s.get_deleter().state() == 5); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp index 79225233508..eef44ceb783 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment #include #include // Can't assign from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp index 3853b3f757b..d796ba36cf3 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2; s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp index 780e46d1d9c..0400cbdb7dd 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); const std::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); std::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Can't assign from const lvalue #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { Deleter db(5); const std::unique_ptr&> s(new B, db); A* p = s.get(); Deleter da(6); std::unique_ptr&> s2(new A, da); s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp index 35b91f578b5..7ec9e00ef79 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Do not convert from an array unique_ptr #include #include struct A { }; struct Deleter { void operator()(void*) {} }; int main() { std::unique_ptr s; std::unique_ptr s2; s2 = std::move(s); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move assignment // Do not convert from an array unique_ptr #include #include struct A { }; struct Deleter { void operator()(void*) {} }; int main() { std::unique_ptr s; std::unique_ptr s2; s2 = std::move(s); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp index be3292a41c4..da5d287e4c7 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A); assert(A::count == 1); s2 = 0; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A); assert(A::count == 1); s2 = 0; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp index b405b1a33d4..3000f7448db 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A); assert(A::count == 1); s2 = nullptr; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move assignment #include #include // test assignment from null struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s2(new A); assert(A::count == 1); s2 = nullptr; assert(A::count == 0); assert(s2.get() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp index 8b7e4975142..24a0d221003 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // template explicit unique_ptr(auto_ptr&); struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up; up = ap; assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up; up = std::move(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // template explicit unique_ptr(auto_ptr&); struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up; up = ap; assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up; up = std::move(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp index 4ca2a08f1be..a13af5b9d0b 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // template explicit unique_ptr(auto_ptr&); struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B // : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up; up = ap; assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // template explicit unique_ptr(auto_ptr&); struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B // : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up; up = ap; assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp index c3f955bcba9..9580723069b 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // template explicit unique_ptr(auto_ptr&); struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct Deleter { template void operator()(T*) {} }; int main() { { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // template explicit unique_ptr(auto_ptr&); struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct Deleter { template void operator()(T*) {} }; int main() { { B* p = new B; std::auto_ptr ap(p); std::unique_ptr up(ap); assert(up.get() == p); assert(ap.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp index c2b6a36b7a7..d9e9d479f52 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include // default unique_ptr ctor should require default Deleter ctor class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include // default unique_ptr ctor should require default Deleter ctor class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp index e78f6523844..e0178ba2f5d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include #include // default unique_ptr ctor should only require default Deleter ctor class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p; assert(p.get() == 0); } { std::unique_ptr p; assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include #include // default unique_ptr ctor should only require default Deleter ctor class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p; assert(p.get() == 0); } { std::unique_ptr p; assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp index d6ae0d742eb..1255c5c0c03 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include // default unique_ptr ctor should require non-reference Deleter ctor class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include // default unique_ptr ctor should require non-reference Deleter ctor class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp index 2542d8da135..90cf3752937 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test default unique_ptr ctor #include #include // default unique_ptr ctor shouldn't require complete type struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; B() {} ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; int main() { { B<> s; assert(s.get() == 0); } check(0); { B s; assert(s.get() == 0); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; void Deleter::operator()(A* p) {delete p;} void check(int i) { assert(A::count == i); } template B::~B() {} \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test default unique_ptr ctor #include #include // default unique_ptr ctor shouldn't require complete type struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; B() {} ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; int main() { { B<> s; assert(s.get() == 0); } check(0); { B s; assert(s.get() == 0); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; void Deleter::operator()(A* p) {delete p;} void check(int i) { assert(A::count == i); } template B::~B() {} \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp index ea99a337232..f8de7af2fb2 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include // default unique_ptr ctor should require non-pointer Deleter int main() { std::unique_ptr p; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr default ctor #include // default unique_ptr ctor should require non-pointer Deleter int main() { std::unique_ptr p; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp index d6cfe08bdc4..5d7b6232203 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp index 24cc1483f6a..7d3484d54e3 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); { std::unique_ptr > s(new A); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); { CDeleter d; std::unique_ptr s(new A, d); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); { std::unique_ptr > s(new A); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); { CDeleter d; std::unique_ptr s(new A, d); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp index 9b78d9548b2..84470c9e4f2 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp index a20111ad494..5abbb7776a2 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; std::unique_ptr source1() { return std::unique_ptr(new A); } void sink1(std::unique_ptr p) { } std::unique_ptr > source2() { return std::unique_ptr >(new A); } void sink2(std::unique_ptr > p) { } std::unique_ptr source3() { static CDeleter d; return std::unique_ptr(new A, d); } void sink3(std::unique_ptr p) { } int main() { sink1(source1()); sink2(source2()); sink3(source3()); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; std::unique_ptr source1() { return std::unique_ptr(new A); } void sink1(std::unique_ptr p) { } std::unique_ptr > source2() { return std::unique_ptr >(new A); } void sink2(std::unique_ptr > p) { } std::unique_ptr source3() { static CDeleter d; return std::unique_ptr(new A, d); } void sink3(std::unique_ptr p) { } int main() { sink1(source1()); sink2(source2()); sink3(source3()); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp index 99e0d7a73a5..d6bffbec699 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp index a9644236e25..876b5899349 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr move ctor #include #include // test move ctor. Can't copy from const lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { const std::unique_ptr s(new A); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp index 23fa3fbd651..7454a2cc543 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // Can't construct from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // Can't construct from lvalue struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp index 2c885a2a88b..a82e3f8f1b9 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp index 18089d809f8..85388db4d5a 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version #include #include #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp index 604485b8adc..091e3fbee97 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B, Deleter(5)); A* p = s.get(); std::unique_ptr > s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B, Deleter(5)); A* p = s.get(); std::unique_ptr > s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp index b9a60d7125d..0fb4a4cd058 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp index d860d6cc995..ecda031dbf6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(std::move(s)); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp index 324e4db7b0e..58a911a6dd2 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp index 9eca5e5176e..79b616139e3 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp index 08ca2082c2d..591bc79bc47 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { std::unique_ptr > s(new B); std::unique_ptr > s2 = s; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { std::unique_ptr > s(new B); std::unique_ptr > s2 = s; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp index 0793933c6c6..e4faba25b6e 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B, Deleter(5)); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr > s(new B, Deleter(5)); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp index 3188e7c3e4e..9fd6649dbd4 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp index 13c1b1a8233..4961a53a669 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp index 8cdb6a44000..d05e81e45e7 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp index 36ceb4ecbd2..3ef4da00c71 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { CDeleter b(5); std::unique_ptr&> s(new B, b); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include #include "../../deleter.h" // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { CDeleter b(5); std::unique_ptr&> s(new B, b); A* p = s.get(); std::unique_ptr > s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp index 6f46575be9c..cdd0fd7f0eb 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp index a5c0f95a1ae..18a7b07e0d4 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp index 8fba31414da..0bed30c2c26 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr s(new B); A* p = s.get(); std::unique_ptr s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp index 46417de5ac8..3b7d5f81672 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Implicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; int main() { { const std::unique_ptr > s(new B); A* p = s.get(); std::unique_ptr > s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp index 063792ec496..42d7a189a11 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor #include #include // test converting move ctor. Should only require a MoveConstructible deleter, or if // deleter is a reference, not even that. // Explicit version struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; template class CDeleter { int state_; CDeleter(CDeleter&); CDeleter& operator=(CDeleter&); public: CDeleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(T* p) {delete p;} }; int main() { { CDeleter d; const std::unique_ptr&> s(new B, d); A* p = s.get(); std::unique_ptr&> s2 = s; assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); d.set_state(6); assert(s2.get_deleter().state() == d.state()); assert(s.get_deleter().state() == d.state()); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp index e428e861d5c..e5b666e581b 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // Do not convert from an array unique_ptr #include #include struct A { }; struct Deleter { void operator()(void*) {} }; int main() { std::unique_ptr s; std::unique_ptr s2(std::move(s)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr converting move ctor // Do not convert from an array unique_ptr #include #include struct A { }; struct Deleter { void operator()(void*) {} }; int main() { std::unique_ptr s; std::unique_ptr s2(std::move(s)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp index d76a61cb9a7..c49c9c8deca 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // unique_ptr(nullptr_t); #include #include // default unique_ptr ctor should only require default Deleter ctor class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p(nullptr); assert(p.get() == 0); } { std::unique_ptr p(nullptr); assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // unique_ptr(nullptr_t); #include #include // default unique_ptr ctor should only require default Deleter ctor class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(void*) {} }; int main() { { std::unique_ptr p(nullptr); assert(p.get() == 0); } { std::unique_ptr p(nullptr); assert(p.get() == 0); assert(p.get_deleter().state() == 5); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp index 6b50b82f050..eaffc6dc2a6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require default Deleter ctor class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require default Deleter ctor class Deleter { Deleter() {} public: Deleter(Deleter&) {} Deleter& operator=(Deleter&) {} void operator()(void*) const {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp index bf4c3df942d..74f4f7fbfa7 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer) ctor should only require default Deleter ctor struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); std::unique_ptr s(p); assert(s.get() == p); } assert(A::count == 0); { A* p = new A; assert(A::count == 1); std::unique_ptr s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer) ctor should only require default Deleter ctor struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); std::unique_ptr s(p); assert(s.get() == p); } assert(A::count == 0); { A* p = new A; assert(A::count == 1); std::unique_ptr s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp index 0effe06412f..7780932a4b5 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require non-reference Deleter ctor class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require non-reference Deleter ctor class Deleter { public: void operator()(void*) {} }; int main() { std::unique_ptr p(new int); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp index abfdcdb9467..f8ff88d2e86 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer) ctor shouldn't require complete type struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; explicit B(A*); ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; A* get(); int main() { { A* p = get(); check(1); B<> s(p); assert(s.get() == p); } check(0); { A* p = get(); check(1); B s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; A* get() {return new A;} void Deleter::operator()(A* p) {delete p;} void check(int i) { assert(A::count == i); } template B::B(A* a) : a_(a) {} template B::~B() {} \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer) ctor shouldn't require complete type struct A; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p); }; void check(int i); template > struct B { std::unique_ptr a_; explicit B(A*); ~B(); A* get() const {return a_.get();} D& get_deleter() {return a_.get_deleter();} }; A* get(); int main() { { A* p = get(); check(1); B<> s(p); assert(s.get() == p); } check(0); { A* p = get(); check(1); B s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } check(0); } struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; A* get() {return new A;} void Deleter::operator()(A* p) {delete p;} void check(int i) { assert(A::count == i); } template B::B(A* a) : a_(a) {} template B::~B() {} \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp index 1e8e56a6dfc..f3f09535b33 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require non-pointer Deleter int main() { std::unique_ptr p(new int); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include // unique_ptr(pointer) ctor should require non-pointer Deleter int main() { std::unique_ptr p(new int); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp index 0f31fd53f3c..ef4542564e0 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer) ctor should work with derived pointers struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { B* p = new B; assert(A::count == 1); assert(B::count == 1); std::unique_ptr s(p); assert(s.get() == p); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; assert(A::count == 1); assert(B::count == 1); std::unique_ptr s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer) ctor should work with derived pointers struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { B* p = new B; assert(A::count == 1); assert(B::count == 1); std::unique_ptr s(p); assert(s.get() == p); } assert(A::count == 0); assert(B::count == 0); { B* p = new B; assert(A::count == 1); assert(B::count == 1); std::unique_ptr s(p); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp index 318015d31b6..8305a399a3c 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, deleter()) only requires MoveConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); std::unique_ptr > s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, deleter()) only requires MoveConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; template class Deleter { int state_; #ifdef _LIBCPP_MOVE Deleter(const Deleter&); Deleter& operator=(const Deleter&); #else Deleter(Deleter&); Deleter& operator=(Deleter&); #endif public: #ifdef _LIBCPP_MOVE Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;} Deleter& operator=(Deleter&& r) { state_ = r.state_; r.state_ = 0; return *this; } #else operator std::__rv() {return std::__rv(*this);} Deleter(std::__rv r) : state_(r->state_) {r->state_ = 0;} Deleter& operator=(std::__rv r) { state_ = r->state_; r->state_ = 0; return *this; } #endif Deleter() : state_(5) {} #ifdef _LIBCPP_MOVE template Deleter(Deleter&& d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, typename std::enable_if::value>::type* = 0); #else template Deleter(Deleter d, typename std::enable_if::value>::type* = 0) : state_(d.state()) {} #endif public: int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); std::unique_ptr > s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp index c6489a41072..e5c9e24a72d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, d) requires CopyConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, d) requires CopyConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp index 2a28bcd0f10..d94eaaf2f29 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, d) does not requires CopyConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 6); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, d) does not requires CopyConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); d.set_state(6); assert(s.get_deleter().state() == 6); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp index 8cb622dee3c..0912ba9aa3a 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, D()) should not compile struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); std::unique_ptr s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, D()) should not compile struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); std::unique_ptr s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp index d68b89bd2dc..b5ff2702579 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, d) does not requires CopyConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer) ctor #include #include // unique_ptr(pointer, d) does not requires CopyConstructible deleter struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; class Deleter { int state_; Deleter(const Deleter&); Deleter& operator=(const Deleter&); public: Deleter() : state_(5) {} int state() const {return state_;} void set_state(int s) {state_ = s;} void operator()(A* p) const {delete p;} }; int main() { { A* p = new A; assert(A::count == 1); Deleter d; std::unique_ptr s(p, d); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp index a0a6bab975e..93d324285c4 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor #include #include // unique_ptr(pointer, deleter) should work with derived pointers struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { B* p = new B; assert(A::count == 1); assert(B::count == 1); std::unique_ptr s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor #include #include // unique_ptr(pointer, deleter) should work with derived pointers struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; class Deleter { int state_; public: Deleter() : state_(5) {} int state() const {return state_;} void operator()(A* p) {delete p;} }; int main() { { B* p = new B; assert(A::count == 1); assert(B::count == 1); std::unique_ptr s(p, Deleter()); assert(s.get() == p); assert(s.get_deleter().state() == 5); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp index 6691c24a7ce..527666fa4df 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor #include #include // unique_ptr(pointer, deleter) should work with function pointers // unique_ptr should work bool my_free_called = false; void my_free(void*) { my_free_called = true; } int main() { { int i = 0; std::unique_ptr s(&i, my_free); assert(s.get() == &i); assert(s.get_deleter() == my_free); assert(!my_free_called); } assert(my_free_called); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test unique_ptr(pointer, deleter) ctor #include #include // unique_ptr(pointer, deleter) should work with function pointers // unique_ptr should work bool my_free_called = false; void my_free(void*) { my_free_called = true; } int main() { { int i = 0; std::unique_ptr s(&i, my_free); assert(s.get() == &i); assert(s.get_deleter() == my_free); assert(!my_free_called); } assert(my_free_called); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp index c5c5e7a2eec..20f3d00f4aa 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // The deleter is not called if get() == 0 #include #include class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(0) {} int state() const {return state_;} void operator()(void*) {++state_;} }; int main() { Deleter d; assert(d.state() == 0); { std::unique_ptr p(0, d); assert(p.get() == 0); assert(&p.get_deleter() == &d); } assert(d.state() == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // The deleter is not called if get() == 0 #include #include class Deleter { int state_; Deleter(Deleter&); Deleter& operator=(Deleter&); public: Deleter() : state_(0) {} int state() const {return state_;} void operator()(void*) {++state_;} }; int main() { Deleter d; assert(d.state() == 0); { std::unique_ptr p(0, d); assert(p.get() == 0); assert(&p.get_deleter() == &d); } assert(d.state() == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp index 3dd0834fe8c..da593d124be 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test release #include #include int main() { std::unique_ptr p(new int(3)); int* i = p.get(); int* j = p.release(); assert(p.get() == 0); assert(i == j); delete j; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test release #include #include int main() { std::unique_ptr p(new int(3)); int* i = p.get(); int* j = p.release(); assert(p.get() == 0); assert(i == j); delete j; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp index 9b40ffbe4a1..806b5d787e6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr p(new A); assert(A::count == 1); A* i = p.get(); p.reset(); assert(A::count == 0); assert(p.get() == 0); } assert(A::count == 0); { std::unique_ptr p(new A); assert(A::count == 1); A* i = p.get(); p.reset(new A); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr p(new A); assert(A::count == 1); A* i = p.get(); p.reset(); assert(A::count == 0); assert(p.get() == 0); } assert(A::count == 0); { std::unique_ptr p(new A); assert(A::count == 1); A* i = p.get(); p.reset(new A); assert(A::count == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp index e0fbcfabbdf..78da880bc22 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr p(new A); assert(A::count == 1); assert(B::count == 0); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { std::unique_ptr p(new B); assert(A::count == 1); assert(B::count == 1); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr p(new A); assert(A::count == 1); assert(B::count == 0); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); { std::unique_ptr p(new B); assert(A::count == 1); assert(B::count == 1); A* i = p.get(); p.reset(new B); assert(A::count == 1); assert(B::count == 1); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp index dc4b35524b6..c31c56fa127 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset against resetting self #include struct A { std::unique_ptr ptr_; A() : ptr_(this) {} void reset() {ptr_.reset();} }; int main() { (new A)->reset(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test reset against resetting self #include struct A { std::unique_ptr ptr_; A() : ptr_(this) {} void reset() {ptr_.reset();} }; int main() { (new A)->reset(); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp index 326ef2e7e4d..853273aef2d 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test swap #include #include #include "../../deleter.h" struct A { int state_; static int count; explicit A(int i) : state_(i) {++count;} A(const A& a) : state_(a.state_) {++count;} A& operator=(const A& a) {state_ = a.state_; return *this;} ~A() {--count;} friend bool operator==(const A& x, const A& y) {return x.state_ == y.state_;} }; int A::count = 0; int main() { { A* p1 = new A(1); std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A(2); std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(*s1 == A(1)); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(*s2 == A(2)); assert(s2.get_deleter().state() == 2); s1.swap(s2); assert(s1.get() == p2); assert(*s1 == A(2)); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(*s2 == A(1)); assert(s2.get_deleter().state() == 1); assert(A::count == 2); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test swap #include #include #include "../../deleter.h" struct A { int state_; static int count; explicit A(int i) : state_(i) {++count;} A(const A& a) : state_(a.state_) {++count;} A& operator=(const A& a) {state_ = a.state_; return *this;} ~A() {--count;} friend bool operator==(const A& x, const A& y) {return x.state_ == y.state_;} }; int A::count = 0; int main() { { A* p1 = new A(1); std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A(2); std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(*s1 == A(1)); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(*s2 == A(2)); assert(s2.get_deleter().state() == 2); s1.swap(s2); assert(s1.get() == p2); assert(*s1 == A(2)); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(*s2 == A(1)); assert(s2.get_deleter().state() == 1); assert(A::count == 2); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp index 2be9e4685a7..08092ec2ab1 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { std::unique_ptr p(new int(3)); assert(*p == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { std::unique_ptr p(new int(3)); assert(*p == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp index 01a1c06d5c8..3fbfb3826a5 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { { std::unique_ptr p(new int(3)); if (p) ; else assert(false); if (!p) assert(false); } { std::unique_ptr p; if (!p) ; else assert(false); if (p) assert(false); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op*() #include #include int main() { { std::unique_ptr p(new int(3)); if (p) ; else assert(false); if (!p) assert(false); } { std::unique_ptr p; if (!p) ; else assert(false); if (p) assert(false); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp index 3a3d0de265c..d453724c0e8 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get #include #include int main() { int* p = new int; std::unique_ptr s(p); assert(s.get() == p); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get #include #include int main() { int* p = new int; std::unique_ptr s(p); assert(s.get() == p); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp index 2f231364b3c..8cefe172f38 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get_deleter() #include #include struct Deleter { void operator()(void*) {} int test() {return 5;} int test() const {return 6;} }; int main() { { std::unique_ptr p; assert(p.get_deleter().test() == 5); } { const std::unique_ptr p; assert(p.get_deleter().test() == 6); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test get_deleter() #include #include struct Deleter { void operator()(void*) {} int test() {return 5;} int test() const {return 6;} }; int main() { { std::unique_ptr p; assert(p.get_deleter().test() == 5); } { const std::unique_ptr p; assert(p.get_deleter().test() == 6); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp index f542bb99eed..4e9657067ed 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op[](size_t) #include #include class A { int state_; static int next_; public: A() : state_(++next_) {} int get() const {return state_;} friend bool operator==(const A& x, int y) {return x.state_ == y;} A& operator=(int i) {state_ = i; return *this;} }; int A::next_ = 0; int main() { std::unique_ptr p(new A[3]); assert(p[0] == 1); assert(p[1] == 2); assert(p[2] == 3); p[0] = 3; p[1] = 2; p[2] = 1; assert(p[0] == 3); assert(p[1] == 2); assert(p[2] == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op[](size_t) #include #include class A { int state_; static int next_; public: A() : state_(++next_) {} int get() const {return state_;} friend bool operator==(const A& x, int y) {return x.state_ == y;} A& operator=(int i) {state_ = i; return *this;} }; int A::next_ = 0; int main() { std::unique_ptr p(new A[3]); assert(p[0] == 1); assert(p[1] == 2); assert(p[2] == 3); p[0] = 3; p[1] = 2; p[2] = 1; assert(p[0] == 3); assert(p[1] == 2); assert(p[2] == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp index dfae3c334df..4a00ea233e5 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op->() #include #include struct A { int i_; A() : i_(7) {} }; int main() { std::unique_ptr p(new A); assert(p->i_ == 7); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // test op->() #include #include struct A { int i_; A() : i_(7) {} }; int main() { std::unique_ptr p(new A); assert(p->i_ == 7); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp index daff8bf2c17..683378ec140 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // template // bool // operator==(const unique_ptr& x, const unique_ptr& y); // template // bool // operator!=(const unique_ptr& x, const unique_ptr& y); #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new A); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new B); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new A[3]); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new B[3]); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert(p1 == p2); assert(!(p1 != p2)); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert(p1 == p2); assert(!(p1 != p2)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // template // bool // operator==(const unique_ptr& x, const unique_ptr& y); // template // bool // operator!=(const unique_ptr& x, const unique_ptr& y); #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new A); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new B); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new A[3]); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new B[3]); assert(!(p1 == p2)); assert(p1 != p2); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert(p1 == p2); assert(!(p1 != p2)); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert(p1 == p2); assert(!(p1 != p2)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp index 21c495b9feb..93052283ae3 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // template // bool // operator< (const unique_ptr& x, const unique_ptr& y); // template // bool // operator> (const unique_ptr& x, const unique_ptr& y); // template // bool // operator<=(const unique_ptr& x, const unique_ptr& y); // template // bool // operator>=(const unique_ptr& x, const unique_ptr& y); #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new A); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new B); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new A[3]); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new B[3]); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert((p1 < p2) == (p1 > p2)); assert((p1 < p2) == !(p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert((p1 < p2) == (p1 > p2)); assert((p1 < p2) == !(p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // template // bool // operator< (const unique_ptr& x, const unique_ptr& y); // template // bool // operator> (const unique_ptr& x, const unique_ptr& y); // template // bool // operator<=(const unique_ptr& x, const unique_ptr& y); // template // bool // operator>=(const unique_ptr& x, const unique_ptr& y); #include #include #include "../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new A); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1(new A); const std::unique_ptr > p2(new B); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new A[3]); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1(new A[3]); const std::unique_ptr > p2(new B[3]); assert((p1 < p2) == !(p1 > p2)); assert((p1 < p2) == (p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert((p1 < p2) == (p1 > p2)); assert((p1 < p2) == !(p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } { const std::unique_ptr > p1; const std::unique_ptr > p2; assert((p1 < p2) == (p1 > p2)); assert((p1 < p2) == !(p1 <= p2)); assert((p1 < p2) == !(p1 >= p2)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp index d92bc3f1a40..c0bdfea88ca 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test swap #include #include #include "../deleter.h" struct A { int state_; static int count; A() : state_(0) {++count;} explicit A(int i) : state_(i) {++count;} A(const A& a) : state_(a.state_) {++count;} A& operator=(const A& a) {state_ = a.state_; return *this;} ~A() {--count;} friend bool operator==(const A& x, const A& y) {return x.state_ == y.state_;} }; int A::count = 0; int main() { { A* p1 = new A(1); std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A(2); std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(*s1 == A(1)); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(*s2 == A(2)); assert(s2.get_deleter().state() == 2); swap(s1, s2); assert(s1.get() == p2); assert(*s1 == A(2)); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(*s2 == A(1)); assert(s2.get_deleter().state() == 1); assert(A::count == 2); } assert(A::count == 0); { A* p1 = new A[3]; std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A[3]; std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(s2.get_deleter().state() == 2); swap(s1, s2); assert(s1.get() == p2); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(s2.get_deleter().state() == 1); assert(A::count == 6); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // unique_ptr // Test swap #include #include #include "../deleter.h" struct A { int state_; static int count; A() : state_(0) {++count;} explicit A(int i) : state_(i) {++count;} A(const A& a) : state_(a.state_) {++count;} A& operator=(const A& a) {state_ = a.state_; return *this;} ~A() {--count;} friend bool operator==(const A& x, const A& y) {return x.state_ == y.state_;} }; int A::count = 0; int main() { { A* p1 = new A(1); std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A(2); std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(*s1 == A(1)); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(*s2 == A(2)); assert(s2.get_deleter().state() == 2); swap(s1, s2); assert(s1.get() == p2); assert(*s1 == A(2)); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(*s2 == A(1)); assert(s2.get_deleter().state() == 1); assert(A::count == 2); } assert(A::count == 0); { A* p1 = new A[3]; std::unique_ptr > s1(p1, Deleter(1)); A* p2 = new A[3]; std::unique_ptr > s2(p2, Deleter(2)); assert(s1.get() == p1); assert(s1.get_deleter().state() == 1); assert(s2.get() == p2); assert(s2.get_deleter().state() == 2); swap(s1, s2); assert(s1.get() == p2); assert(s1.get_deleter().state() == 2); assert(s2.get() == p1); assert(s2.get_deleter().state() == 1); assert(A::count == 6); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp b/libcxx/test/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp index a85659cbdf7..51c132b65fc 100644 --- a/libcxx/test/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp +++ b/libcxx/test/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp b/libcxx/test/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp index 3f2381f8ed6..54f3bdf32cc 100644 --- a/libcxx/test/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp +++ b/libcxx/test/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp b/libcxx/test/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp index 868b7e99aed..9ef4a1e7dcf 100644 --- a/libcxx/test/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp +++ b/libcxx/test/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/util.smartptr/nothing_to_do.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/util.smartptr/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp index 595d05c28e9..d4618719cfb 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // template // class enable_shared_from_this // { // protected: // enable_shared_from_this(); // enable_shared_from_this(enable_shared_from_this const&); // enable_shared_from_this& operator=(enable_shared_from_this const&); // ~enable_shared_from_this(); // public: // shared_ptr shared_from_this(); // shared_ptr shared_from_this() const; // }; #include #include struct T : public std::enable_shared_from_this { }; struct Y : T {}; struct Z : Y {}; int main() { { std::shared_ptr p(new Z); std::shared_ptr q = p->shared_from_this(); assert(p == q); assert(!p.owner_before(q) && !q.owner_before(p)); // p and q share ownership } { std::shared_ptr p = std::make_shared(); std::shared_ptr q = p->shared_from_this(); assert(p == q); assert(!p.owner_before(q) && !q.owner_before(p)); // p and q share ownership } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // template // class enable_shared_from_this // { // protected: // enable_shared_from_this(); // enable_shared_from_this(enable_shared_from_this const&); // enable_shared_from_this& operator=(enable_shared_from_this const&); // ~enable_shared_from_this(); // public: // shared_ptr shared_from_this(); // shared_ptr shared_from_this() const; // }; #include #include struct T : public std::enable_shared_from_this { }; struct Y : T {}; struct Z : Y {}; int main() { { std::shared_ptr p(new Z); std::shared_ptr q = p->shared_from_this(); assert(p == q); assert(!p.owner_before(q) && !q.owner_before(p)); // p and q share ownership } { std::shared_ptr p = std::make_shared(); std::shared_ptr q = p->shared_from_this(); assert(p == q); assert(!p.owner_before(q) && !q.owner_before(p)); // p and q share ownership } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h index e1cdbbdd236..b9aeeebcd66 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // Example move-only deleter #ifndef DELETER_H #define DELETER_H #include #include struct test_deleter_base { static int count; static int dealloc_count; }; int test_deleter_base::count = 0; int test_deleter_base::dealloc_count = 0; template class test_deleter : public test_deleter_base { int state_; public: test_deleter() : state_(0) {++count;} explicit test_deleter(int s) : state_(s) {++count;} test_deleter(const test_deleter& d) : state_(d.state_) {++count;} ~test_deleter() {assert(state_ >= 0); --count; state_ = -1;} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {assert(state_ >= 0); ++dealloc_count; delete p;} }; template void swap(test_deleter& x, test_deleter& y) { test_deleter t(std::move(x)); x = std::move(y); y = std::move(t); } #endif \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // Example move-only deleter #ifndef DELETER_H #define DELETER_H #include #include struct test_deleter_base { static int count; static int dealloc_count; }; int test_deleter_base::count = 0; int test_deleter_base::dealloc_count = 0; template class test_deleter : public test_deleter_base { int state_; public: test_deleter() : state_(0) {++count;} explicit test_deleter(int s) : state_(s) {++count;} test_deleter(const test_deleter& d) : state_(d.state_) {++count;} ~test_deleter() {assert(state_ >= 0); --count; state_ = -1;} int state() const {return state_;} void set_state(int i) {state_ = i;} void operator()(T* p) {assert(state_ >= 0); ++dealloc_count; delete p;} }; template void swap(test_deleter& x, test_deleter& y) { test_deleter t(std::move(x)); x = std::move(y); y = std::move(t); } #endif \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp index 719a6515faa..09aa877d2cd 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class shared_ptr // { // public: // typedef T element_type; // ... // }; #include struct A; // purposefully incomplete int main() { static_assert((std::is_same::element_type, A>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class shared_ptr // { // public: // typedef T element_type; // ... // }; #include struct A; // purposefully incomplete int main() { static_assert((std::is_same::element_type, A>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.getdeleter/get_deleter.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.getdeleter/get_deleter.pass.cpp index 651a922a06c..e12dc2fa6c7 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.getdeleter/get_deleter.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.getdeleter/get_deleter.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template D* get_deleter(const shared_ptr& p); #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { { A* ptr = new A; std::shared_ptr p(ptr, test_deleter(3)); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } test_deleter::dealloc_count = 0; { { std::shared_ptr p(nullptr, test_deleter(3)); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } test_deleter::dealloc_count = 0; { std::shared_ptr p(nullptr, test_deleter(3)); std::default_delete* d = std::get_deleter >(p); assert(d == 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template D* get_deleter(const shared_ptr& p); #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { { A* ptr = new A; std::shared_ptr p(ptr, test_deleter(3)); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } test_deleter::dealloc_count = 0; { { std::shared_ptr p(nullptr, test_deleter(3)); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } test_deleter::dealloc_count = 0; { std::shared_ptr p(nullptr, test_deleter(3)); std::default_delete* d = std::get_deleter >(p); assert(d == 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp index 16b9aa2afed..09a95ec2478 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(auto_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::auto_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::auto_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::auto_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::auto_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(auto_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::auto_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::auto_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::auto_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::auto_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr.pass.cpp index 3171daa3cd6..8e1bb81afcc 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr& operator=(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr& operator=(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y.pass.cpp index 83b1ea2ec69..a13b1fd2fef 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { const std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = pA; assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp index cb6ea09e139..e4142cda701 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(shared_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(shared_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp index d15ddaf7d78..d2691b06700 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr& operator=(shared_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr& operator=(shared_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new A); pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp index 98434a380c3..75b20bfd12b 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(unique_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::unique_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::unique_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::unique_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr& operator=(unique_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::unique_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB(new B); pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::unique_ptr pA(new A); A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::unique_ptr pA; A* ptrA = pA.get(); { std::shared_ptr pB; pB = std::move(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 1); assert(pA.get() == 0); assert(pB.get() == ptrA); } assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/const_pointer_cast.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/const_pointer_cast.pass.cpp index abf973c225f..0196cf9b26b 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/const_pointer_cast.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/const_pointer_cast.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr const_pointer_cast(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); std::shared_ptr pB = std::const_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA; std::shared_ptr pB = std::const_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr const_pointer_cast(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); std::shared_ptr pB = std::const_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA; std::shared_ptr pB = std::const_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/dynamic_pointer_cast.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/dynamic_pointer_cast.pass.cpp index ca4975b48c1..ad2b6a4b72e 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/dynamic_pointer_cast.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/dynamic_pointer_cast.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr dynamic_pointer_cast(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pB(new A); std::shared_ptr pA = std::dynamic_pointer_cast(pB); assert(pA.get() == pB.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pB(new B); std::shared_ptr pA = std::dynamic_pointer_cast(pB); assert(pA.get() == 0); assert(pA.use_count() == 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr dynamic_pointer_cast(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pB(new A); std::shared_ptr pA = std::dynamic_pointer_cast(pB); assert(pA.get() == pB.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pB(new B); std::shared_ptr pA = std::dynamic_pointer_cast(pB); assert(pA.get() == 0); assert(pA.use_count() == 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/static_pointer_cast.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/static_pointer_cast.pass.cpp index 232d3cae0e8..03146c1c4e2 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/static_pointer_cast.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/static_pointer_cast.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr static_pointer_cast(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA(new A); std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA; std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA; std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr static_pointer_cast(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA(new A); std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA; std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } { const std::shared_ptr pA; std::shared_ptr pB = std::static_pointer_cast(pA); assert(pB.get() == pA.get()); assert(!pB.owner_before(pA) && !pA.owner_before(pB)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/eq.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/eq.pass.cpp index 98be66f0416..a8ae78813a8 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/eq.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool operator==(const shared_ptr& a, const shared_ptr& b); // template bool operator!=(const shared_ptr& a, const shared_ptr& b); #include #include void do_nothing(int*) {} int main() { int* ptr1(new int); int* ptr2(new int); const std::shared_ptr p1(ptr1); const std::shared_ptr p2(ptr2); const std::shared_ptr p3(ptr2, do_nothing); assert(p1 != p2); assert(p2 == p3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool operator==(const shared_ptr& a, const shared_ptr& b); // template bool operator!=(const shared_ptr& a, const shared_ptr& b); #include #include void do_nothing(int*) {} int main() { int* ptr1(new int); int* ptr2(new int); const std::shared_ptr p1(ptr1); const std::shared_ptr p2(ptr2); const std::shared_ptr p3(ptr2, do_nothing); assert(p1 != p2); assert(p2 == p3); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/lt.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/lt.pass.cpp index 07620db5830..e5a94e9324b 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/lt.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/lt.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool operator<(const shared_ptr& a, const shared_ptr& b); #include #include void do_nothing(int*) {} int main() { int* ptr1(new int); int* ptr2(new int); const std::shared_ptr p1(ptr1); const std::shared_ptr p2(ptr2); const std::shared_ptr p3(ptr2, do_nothing); assert((p1 < p2) == (ptr1 < ptr2)); assert(!(p2 < p3) && !(p3 < p2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool operator<(const shared_ptr& a, const shared_ptr& b); #include #include void do_nothing(int*) {} int main() { int* ptr1(new int); int* ptr2(new int); const std::shared_ptr p1(ptr1); const std::shared_ptr p2(ptr2); const std::shared_ptr p3(ptr2, do_nothing); assert((p1 < p2) == (ptr1 < ptr2)); assert(!(p2 < p3) && !(p3 < p2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp index b43c164b02d..eca83722175 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(auto_ptr&& r); #include #include #include #include bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::auto_ptr ptr(new A); A* raw_ptr = ptr.get(); #ifdef _LIBCPP_MOVE std::shared_ptr p(std::move(ptr)); #else std::shared_ptr p(ptr); #endif assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == raw_ptr); assert(ptr.get() == 0); } assert(A::count == 0); { std::auto_ptr ptr(new A); A* raw_ptr = ptr.get(); throw_next = true; try { #ifdef _LIBCPP_MOVE std::shared_ptr p(std::move(ptr)); #else std::shared_ptr p(ptr); #endif assert(false); } catch (...) { assert(A::count == 1); assert(B::count == 1); assert(ptr.get() == raw_ptr); } } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(auto_ptr&& r); #include #include #include #include bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::auto_ptr ptr(new A); A* raw_ptr = ptr.get(); #ifdef _LIBCPP_MOVE std::shared_ptr p(std::move(ptr)); #else std::shared_ptr p(ptr); #endif assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == raw_ptr); assert(ptr.get() == 0); } assert(A::count == 0); { std::auto_ptr ptr(new A); A* raw_ptr = ptr.get(); throw_next = true; try { #ifdef _LIBCPP_MOVE std::shared_ptr p(std::move(ptr)); #else std::shared_ptr p(ptr); #endif assert(false); } catch (...) { assert(A::count == 1); assert(B::count == 1); assert(ptr.get() == raw_ptr); } } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/default.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/default.pass.cpp index 4f63d8140ec..fa55289d9f4 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/default.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr(); #include #include int main() { std::shared_ptr p; assert(p.use_count() == 0); assert(p.get() == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr(); #include #include int main() { std::shared_ptr p; assert(p.use_count() == 0); assert(p.get() == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t.pass.cpp index ffab43c7716..6853ca698ab 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr(nullptr_t) #include #include int main() { std::shared_ptr p(nullptr); assert(p.use_count() == 0); assert(p.get() == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr(nullptr_t) #include #include int main() { std::shared_ptr p(nullptr); assert(p.use_count() == 0); assert(p.get() == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter.pass.cpp index eb498631ba4..6e75c3f2e22 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(nullptr_t, D d); #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(nullptr, test_deleter(3)); assert(A::count == 0); assert(p.use_count() == 1); assert(p.get() == 0); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(nullptr_t, D d); #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(nullptr, test_deleter(3)); assert(A::count == 0); assert(p.use_count() == 1); assert(p.get() == 0); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator.pass.cpp index 0bbb8720c95..c27df0e9a37 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(nullptr_t, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(nullptr, test_deleter(3), test_allocator(5)); assert(A::count == 0); assert(p.use_count() == 1); assert(p.get() == 0); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(nullptr_t, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(nullptr, test_deleter(3), test_allocator(5)); assert(A::count == 0); assert(p.use_count() == 1); assert(p.get() == 0); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp index c4c2201fe54..017fa7aaa95 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(nullptr_t, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { try { test_allocator::throw_after = 0; std::shared_ptr p(nullptr, test_deleter(3), test_allocator(5)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(nullptr_t, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { try { test_allocator::throw_after = 0; std::shared_ptr p(nullptr, test_deleter(3), test_allocator(5)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp index 19838255763..86e9e7a14d8 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(nullptr_t, D d); #include #include #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } int main() { throw_next = true; try { std::shared_ptr p(nullptr, test_deleter(3)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(nullptr_t, D d); #include #include #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } int main() { throw_next = true; try { std::shared_ptr p(nullptr, test_deleter(3)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp index caebd4ae700..28a5a57edea 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(Y* p); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr = new A; std::shared_ptr p(ptr); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); { A* ptr = new A; std::shared_ptr p(ptr); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(Y* p); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr = new A; std::shared_ptr p(ptr); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); { A* ptr = new A; std::shared_ptr p(ptr); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp index 1e62565cf50..9db6b0c8d68 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(Y* p, D d); #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr = new A; std::shared_ptr p(ptr, test_deleter(3)); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(Y* p, D d); #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr = new A; std::shared_ptr p(ptr, test_deleter(3)); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp index e6f39ee2b54..e340c76e248 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(Y* p, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr = new A; std::shared_ptr p(ptr, test_deleter(3), test_allocator(5)); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(Y* p, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr = new A; std::shared_ptr p(ptr, test_deleter(3), test_allocator(5)); assert(A::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp index 40d6aa9d1c7..4fd7f6c1396 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(Y* p, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { A* ptr = new A; try { test_allocator::throw_after = 0; std::shared_ptr p(ptr, test_deleter(3), test_allocator(5)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template shared_ptr(Y* p, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { A* ptr = new A; try { test_allocator::throw_after = 0; std::shared_ptr p(ptr, test_deleter(3), test_allocator(5)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp index ac7f603161a..5596cdaec9b 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(Y* p, D d); #include #include #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } int main() { A* ptr = new A; throw_next = true; try { std::shared_ptr p(ptr, test_deleter(3)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(Y* p, D d); #include #include #include #include #include "../test_deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } int main() { A* ptr = new A; throw_next = true; try { std::shared_ptr p(ptr, test_deleter(3)); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp index b5b217e4a7d..4b47a5c0aa6 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(Y* p); #include #include #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } int main() { { A* ptr = new A; throw_next = true; assert(A::count == 1); try { std::shared_ptr p(ptr); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); } } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(Y* p); #include #include #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } int main() { { A* ptr = new A; throw_next = true; assert(A::count == 1); try { std::shared_ptr p(ptr); assert(false); } catch (std::bad_alloc&) { assert(A::count == 0); } } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr.pass.cpp index 5cdec2b3884..0ee5cca1dc7 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr(const shared_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(A::count == 1); { std::shared_ptr pA2(pA); assert(A::count == 1); assert(pA.use_count() == 2); assert(pA2.use_count() == 2); assert(pA2.get() == pA.get()); } assert(pA.use_count() == 1); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(A::count == 0); { std::shared_ptr pA2(pA); assert(A::count == 0); assert(pA.use_count() == 0); assert(pA2.use_count() == 0); assert(pA2.get() == pA.get()); } assert(pA.use_count() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr(const shared_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(A::count == 1); { std::shared_ptr pA2(pA); assert(A::count == 1); assert(pA.use_count() == 2); assert(pA2.use_count() == 2); assert(pA2.get() == pA.get()); } assert(pA.use_count() == 1); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(A::count == 0); { std::shared_ptr pA2(pA); assert(A::count == 0); assert(pA.use_count() == 0); assert(pA2.use_count() == 0); assert(pA2.get() == pA.get()); } assert(pA.use_count() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp index ef79110ca02..a2bc56202bb 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); { const std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { std::shared_ptr pB(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); { const std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { std::shared_ptr pB(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 2); assert(pA.use_count() == 2); assert(pA.get() == pB.get()); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp index 66a7b1b78ea..a7b1b1cff05 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(shared_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); { std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { B* p = pA.get(); std::shared_ptr pB(std::move(pA)); assert(B::count == 1); assert(A::count == 1); #ifdef _LIBCPP_MOVE assert(pB.use_count() == 1); assert(pA.use_count() == 0); #else assert(pB.use_count() == 2); assert(pA.use_count() == 2); #endif assert(p == pB.get()); } #ifdef _LIBCPP_MOVE assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); #else assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); #endif } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(shared_ptr&& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); { std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { B* p = pA.get(); std::shared_ptr pB(std::move(pA)); assert(B::count == 1); assert(A::count == 1); #ifdef _LIBCPP_MOVE assert(pB.use_count() == 1); assert(pA.use_count() == 0); #else assert(pB.use_count() == 2); assert(pA.use_count() == 2); #endif assert(p == pB.get()); } #ifdef _LIBCPP_MOVE assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); #else assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); #endif } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); assert(pA.get() == pB.get()); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp index 39545a3f128..565d77ff71a 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(const shared_ptr& r, T *p); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} ~B() {--count;} }; int B::count = 0; struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); assert(pA.use_count() == 1); { B b; std::shared_ptr pB(pA, &b); assert(A::count == 1); assert(B::count == 1); assert(pA.use_count() == 2); assert(pB.use_count() == 2); assert(pB.get() == &b); } assert(pA.use_count() == 1); assert(A::count == 1); assert(B::count == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr(const shared_ptr& r, T *p); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} ~B() {--count;} }; int B::count = 0; struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); assert(pA.use_count() == 1); { B b; std::shared_ptr pB(pA, &b); assert(A::count == 1); assert(B::count == 1); assert(pA.use_count() == 2); assert(pB.use_count() == 2); assert(pB.get() == &b); } assert(pA.use_count() == 1); assert(A::count == 1); assert(B::count == 0); } assert(A::count == 0); assert(B::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp index 2db8fe5a660..f6528b2cb28 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr(shared_ptr&& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(A::count == 1); { A* p = pA.get(); std::shared_ptr pA2(std::move(pA)); assert(A::count == 1); #ifdef _LIBCPP_MOVE assert(pA.use_count() == 0); assert(pA2.use_count() == 1); #else assert(pA.use_count() == 2); assert(pA2.use_count() == 2); #endif assert(pA2.get() == p); } #ifdef _LIBCPP_MOVE assert(pA.use_count() == 0); assert(A::count == 0); #else assert(pA.use_count() == 1); assert(A::count == 1); #endif } assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(A::count == 0); { std::shared_ptr pA2(std::move(pA)); assert(A::count == 0); assert(pA.use_count() == 0); assert(pA2.use_count() == 0); assert(pA2.get() == pA.get()); } assert(pA.use_count() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // shared_ptr(shared_ptr&& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(A::count == 1); { A* p = pA.get(); std::shared_ptr pA2(std::move(pA)); assert(A::count == 1); #ifdef _LIBCPP_MOVE assert(pA.use_count() == 0); assert(pA2.use_count() == 1); #else assert(pA.use_count() == 2); assert(pA2.use_count() == 2); #endif assert(pA2.get() == p); } #ifdef _LIBCPP_MOVE assert(pA.use_count() == 0); assert(A::count == 0); #else assert(pA.use_count() == 1); assert(A::count == 1); #endif } assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(A::count == 0); { std::shared_ptr pA2(std::move(pA)); assert(A::count == 0); assert(pA.use_count() == 0); assert(pA2.use_count() == 0); assert(pA2.get() == pA.get()); } assert(pA.use_count() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp index c0a2f766280..9f57052860e 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(unique_ptr&&r); #include #include #include #include bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr ptr(new A); A* raw_ptr = ptr.get(); std::shared_ptr p(std::move(ptr)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == raw_ptr); assert(ptr.get() == 0); } assert(A::count == 0); { std::unique_ptr ptr(new A); A* raw_ptr = ptr.get(); throw_next = true; try { std::shared_ptr p(std::move(ptr)); assert(false); } catch (...) { assert(A::count == 1); assert(B::count == 1); assert(ptr.get() == raw_ptr); } } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template explicit shared_ptr(unique_ptr&&r); #include #include #include #include bool throw_next = false; void* operator new(std::size_t s) throw(std::bad_alloc) { if (throw_next) throw std::bad_alloc(); return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::unique_ptr ptr(new A); A* raw_ptr = ptr.get(); std::shared_ptr p(std::move(ptr)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == raw_ptr); assert(ptr.get() == 0); } assert(A::count == 0); { std::unique_ptr ptr(new A); A* raw_ptr = ptr.get(); throw_next = true; try { std::shared_ptr p(std::move(ptr)); assert(false); } catch (...) { assert(A::count == 1); assert(B::count == 1); assert(ptr.get() == raw_ptr); } } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp index 639689c5222..aa9fbf50377 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template explicit shared_ptr(const weak_ptr& r); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; try { std::shared_ptr sp(wp); assert(false); } catch (std::bad_weak_ptr&) { } assert(A::count == 0); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); std::shared_ptr sp(wp); assert(sp.use_count() == 2); assert(sp.get() == sp0.get()); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); sp0.reset(); try { std::shared_ptr sp(wp); assert(false); } catch (std::bad_weak_ptr&) { } } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template explicit shared_ptr(const weak_ptr& r); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; try { std::shared_ptr sp(wp); assert(false); } catch (std::bad_weak_ptr&) { } assert(A::count == 0); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); std::shared_ptr sp(wp); assert(sp.use_count() == 2); assert(sp.get() == sp0.get()); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); sp0.reset(); try { std::shared_ptr sp(wp); assert(false); } catch (std::bad_weak_ptr&) { } } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.pass.cpp index acd08849365..49ad98cd279 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template // shared_ptr allocate_shared(const A& a, Args&&... args); #include #include #include #include #include "../test_allocator.h" int new_count = 0; struct A { static int count; A(int i, char c) : int_(i), char_(c) {++count;} A(const A& a) : int_(a.int_), char_(a.char_) {++count;} ~A() {--count;} int get_int() const {return int_;} char get_char() const {return char_;} private: int int_; char char_; }; int A::count = 0; int main() { { int i = 67; char c = 'e'; std::shared_ptr p = std::allocate_shared(test_allocator(54), i, c); assert(test_allocator::alloc_count == 1); assert(A::count == 1); assert(p->get_int() == 67); assert(p->get_char() == 'e'); } assert(A::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template // shared_ptr allocate_shared(const A& a, Args&&... args); #include #include #include #include #include "../test_allocator.h" int new_count = 0; struct A { static int count; A(int i, char c) : int_(i), char_(c) {++count;} A(const A& a) : int_(a.int_), char_(a.char_) {++count;} ~A() {--count;} int get_int() const {return int_;} char get_char() const {return char_;} private: int int_; char char_; }; int A::count = 0; int main() { { int i = 67; char c = 'e'; std::shared_ptr p = std::allocate_shared(test_allocator(54), i, c); assert(test_allocator::alloc_count == 1); assert(A::count == 1); assert(p->get_int() == 67); assert(p->get_char() == 'e'); } assert(A::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp index 723c9a821f5..2db9c66569e 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr make_shared(Args&&... args); #include #include #include #include int new_count = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_count; return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } struct A { static int count; A(int i, char c) : int_(i), char_(c) {++count;} A(const A& a) : int_(a.int_), char_(a.char_) {++count;} ~A() {--count;} int get_int() const {return int_;} char get_char() const {return char_;} private: int int_; char char_; }; int A::count = 0; int main() { int nc = new_count; { int i = 67; char c = 'e'; std::shared_ptr p = std::make_shared(i, c); assert(new_count == nc+1); assert(A::count == 1); assert(p->get_int() == 67); assert(p->get_char() == 'e'); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template shared_ptr make_shared(Args&&... args); #include #include #include #include int new_count = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_count; return std::malloc(s); } void operator delete(void* p) throw() { std::free(p); } struct A { static int count; A(int i, char c) : int_(i), char_(c) {++count;} A(const A& a) : int_(a.int_), char_(a.char_) {++count;} ~A() {--count;} int get_int() const {return int_;} char get_char() const {return char_;} private: int int_; char char_; }; int A::count = 0; int main() { int nc = new_count; { int i = 67; char c = 'e'; std::shared_ptr p = std::make_shared(i, c); assert(new_count == nc+1); assert(A::count == 1); assert(p->get_int() == 67); assert(p->get_char() == 'e'); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.dest/tested_elsewhere.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.dest/tested_elsewhere.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.dest/tested_elsewhere.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.dest/tested_elsewhere.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.io/io.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.io/io.pass.cpp index ae993c2dd24..c39bec74cd7 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.io/io.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.io/io.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset.pass.cpp index 1d624b2925d..27d9eb93450 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // void reset(); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); p.reset(); assert(A::count == 0); assert(B::count == 0); assert(p.use_count() == 0); assert(p.get() == 0); } assert(A::count == 0); { std::shared_ptr p; p.reset(); assert(A::count == 0); assert(B::count == 0); assert(p.use_count() == 0); assert(p.get() == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // void reset(); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); p.reset(); assert(A::count == 0); assert(B::count == 0); assert(p.use_count() == 0); assert(p.get() == 0); } assert(A::count == 0); { std::shared_ptr p; p.reset(); assert(A::count == 0); assert(B::count == 0); assert(p.use_count() == 0); assert(p.get() == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp index 1ee745c8c51..13656f51849 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void reset(Y* p); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); A* ptr = new A; p.reset(ptr); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); { std::shared_ptr p; A* ptr = new A; p.reset(ptr); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void reset(Y* p); #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); A* ptr = new A; p.reset(ptr); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); { std::shared_ptr p; A* ptr = new A; p.reset(ptr); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp index 30a19d151fc..b4bdd8654e5 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void reset(Y* p, D d); #include #include #include "../test_deleter.h" struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); A* ptr = new A; p.reset(ptr, test_deleter(3)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); { std::shared_ptr p; A* ptr = new A; p.reset(ptr, test_deleter(3)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 1); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 2); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void reset(Y* p, D d); #include #include #include "../test_deleter.h" struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); A* ptr = new A; p.reset(ptr, test_deleter(3)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); { std::shared_ptr p; A* ptr = new A; p.reset(ptr, test_deleter(3)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 1); assert(d); assert(d->state() == 3); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 2); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp index 67244be1d00..a318f68caf4 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void reset(Y* p, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); A* ptr = new A; p.reset(ptr, test_deleter(3), test_allocator(4)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); { std::shared_ptr p; A* ptr = new A; p.reset(ptr, test_deleter(3), test_allocator(4)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 1); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 2); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void reset(Y* p, D d, A a); #include #include #include "../test_deleter.h" #include "../test_allocator.h" struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p(new B); A* ptr = new A; p.reset(ptr, test_deleter(3), test_allocator(4)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 0); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 1); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); { std::shared_ptr p; A* ptr = new A; p.reset(ptr, test_deleter(3), test_allocator(4)); assert(A::count == 1); assert(B::count == 1); assert(p.use_count() == 1); assert(p.get() == ptr); test_deleter* d = std::get_deleter >(p); assert(test_deleter::count == 1); assert(test_deleter::dealloc_count == 1); assert(d); assert(d->state() == 3); assert(test_allocator::count == 1); assert(test_allocator::alloc_count == 1); } assert(A::count == 0); assert(test_deleter::count == 0); assert(test_deleter::dealloc_count == 2); assert(test_allocator::count == 0); assert(test_allocator::alloc_count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/swap.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/swap.pass.cpp index 55111376859..6f75444e632 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/swap.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // void swap(shared_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); { std::shared_ptr p2(ptr2); p1.swap(p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 2); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = new A; A* ptr2 = 0; std::shared_ptr p1(ptr1); { std::shared_ptr p2; p1.swap(p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = new A; std::shared_ptr p1; { std::shared_ptr p2(ptr2); p1.swap(p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = 0; std::shared_ptr p1; { std::shared_ptr p2; p1.swap(p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 0); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // void swap(shared_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); { std::shared_ptr p2(ptr2); p1.swap(p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 2); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = new A; A* ptr2 = 0; std::shared_ptr p1(ptr1); { std::shared_ptr p2; p1.swap(p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = new A; std::shared_ptr p1; { std::shared_ptr p2(ptr2); p1.swap(p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = 0; std::shared_ptr p1; { std::shared_ptr p2; p1.swap(p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 0); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/arrow.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/arrow.pass.cpp index 1cc04e0cf6d..14646f0392a 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/arrow.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/arrow.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // T* operator->() const; #include #include #include int main() { const std::shared_ptr > p(new std::pair(3, 4)); assert(p->first == 3); assert(p->second == 4); p->first = 5; p->second = 6; assert(p->first == 5); assert(p->second == 6); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // T* operator->() const; #include #include #include int main() { const std::shared_ptr > p(new std::pair(3, 4)); assert(p->first == 3); assert(p->second == 4); p->first = 5; p->second = 6; assert(p->first == 5); assert(p->second == 6); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/dereference.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/dereference.pass.cpp index 55b745eb174..b02af0f1cfb 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/dereference.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/dereference.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // T& operator*() const; #include #include int main() { const std::shared_ptr p(new int(32)); assert(*p == 32); *p = 3; assert(*p == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // T& operator*() const; #include #include int main() { const std::shared_ptr p(new int(32)); assert(*p == 32); *p = 3; assert(*p == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp index 2855d5be0f2..f0661fb318c 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // explicit operator bool() const; #include #include int main() { { const std::shared_ptr p(new int(32)); assert(p); } { const std::shared_ptr p; assert(!p); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // explicit operator bool() const; #include #include int main() { { const std::shared_ptr p(new int(32)); assert(p); } { const std::shared_ptr p; assert(!p); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp index 1184b3c8823..b5aeff5e818 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool owner_before(shared_ptr const& b) const; #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); assert(!p1.owner_before(p2)); assert(!p2.owner_before(p1)); assert(p1.owner_before(p3) || p3.owner_before(p1)); assert(p3.owner_before(p1) == p3.owner_before(p2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool owner_before(shared_ptr const& b) const; #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); assert(!p1.owner_before(p2)); assert(!p2.owner_before(p1)); assert(p1.owner_before(p3) || p3.owner_before(p1)); assert(p3.owner_before(p1) == p3.owner_before(p2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp index 727b5da1645..8e8059b2056 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool owner_before(weak_ptr const& b) const; #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); assert(!p1.owner_before(w2)); assert(!p2.owner_before(w1)); assert(p1.owner_before(w3) || p3.owner_before(w1)); assert(p3.owner_before(w1) == p3.owner_before(w2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template bool owner_before(weak_ptr const& b) const; #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); assert(!p1.owner_before(w2)); assert(!p2.owner_before(w1)); assert(p1.owner_before(w3) || p3.owner_before(w1)); assert(p3.owner_before(w1) == p3.owner_before(w2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/unique.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/unique.pass.cpp index 3e3da51e446..429e7e9d58a 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/unique.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/unique.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // bool unique() const; #include #include int main() { const std::shared_ptr p(new int(32)); assert(p.unique()); { std::shared_ptr p2 = p; assert(!p.unique()); } assert(p.unique()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // bool unique() const; #include #include int main() { const std::shared_ptr p(new int(32)); assert(p.unique()); { std::shared_ptr p2 = p; assert(!p.unique()); } assert(p.unique()); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.spec/swap.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.spec/swap.pass.cpp index 5f73c6fdbee..850125f8cf2 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.spec/swap.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.spec/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void swap(shared_ptr& a, shared_ptr& b); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); { std::shared_ptr p2(ptr2); swap(p1, p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 2); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = new A; A* ptr2 = 0; std::shared_ptr p1(ptr1); { std::shared_ptr p2; swap(p1, p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = new A; std::shared_ptr p1; { std::shared_ptr p2(ptr2); swap(p1, p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = 0; std::shared_ptr p1; { std::shared_ptr p2; swap(p1, p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 0); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // shared_ptr // template void swap(shared_ptr& a, shared_ptr& b); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); { std::shared_ptr p2(ptr2); swap(p1, p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 2); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = new A; A* ptr2 = 0; std::shared_ptr p1(ptr1); { std::shared_ptr p2; swap(p1, p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 1); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = new A; std::shared_ptr p1; { std::shared_ptr p2(ptr2); swap(p1, p2); assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 1); } assert(p1.use_count() == 1); assert(p1.get() == ptr2); assert(A::count == 1); } assert(A::count == 0); { A* ptr1 = 0; A* ptr2 = 0; std::shared_ptr p1; { std::shared_ptr p2; swap(p1, p2); assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(p2.use_count() == 0); assert(p2.get() == ptr1); assert(A::count == 0); } assert(p1.use_count() == 0); assert(p1.get() == ptr2); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/types.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/types.pass.cpp index 051a4408e9b..359bfa7c48a 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/types.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/types.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class weak_ptr // { // public: // typedef T element_type; // ... // }; #include struct A; // purposefully incomplete int main() { static_assert((std::is_same::element_type, A>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class weak_ptr // { // public: // typedef T element_type; // ... // }; #include struct A; // purposefully incomplete int main() { static_assert((std::is_same::element_type, A>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp index f2f436b7a36..eb16e033d04 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template struct owner_less; // // template // struct owner_less > // : binary_function, shared_ptr, bool> // { // typedef bool result_type; // bool operator()(shared_ptr const&, shared_ptr const&) const; // bool operator()(shared_ptr const&, weak_ptr const&) const; // bool operator()(weak_ptr const&, shared_ptr const&) const; // }; // // template // struct owner_less > // : binary_function, weak_ptr, bool> // { // typedef bool result_type; // bool operator()(weak_ptr const&, weak_ptr const&) const; // bool operator()(shared_ptr const&, weak_ptr const&) const; // bool operator()(weak_ptr const&, shared_ptr const&) const; // }; #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); { typedef std::owner_less > CS; CS cs; assert(!cs(p1, p2)); assert(!cs(p2, p1)); assert(cs(p1 ,p3) || cs(p3, p1)); assert(cs(p3, p1) == cs(p3, p2)); assert(!cs(p1, w2)); assert(!cs(p2, w1)); assert(cs(p1, w3) || cs(p3, w1)); assert(cs(p3, w1) == cs(p3, w2)); } { typedef std::owner_less > CS; CS cs; assert(!cs(w1, w2)); assert(!cs(w2, w1)); assert(cs(w1, w3) || cs(w3, w1)); assert(cs(w3, w1) == cs(w3, w2)); assert(!cs(w1, p2)); assert(!cs(w2, p1)); assert(cs(w1, p3) || cs(w3, p1)); assert(cs(w3, p1) == cs(w3, p2)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template struct owner_less; // // template // struct owner_less > // : binary_function, shared_ptr, bool> // { // typedef bool result_type; // bool operator()(shared_ptr const&, shared_ptr const&) const; // bool operator()(shared_ptr const&, weak_ptr const&) const; // bool operator()(weak_ptr const&, shared_ptr const&) const; // }; // // template // struct owner_less > // : binary_function, weak_ptr, bool> // { // typedef bool result_type; // bool operator()(weak_ptr const&, weak_ptr const&) const; // bool operator()(shared_ptr const&, weak_ptr const&) const; // bool operator()(weak_ptr const&, shared_ptr const&) const; // }; #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); { typedef std::owner_less > CS; CS cs; assert(!cs(p1, p2)); assert(!cs(p2, p1)); assert(cs(p1 ,p3) || cs(p3, p1)); assert(cs(p3, p1) == cs(p3, p2)); assert(!cs(p1, w2)); assert(!cs(p2, w1)); assert(cs(p1, w3) || cs(p3, w1)); assert(cs(p3, w1) == cs(p3, w2)); } { typedef std::owner_less > CS; CS cs; assert(!cs(w1, w2)); assert(!cs(w2, w1)); assert(cs(w1, w3) || cs(w3, w1)); assert(cs(w3, w1) == cs(w3, w2)); assert(!cs(w1, p2)); assert(!cs(w2, p1)); assert(cs(w1, p3) || cs(w3, p1)); assert(cs(w3, p1) == cs(w3, p2)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/shared_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/shared_ptr_Y.pass.cpp index 02dc7e812b8..87569aadb20 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/shared_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/shared_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr& operator=(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); { std::weak_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr& operator=(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr pA(new A); { std::weak_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp index 0e9859bec34..853d43265ea 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // weak_ptr& operator=(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr ps(new A); const std::weak_ptr pA(ps); { std::weak_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // weak_ptr& operator=(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr ps(new A); const std::weak_ptr pA(ps); { std::weak_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr_Y.pass.cpp index 1d062145304..85461b90f7e 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.assign/weak_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr& operator=(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr ps(new A); const std::weak_ptr pA(ps); { std::weak_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr& operator=(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { const std::shared_ptr ps(new A); const std::weak_ptr pA(ps); { std::weak_ptr pB; pB = pA; assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/default.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/default.pass.cpp index 576ec0c98f9..ef62c139a7e 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/default.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class weak_ptr // weak_ptr(); #include #include struct A; int main() { std::weak_ptr p; assert(p.use_count() == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class weak_ptr // weak_ptr(); #include #include struct A; int main() { std::weak_ptr p; assert(p.use_count() == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/shared_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/shared_ptr_Y.pass.cpp index 15a5c1cacd5..1efdb03774b 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/shared_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/shared_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::weak_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::weak_ptr >::value), ""); { const std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { std::weak_ptr pB(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr(const shared_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::weak_ptr >::value), ""); static_assert((!std::is_convertible, std::shared_ptr >::value), ""); static_assert((!std::is_convertible, std::weak_ptr >::value), ""); { const std::shared_ptr pA(new A); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { std::weak_ptr pB(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { std::shared_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp index 2b49b9706fa..fabf4324536 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // weak_ptr(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { { const std::shared_ptr ps(new A); const std::weak_ptr pA(ps); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { std::weak_ptr pB(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // weak_ptr(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { { const std::shared_ptr ps(new A); const std::weak_ptr pA(ps); assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); { std::weak_ptr pB(pA); assert(B::count == 1); assert(A::count == 1); assert(pB.use_count() == 1); assert(pA.use_count() == 1); } assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); } assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp index 415ee71cc85..8b2db201d6d 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::weak_ptr >::value), ""); static_assert((!std::is_convertible, std::weak_ptr >::value), ""); static_assert((!std::is_convertible, std::weak_ptr >::value), ""); { const std::weak_ptr pA(std::shared_ptr(new A)); assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template weak_ptr(const weak_ptr& r); #include #include #include struct B { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; struct A : public B { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; struct C { static int count; C() {++count;} C(const C&) {++count;} virtual ~C() {--count;} }; int C::count = 0; int main() { static_assert(( std::is_convertible, std::weak_ptr >::value), ""); static_assert((!std::is_convertible, std::weak_ptr >::value), ""); static_assert((!std::is_convertible, std::weak_ptr >::value), ""); { const std::weak_ptr pA(std::shared_ptr(new A)); assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pA; assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); { std::weak_ptr pB(pA); assert(B::count == 0); assert(A::count == 0); assert(pB.use_count() == 0); assert(pA.use_count() == 0); } assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); } assert(B::count == 0); assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.dest/tested_elsewhere.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.dest/tested_elsewhere.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.dest/tested_elsewhere.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.dest/tested_elsewhere.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/reset.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/reset.pass.cpp index 9fcb90994c8..50aa527232a 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/reset.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/reset.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // void swap(weak_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p1(new A); std::weak_ptr w1(p1); assert(w1.use_count() == 1); w1.reset(); assert(w1.use_count() == 0); assert(p1.use_count() == 1); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // void swap(weak_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::shared_ptr p1(new A); std::weak_ptr w1(p1); assert(w1.use_count() == 1); w1.reset(); assert(w1.use_count() == 0); assert(p1.use_count() == 1); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/swap.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/swap.pass.cpp index 7ee2277e281..1bd3a3f6c50 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/swap.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.mod/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // void swap(weak_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); std::weak_ptr w1(p1); { std::shared_ptr p2(ptr2); std::weak_ptr w2(p2); w1.swap(w2); assert(w1.use_count() == 1); assert(w1.lock().get() == ptr2); assert(w2.use_count() == 1); assert(w2.lock().get() == ptr1); assert(A::count == 2); } } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // void swap(weak_ptr& r); #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); std::weak_ptr w1(p1); { std::shared_ptr p2(ptr2); std::weak_ptr w2(p2); w1.swap(w2); assert(w1.use_count() == 1); assert(w1.lock().get() == ptr2); assert(w2.use_count() == 1); assert(w2.lock().get() == ptr1); assert(A::count == 2); } } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/expired.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/expired.pass.cpp index 59f5388719f..3d93fb93e9e 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/expired.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/expired.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // bool expired() const; #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; assert(wp.use_count() == 0); assert(wp.expired() == (wp.use_count() == 0)); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); assert(wp.use_count() == 1); assert(wp.expired() == (wp.use_count() == 0)); sp0.reset(); assert(wp.use_count() == 0); assert(wp.expired() == (wp.use_count() == 0)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // bool expired() const; #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; assert(wp.use_count() == 0); assert(wp.expired() == (wp.use_count() == 0)); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); assert(wp.use_count() == 1); assert(wp.expired() == (wp.use_count() == 0)); sp0.reset(); assert(wp.use_count() == 0); assert(wp.expired() == (wp.use_count() == 0)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp index fc7e338e6b7..c68792058fc 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // shared_ptr lock() const; #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 2); assert(sp.get() == sp0.get()); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); sp0.reset(); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // shared_ptr lock() const; #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 2); assert(sp.get() == sp0.get()); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); sp0.reset(); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/not_less_than.fail.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/not_less_than.fail.cpp index aa3aad73b4a..18bacf4a43a 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/not_less_than.fail.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/not_less_than.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class weak_ptr; // // not less than comparable #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); bool b = w1 < w2; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template class weak_ptr; // // not less than comparable #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); bool b = w1 < w2; } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp index 307dba53285..e3ad3807ea3 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template bool owner_before(const shared_ptr& b); #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); assert(!w1.owner_before(p2)); assert(!w2.owner_before(p1)); assert(w1.owner_before(p3) || w3.owner_before(p1)); assert(w3.owner_before(p1) == w3.owner_before(p2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template bool owner_before(const shared_ptr& b); #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); assert(!w1.owner_before(p2)); assert(!w2.owner_before(p1)); assert(w1.owner_before(p3) || w3.owner_before(p1)); assert(w3.owner_before(p1) == w3.owner_before(p2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp index a2603af6ff2..6f123821233 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template bool owner_before(const weak_ptr& b); #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); assert(!w1.owner_before(w2)); assert(!w2.owner_before(w1)); assert(w1.owner_before(w3) || w3.owner_before(w1)); assert(w3.owner_before(w1) == w3.owner_before(w2)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template bool owner_before(const weak_ptr& b); #include #include int main() { const std::shared_ptr p1(new int); const std::shared_ptr p2 = p1; const std::shared_ptr p3(new int); const std::weak_ptr w1(p1); const std::weak_ptr w2(p2); const std::weak_ptr w3(p3); assert(!w1.owner_before(w2)); assert(!w2.owner_before(w1)); assert(w1.owner_before(w3) || w3.owner_before(w1)); assert(w3.owner_before(w1) == w3.owner_before(w2)); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.spec/swap.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.spec/swap.pass.cpp index b02f4eaf7c8..c349f90b638 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.spec/swap.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.spec/swap.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template void swap(weak_ptr& a, weak_ptr& b) #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); std::weak_ptr w1(p1); { std::shared_ptr p2(ptr2); std::weak_ptr w2(p2); swap(w1, w2); assert(w1.use_count() == 1); assert(w1.lock().get() == ptr2); assert(w2.use_count() == 1); assert(w2.lock().get() == ptr1); assert(A::count == 2); } } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // template void swap(weak_ptr& a, weak_ptr& b) #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { A* ptr1 = new A; A* ptr2 = new A; std::shared_ptr p1(ptr1); std::weak_ptr w1(p1); { std::shared_ptr p2(ptr2); std::weak_ptr w2(p2); swap(w1, w2); assert(w1.use_count() == 1); assert(w1.lock().get() == ptr2); assert(w2.use_count() == 1); assert(w2.lock().get() == ptr1); assert(A::count == 2); } } assert(A::count == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp index d0de482c2d0..ae75b4fe810 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weakptr/bad_weak_ptr.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class bad_weak_ptr // : public std::exception // { // public: // bad_weak_ptr(); // }; #include #include #include #include int main() { static_assert((std::is_base_of::value), ""); std::bad_weak_ptr e; std::bad_weak_ptr e2 = e; e2 = e; assert(std::strcmp(e.what(), "bad_weak_ptr") == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class bad_weak_ptr // : public std::exception // { // public: // bad_weak_ptr(); // }; #include #include #include #include int main() { static_assert((std::is_base_of::value), ""); std::bad_weak_ptr e; std::bad_weak_ptr e2 = e; e2 = e; assert(std::strcmp(e.what(), "bad_weak_ptr") == 0); } \ No newline at end of file diff --git a/libcxx/test/utilities/memory/version.pass.cpp b/libcxx/test/utilities/memory/version.pass.cpp index dab60f92e6d..e05afd07802 100644 --- a/libcxx/test/utilities/memory/version.pass.cpp +++ b/libcxx/test/utilities/memory/version.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp b/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp index f00a1f64f29..f963769d9c0 100644 --- a/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp +++ b/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // integral_constant #include int main() { typedef std::integral_constant _5; static_assert(_5::value == 5, ""); static_assert((std::is_same<_5::value_type, int>::value), ""); static_assert((std::is_same<_5::type, _5>::value), ""); static_assert(std::false_type::value == false, ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(std::true_type::value == true, ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); std::false_type f1; std::false_type f2 = f1; std::true_type t1; std::true_type t2 = t1; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // integral_constant #include int main() { typedef std::integral_constant _5; static_assert(_5::value == 5, ""); static_assert((std::is_same<_5::value_type, int>::value), ""); static_assert((std::is_same<_5::type, _5>::value), ""); static_assert(std::false_type::value == false, ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(std::true_type::value == true, ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); std::false_type f1; std::false_type f2 = f1; std::true_type t1; std::true_type t2 = t1; } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.rel/is_base_of.pass.cpp b/libcxx/test/utilities/meta/meta.rel/is_base_of.pass.cpp index 7db7be06028..319fb6cceae 100644 --- a/libcxx/test/utilities/meta/meta.rel/is_base_of.pass.cpp +++ b/libcxx/test/utilities/meta/meta.rel/is_base_of.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_base_of #include template void test_is_base_of() { static_assert((std::is_base_of::value), ""); static_assert((std::is_base_of::value), ""); static_assert((std::is_base_of::value), ""); static_assert((std::is_base_of::value), ""); } template void test_is_not_base_of() { static_assert((!std::is_base_of::value), ""); } struct B {}; struct B1 : B {}; struct B2 : B {}; struct D : private B1, private B2 {}; int main() { test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_not_base_of(); test_is_not_base_of(); test_is_not_base_of(); test_is_not_base_of(); test_is_not_base_of(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_base_of #include template void test_is_base_of() { static_assert((std::is_base_of::value), ""); static_assert((std::is_base_of::value), ""); static_assert((std::is_base_of::value), ""); static_assert((std::is_base_of::value), ""); } template void test_is_not_base_of() { static_assert((!std::is_base_of::value), ""); } struct B {}; struct B1 : B {}; struct B2 : B {}; struct D : private B1, private B2 {}; int main() { test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_base_of(); test_is_not_base_of(); test_is_not_base_of(); test_is_not_base_of(); test_is_not_base_of(); test_is_not_base_of(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.rel/is_convertible.pass.cpp b/libcxx/test/utilities/meta/meta.rel/is_convertible.pass.cpp index 379f1eed041..96c8a5e8ac2 100644 --- a/libcxx/test/utilities/meta/meta.rel/is_convertible.pass.cpp +++ b/libcxx/test/utilities/meta/meta.rel/is_convertible.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_convertible #include typedef void Function(); typedef char Array[1]; int main() { { static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_convertible #include typedef void Function(); typedef char Array[1]; int main() { { static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); } { static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); static_assert(( std::is_convertible::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.rel/is_explicitly_convertible.pass.cpp b/libcxx/test/utilities/meta/meta.rel/is_explicitly_convertible.pass.cpp index 8a458855c69..b9d598dfbac 100644 --- a/libcxx/test/utilities/meta/meta.rel/is_explicitly_convertible.pass.cpp +++ b/libcxx/test/utilities/meta/meta.rel/is_explicitly_convertible.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_explicitly_convertible #include typedef void Function(); typedef char Array[1]; int main() { { static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_explicitly_convertible #include typedef void Function(); typedef char Array[1]; int main() { { static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); } { static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); static_assert((!std::is_explicitly_convertible::value), ""); static_assert(( std::is_explicitly_convertible::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.rel/is_same.pass.cpp b/libcxx/test/utilities/meta/meta.rel/is_same.pass.cpp index 0e30b7d1fe4..8fa8e556d7c 100644 --- a/libcxx/test/utilities/meta/meta.rel/is_same.pass.cpp +++ b/libcxx/test/utilities/meta/meta.rel/is_same.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_same #include template void test_is_same() { static_assert((std::is_same::value), ""); static_assert((!std::is_same::value), ""); static_assert((!std::is_same::value), ""); static_assert((std::is_same::value), ""); } template void test_is_same_ref() { static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } template void test_is_not_same() { static_assert((!std::is_same::value), ""); } class Class { public: ~Class(); }; int main() { test_is_same(); test_is_same(); test_is_same(); test_is_same(); test_is_same_ref(); test_is_not_same(); test_is_not_same(); test_is_not_same(); test_is_not_same(); test_is_not_same(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_same #include template void test_is_same() { static_assert((std::is_same::value), ""); static_assert((!std::is_same::value), ""); static_assert((!std::is_same::value), ""); static_assert((std::is_same::value), ""); } template void test_is_same_ref() { static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } template void test_is_not_same() { static_assert((!std::is_same::value), ""); } class Class { public: ~Class(); }; int main() { test_is_same(); test_is_same(); test_is_same(); test_is_same(); test_is_same_ref(); test_is_not_same(); test_is_not_same(); test_is_not_same(); test_is_not_same(); test_is_not_same(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.rqmts/nothing_to_do.pass.cpp b/libcxx/test/utilities/meta/meta.rqmts/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/meta/meta.rqmts/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/meta/meta.rqmts/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp index e2f98c30eec..51e5178cfd9 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_all_extents #include enum Enum {zero, one_}; int main() { static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const Enum>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_all_extents #include enum Enum {zero, one_}; int main() { static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const Enum>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp index ed2e3d87931..d6592e88377 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_extent #include enum Enum {zero, one_}; int main() { static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const Enum>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int[3]>::value), ""); static_assert((std::is_same::type, const int[3]>::value), ""); static_assert((std::is_same::type, int[3]>::value), ""); static_assert((std::is_same::type, const int[3]>::value), ""); static_assert((std::is_same::type, int[2][3]>::value), ""); static_assert((std::is_same::type, const int[2][3]>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_extent #include enum Enum {zero, one_}; int main() { static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const Enum>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, int[3]>::value), ""); static_assert((std::is_same::type, const int[3]>::value), ""); static_assert((std::is_same::type, int[3]>::value), ""); static_assert((std::is_same::type, const int[3]>::value), ""); static_assert((std::is_same::type, int[2][3]>::value), ""); static_assert((std::is_same::type, const int[2][3]>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp index fac7c26891d..55767898c33 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_const #include template void test_add_const_imp() { static_assert((std::is_same::type, const U>::value), ""); } template void test_add_const() { test_add_const_imp(); test_add_const_imp(); test_add_const_imp(); test_add_const_imp(); } int main() { test_add_const(); test_add_const(); test_add_const(); test_add_const(); test_add_const(); test_add_const(); test_add_const(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_const #include template void test_add_const_imp() { static_assert((std::is_same::type, const U>::value), ""); } template void test_add_const() { test_add_const_imp(); test_add_const_imp(); test_add_const_imp(); test_add_const_imp(); } int main() { test_add_const(); test_add_const(); test_add_const(); test_add_const(); test_add_const(); test_add_const(); test_add_const(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp index dd7c15889db..43f516eab71 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_cv #include template void test_add_cv_imp() { static_assert((std::is_same::type, const volatile U>::value), ""); } template void test_add_cv() { test_add_cv_imp(); test_add_cv_imp(); test_add_cv_imp(); test_add_cv_imp(); } int main() { test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_cv #include template void test_add_cv_imp() { static_assert((std::is_same::type, const volatile U>::value), ""); } template void test_add_cv() { test_add_cv_imp(); test_add_cv_imp(); test_add_cv_imp(); test_add_cv_imp(); } int main() { test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); test_add_cv(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp index 92791accdcc..cca30035925 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_volatile #include template void test_add_volatile_imp() { static_assert((std::is_same::type, volatile U>::value), ""); } template void test_add_volatile() { test_add_volatile_imp(); test_add_volatile_imp(); test_add_volatile_imp(); test_add_volatile_imp(); } int main() { test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_volatile #include template void test_add_volatile_imp() { static_assert((std::is_same::type, volatile U>::value), ""); } template void test_add_volatile() { test_add_volatile_imp(); test_add_volatile_imp(); test_add_volatile_imp(); test_add_volatile_imp(); } int main() { test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); test_add_volatile(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp index f857a27c58c..4ecfcb8930d 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_const #include template void test_remove_const_imp() { static_assert((std::is_same::type, U>::value), ""); } template void test_remove_const() { test_remove_const_imp(); test_remove_const_imp(); test_remove_const_imp(); test_remove_const_imp(); } int main() { test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_const #include template void test_remove_const_imp() { static_assert((std::is_same::type, U>::value), ""); } template void test_remove_const() { test_remove_const_imp(); test_remove_const_imp(); test_remove_const_imp(); test_remove_const_imp(); } int main() { test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); test_remove_const(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp index ce9e6d4428c..fc5b36f4f68 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_cv #include template void test_remove_cv_imp() { static_assert((std::is_same::type, U>::value), ""); } template void test_remove_cv() { test_remove_cv_imp(); test_remove_cv_imp(); test_remove_cv_imp(); test_remove_cv_imp(); } int main() { test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_cv #include template void test_remove_cv_imp() { static_assert((std::is_same::type, U>::value), ""); } template void test_remove_cv() { test_remove_cv_imp(); test_remove_cv_imp(); test_remove_cv_imp(); test_remove_cv_imp(); } int main() { test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); test_remove_cv(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp index cafcfa532b8..85d65213c08 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_volatile #include template void test_remove_volatile_imp() { static_assert((std::is_same::type, U>::value), ""); } template void test_remove_volatile() { test_remove_volatile_imp(); test_remove_volatile_imp(); test_remove_volatile_imp(); test_remove_volatile_imp(); } int main() { test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_volatile #include template void test_remove_volatile_imp() { static_assert((std::is_same::type, U>::value), ""); } template void test_remove_volatile() { test_remove_volatile_imp(); test_remove_volatile_imp(); test_remove_volatile_imp(); test_remove_volatile_imp(); } int main() { test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); test_remove_volatile(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp index 40e137c085f..58be6e98024 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // aligned_storage #include int main() { { typedef std::aligned_storage<10, 1 >::type T1; static_assert(std::alignment_of::value == 1, ""); static_assert(sizeof(T1) == 10, ""); } { typedef std::aligned_storage<10, 2 >::type T1; static_assert(std::alignment_of::value == 2, ""); static_assert(sizeof(T1) == 10, ""); } { typedef std::aligned_storage<10, 4 >::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 12, ""); } { typedef std::aligned_storage<10, 8 >::type T1; static_assert(std::alignment_of::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<10, 16 >::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<10, 32 >::type T1; static_assert(std::alignment_of::value == 32, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<20, 32 >::type T1; static_assert(std::alignment_of::value == 32, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<40, 32 >::type T1; static_assert(std::alignment_of::value == 32, ""); static_assert(sizeof(T1) == 64, ""); } { typedef std::aligned_storage<12, 16 >::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<1>::type T1; static_assert(std::alignment_of::value == 1, ""); static_assert(sizeof(T1) == 1, ""); } { typedef std::aligned_storage<2>::type T1; static_assert(std::alignment_of::value == 2, ""); static_assert(sizeof(T1) == 2, ""); } { typedef std::aligned_storage<3>::type T1; static_assert(std::alignment_of::value == 2, ""); static_assert(sizeof(T1) == 4, ""); } { typedef std::aligned_storage<4>::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } { typedef std::aligned_storage<5>::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<7>::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<8>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<9>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), ""); } { typedef std::aligned_storage<15>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<16>::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<17>::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<10>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // aligned_storage #include int main() { { typedef std::aligned_storage<10, 1 >::type T1; static_assert(std::alignment_of::value == 1, ""); static_assert(sizeof(T1) == 10, ""); } { typedef std::aligned_storage<10, 2 >::type T1; static_assert(std::alignment_of::value == 2, ""); static_assert(sizeof(T1) == 10, ""); } { typedef std::aligned_storage<10, 4 >::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 12, ""); } { typedef std::aligned_storage<10, 8 >::type T1; static_assert(std::alignment_of::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<10, 16 >::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<10, 32 >::type T1; static_assert(std::alignment_of::value == 32, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<20, 32 >::type T1; static_assert(std::alignment_of::value == 32, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<40, 32 >::type T1; static_assert(std::alignment_of::value == 32, ""); static_assert(sizeof(T1) == 64, ""); } { typedef std::aligned_storage<12, 16 >::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<1>::type T1; static_assert(std::alignment_of::value == 1, ""); static_assert(sizeof(T1) == 1, ""); } { typedef std::aligned_storage<2>::type T1; static_assert(std::alignment_of::value == 2, ""); static_assert(sizeof(T1) == 2, ""); } { typedef std::aligned_storage<3>::type T1; static_assert(std::alignment_of::value == 2, ""); static_assert(sizeof(T1) == 4, ""); } { typedef std::aligned_storage<4>::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } { typedef std::aligned_storage<5>::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<7>::type T1; static_assert(std::alignment_of::value == 4, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<8>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<9>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), ""); } { typedef std::aligned_storage<15>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<16>::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<17>::type T1; static_assert(std::alignment_of::value == 16, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<10>::type T1; static_assert(std::alignment_of::value == (sizeof(long) == 4 ? 4 : 8), ""); static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp index 36403ff5373..460f734a7b2 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // common_type #include int main() { static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, char>::value), ""); static_assert((std::is_same::type, double>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, double>::value), ""); static_assert((std::is_same::type, long long>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // common_type #include int main() { static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, char>::value), ""); static_assert((std::is_same::type, double>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, double>::value), ""); static_assert((std::is_same::type, long long>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp index 6c6a67ab784..c6317037a02 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // conditional #include int main() { static_assert((std::is_same::type, char>::value), ""); static_assert((std::is_same::type, int>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // conditional #include int main() { static_assert((std::is_same::type, char>::value), ""); static_assert((std::is_same::type, int>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp index c5fc1bc99b0..6ed6da8f804 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // decay #include template void test_decay() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_decay(); test_decay(); test_decay(); test_decay(); test_decay(); test_decay(); test_decay(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // decay #include template void test_decay() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_decay(); test_decay(); test_decay(); test_decay(); test_decay(); test_decay(); test_decay(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp index e0a53815292..c4d27dc6b8e 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enable_if #include int main() { typedef std::enable_if::type A; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enable_if #include int main() { typedef std::enable_if::type A; } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp index d2914abf0e7..7cfdeeecfcb 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enable_if #include int main() { static_assert((std::is_same::type, void>::value), ""); static_assert((std::is_same::type, int>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enable_if #include int main() { static_assert((std::is_same::type, void>::value), ""); static_assert((std::is_same::type, int>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp index ab7286e6940..3795f8e31ce 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // result_of #include typedef bool (&PF1)(); typedef short (*PF2)(long); struct S { operator PF2() const; double operator()(char, int&); }; int main() { static_assert((std::is_same::type, short>::value), "Error!"); static_assert((std::is_same::type, double>::value), "Error!"); static_assert((std::is_same::type, bool>::value), "Error!"); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // result_of #include typedef bool (&PF1)(); typedef short (*PF2)(long); struct S { operator PF2() const; double operator()(char, int&); }; int main() { static_assert((std::is_same::type, short>::value), "Error!"); static_assert((std::is_same::type, double>::value), "Error!"); static_assert((std::is_same::type, bool>::value), "Error!"); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp index 9316521bc76..128ca05adff 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // underlying_type #include int main() { #error underlying_type is not implemented } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // underlying_type #include int main() { #error underlying_type is not implemented } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp index 5966d0287a2..ad43c439916 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_pointer #include template void test_add_pointer() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_pointer #include template void test_add_pointer() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); test_add_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp index 9df689d1d81..4b1b903e5cd 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_pointer #include template void test_remove_pointer() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_pointer #include template void test_remove_pointer() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); test_remove_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp index 06dae283712..5dfea669906 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_lvalue_reference #include template void test_add_lvalue_reference() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_lvalue_reference #include template void test_add_lvalue_reference() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); test_add_lvalue_reference(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp index 935d4696d46..0a86b53e5e1 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_rvalue_reference #include #ifdef _LIBCPP_MOVE template void test_add_rvalue_reference() { static_assert((std::is_same::type, U>::value), ""); } #endif int main() { #ifdef _LIBCPP_MOVE test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // add_rvalue_reference #include #ifdef _LIBCPP_MOVE template void test_add_rvalue_reference() { static_assert((std::is_same::type, U>::value), ""); } #endif int main() { #ifdef _LIBCPP_MOVE test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); test_add_rvalue_reference(); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp index 6e035efc02e..d36dd019b07 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_reference #include template void test_remove_reference() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); #ifdef _LIBCPP_MOVE test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // remove_reference #include template void test_remove_reference() { static_assert((std::is_same::type, U>::value), ""); } int main() { test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); #ifdef _LIBCPP_MOVE test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); test_remove_reference(); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp index 1f7511e9977..3b87a835512 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // make_signed #include enum Enum {zero, one_}; enum BigEnum { bzero, big = 0xFFFFFFFFFFFFFFFFULL }; int main() { static_assert((std::is_same::type, signed char>::value), ""); static_assert((std::is_same::type, signed char>::value), ""); static_assert((std::is_same::type, signed char>::value), ""); static_assert((std::is_same::type, signed short>::value), ""); static_assert((std::is_same::type, signed short>::value), ""); static_assert((std::is_same::type, signed int>::value), ""); static_assert((std::is_same::type, signed int>::value), ""); static_assert((std::is_same::type, signed long>::value), ""); static_assert((std::is_same::type, long>::value), ""); static_assert((std::is_same::type, signed long long>::value), ""); static_assert((std::is_same::type, signed long long>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, std::conditional::type>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // make_signed #include enum Enum {zero, one_}; enum BigEnum { bzero, big = 0xFFFFFFFFFFFFFFFFULL }; int main() { static_assert((std::is_same::type, signed char>::value), ""); static_assert((std::is_same::type, signed char>::value), ""); static_assert((std::is_same::type, signed char>::value), ""); static_assert((std::is_same::type, signed short>::value), ""); static_assert((std::is_same::type, signed short>::value), ""); static_assert((std::is_same::type, signed int>::value), ""); static_assert((std::is_same::type, signed int>::value), ""); static_assert((std::is_same::type, signed long>::value), ""); static_assert((std::is_same::type, long>::value), ""); static_assert((std::is_same::type, signed long long>::value), ""); static_assert((std::is_same::type, signed long long>::value), ""); static_assert((std::is_same::type, int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, const int>::value), ""); static_assert((std::is_same::type, std::conditional::type>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp index becf1e93740..d8bb4e33ef7 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // make_unsigned #include enum Enum {zero, one_}; enum BigEnum { bzero, big = 0xFFFFFFFFFFFFFFFFULL }; int main() { static_assert((std::is_same::type, unsigned char>::value), ""); static_assert((std::is_same::type, unsigned char>::value), ""); static_assert((std::is_same::type, unsigned char>::value), ""); static_assert((std::is_same::type, unsigned short>::value), ""); static_assert((std::is_same::type, unsigned short>::value), ""); static_assert((std::is_same::type, unsigned int>::value), ""); static_assert((std::is_same::type, unsigned int>::value), ""); static_assert((std::is_same::type, unsigned long>::value), ""); static_assert((std::is_same::type, unsigned long>::value), ""); static_assert((std::is_same::type, unsigned long long>::value), ""); static_assert((std::is_same::type, unsigned long long>::value), ""); static_assert((std::is_same::type, unsigned int>::value), ""); static_assert((std::is_same::type, const unsigned int>::value), ""); static_assert((std::is_same::type, const unsigned int>::value), ""); static_assert((std::is_same::type, std::conditional::type>::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // make_unsigned #include enum Enum {zero, one_}; enum BigEnum { bzero, big = 0xFFFFFFFFFFFFFFFFULL }; int main() { static_assert((std::is_same::type, unsigned char>::value), ""); static_assert((std::is_same::type, unsigned char>::value), ""); static_assert((std::is_same::type, unsigned char>::value), ""); static_assert((std::is_same::type, unsigned short>::value), ""); static_assert((std::is_same::type, unsigned short>::value), ""); static_assert((std::is_same::type, unsigned int>::value), ""); static_assert((std::is_same::type, unsigned int>::value), ""); static_assert((std::is_same::type, unsigned long>::value), ""); static_assert((std::is_same::type, unsigned long>::value), ""); static_assert((std::is_same::type, unsigned long long>::value), ""); static_assert((std::is_same::type, unsigned long long>::value), ""); static_assert((std::is_same::type, unsigned int>::value), ""); static_assert((std::is_same::type, const unsigned int>::value), ""); static_assert((std::is_same::type, const unsigned int>::value), ""); static_assert((std::is_same::type, std::conditional::type>::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp b/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.type.synop/nothing_to_do.pass.cpp b/libcxx/test/utilities/meta/meta.type.synop/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/meta/meta.type.synop/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/meta/meta.type.synop/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp index 4588bbb1e3f..da1a68137d1 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // array #include template void test_array_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert( std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_array() { test_array_imp(); test_array_imp(); test_array_imp(); test_array_imp(); } typedef char array[3]; typedef const char const_array[3]; typedef char incomplete_array[]; int main() { test_array(); test_array(); test_array(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // array #include template void test_array_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert( std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_array() { test_array_imp(); test_array_imp(); test_array_imp(); test_array_imp(); } typedef char array[3]; typedef const char const_array[3]; typedef char incomplete_array[]; int main() { test_array(); test_array(); test_array(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp index 99207322c76..fa604cf182e 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // class #include template void test_class_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert( std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_class() { test_class_imp(); test_class_imp(); test_class_imp(); test_class_imp(); } class Class { int _; double __; }; int main() { test_class(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // class #include template void test_class_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert( std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_class() { test_class_imp(); test_class_imp(); test_class_imp(); test_class_imp(); } class Class { int _; double __; }; int main() { test_class(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp index 972654b0b47..b1a72f9f130 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enum #include template void test_enum_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert( std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_enum() { test_enum_imp(); test_enum_imp(); test_enum_imp(); test_enum_imp(); } enum Enum {zero, one}; int main() { test_enum(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enum #include template void test_enum_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert( std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_enum() { test_enum_imp(); test_enum_imp(); test_enum_imp(); test_enum_imp(); } enum Enum {zero, one}; int main() { test_enum(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp index 70ba35b37c5..bd5d03f449d 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // floating_point #include template void test_floating_point_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert( std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_floating_point() { test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); } int main() { test_floating_point(); test_floating_point(); test_floating_point(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // floating_point #include template void test_floating_point_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert( std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_floating_point() { test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); } int main() { test_floating_point(); test_floating_point(); test_floating_point(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp index ee9753f2cf7..a3bab5b325a 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // function #include template void test_function_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert( std::is_function::value, ""); } template void test_function() { test_function_imp(); test_function_imp(); test_function_imp(); test_function_imp(); } int main() { test_function(); test_function(); test_function(); test_function(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // function #include template void test_function_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert( std::is_function::value, ""); } template void test_function() { test_function_imp(); test_function_imp(); test_function_imp(); test_function_imp(); } int main() { test_function(); test_function(); test_function(); test_function(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp index afa6a9d18a4..a4c0cb427cf 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // integral #include template void test_integral_imp() { static_assert(!std::is_void::value, ""); static_assert( std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_integral() { test_integral_imp(); test_integral_imp(); test_integral_imp(); test_integral_imp(); } int main() { test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // integral #include template void test_integral_imp() { static_assert(!std::is_void::value, ""); static_assert( std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_integral() { test_integral_imp(); test_integral_imp(); test_integral_imp(); test_integral_imp(); } int main() { test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp index 85d6bc494aa..581a8aeb1c3 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // lvalue_ref #include template void test_lvalue_ref() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert( std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } int main() { test_lvalue_ref(); test_lvalue_ref(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // lvalue_ref #include template void test_lvalue_ref() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert( std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } int main() { test_lvalue_ref(); test_lvalue_ref(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp index 77c424f930d..2a66fa0a967 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_function_pointer #include template void test_member_function_pointer_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert( std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_member_function_pointer() { test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); } class Class { }; int main() { test_member_function_pointer(); test_member_function_pointer(); test_member_function_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_function_pointer #include template void test_member_function_pointer_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert( std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_member_function_pointer() { test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); } class Class { }; int main() { test_member_function_pointer(); test_member_function_pointer(); test_member_function_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp index 13a2577f983..ed9eff866af 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_object_pointer #include template void test_member_object_pointer_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert( std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_member_object_pointer() { test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); } class Class { }; int main() { test_member_object_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_object_pointer #include template void test_member_object_pointer_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert( std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_member_object_pointer() { test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); } class Class { }; int main() { test_member_object_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp index 07d38f3840a..263e7388689 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // pointer #include template void test_pointer_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert( std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_pointer() { test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); } int main() { test_pointer(); test_pointer(); test_pointer(); test_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // pointer #include template void test_pointer_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert( std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_pointer() { test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); } int main() { test_pointer(); test_pointer(); test_pointer(); test_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp index 0579b5a291b..91d7a6e0954 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // rvalue_ref #include template void test_rvalue_ref() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert( std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } int main() { #ifdef _LIBCPP_MOVE test_rvalue_ref(); test_rvalue_ref(); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // rvalue_ref #include template void test_rvalue_ref() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert( std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } int main() { #ifdef _LIBCPP_MOVE test_rvalue_ref(); test_rvalue_ref(); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp index 644665e87ee..07c9729ff83 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // union #include template void test_union_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert( std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_union() { test_union_imp(); test_union_imp(); test_union_imp(); test_union_imp(); } union Union { int _; double __; }; int main() { test_union(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // union #include template void test_union_imp() { static_assert(!std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert( std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_union() { test_union_imp(); test_union_imp(); test_union_imp(); test_union_imp(); } union Union { int _; double __; }; int main() { test_union(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp index a17e95b8741..cfcff70a923 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // void #include template void test_void_imp() { static_assert( std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_void() { test_void_imp(); test_void_imp(); test_void_imp(); test_void_imp(); } int main() { test_void(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // void #include template void test_void_imp() { static_assert( std::is_void::value, ""); static_assert(!std::is_integral::value, ""); static_assert(!std::is_floating_point::value, ""); static_assert(!std::is_array::value, ""); static_assert(!std::is_pointer::value, ""); static_assert(!std::is_lvalue_reference::value, ""); static_assert(!std::is_rvalue_reference::value, ""); static_assert(!std::is_member_object_pointer::value, ""); static_assert(!std::is_member_function_pointer::value, ""); static_assert(!std::is_enum::value, ""); static_assert(!std::is_union::value, ""); static_assert(!std::is_class::value, ""); static_assert(!std::is_function::value, ""); } template void test_void() { test_void_imp(); test_void_imp(); test_void_imp(); test_void_imp(); } int main() { test_void(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/array.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/array.pass.cpp index a064eaabcd7..e521e45977d 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/array.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/array.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // array #include template void test_array_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_array() { test_array_imp(); test_array_imp(); test_array_imp(); test_array_imp(); } typedef char array[3]; typedef const char const_array[3]; typedef char incomplete_array[]; int main() { test_array(); test_array(); test_array(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // array #include template void test_array_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_array() { test_array_imp(); test_array_imp(); test_array_imp(); test_array_imp(); } typedef char array[3]; typedef const char const_array[3]; typedef char incomplete_array[]; int main() { test_array(); test_array(); test_array(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp index a3ebad7010f..4ddf499d754 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/class.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // class #include template void test_class_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_class() { test_class_imp(); test_class_imp(); test_class_imp(); test_class_imp(); } class Class { int _; double __; }; int main() { test_class(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // class #include template void test_class_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_class() { test_class_imp(); test_class_imp(); test_class_imp(); test_class_imp(); } class Class { int _; double __; }; int main() { test_class(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/enum.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/enum.pass.cpp index e6a30b82ee2..cdd87e84c7e 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/enum.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/enum.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enum #include template void test_enum_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_enum() { test_enum_imp(); test_enum_imp(); test_enum_imp(); test_enum_imp(); } enum Enum {zero, one}; int main() { test_enum(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // enum #include template void test_enum_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_enum() { test_enum_imp(); test_enum_imp(); test_enum_imp(); test_enum_imp(); } enum Enum {zero, one}; int main() { test_enum(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/floating_point.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/floating_point.pass.cpp index 35752ea99d1..d5d06eba72f 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/floating_point.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/floating_point.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // floating_point #include template void test_floating_point_imp() { static_assert(!std::is_reference::value, ""); static_assert( std::is_arithmetic::value, ""); static_assert( std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert(!std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_floating_point() { test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); } int main() { test_floating_point(); test_floating_point(); test_floating_point(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // floating_point #include template void test_floating_point_imp() { static_assert(!std::is_reference::value, ""); static_assert( std::is_arithmetic::value, ""); static_assert( std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert(!std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_floating_point() { test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); test_floating_point_imp(); } int main() { test_floating_point(); test_floating_point(); test_floating_point(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/function.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/function.pass.cpp index d625c53980f..f67fd8f3606 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/function.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/function.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // function #include template void test_function_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_function() { test_function_imp(); test_function_imp(); test_function_imp(); test_function_imp(); } int main() { test_function(); test_function(); test_function(); test_function(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // function #include template void test_function_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_function() { test_function_imp(); test_function_imp(); test_function_imp(); test_function_imp(); } int main() { test_function(); test_function(); test_function(); test_function(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/integral.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/integral.pass.cpp index c11d5b802c9..12c72ee5a6a 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/integral.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/integral.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // integral #include template void test_integral_imp() { static_assert(!std::is_reference::value, ""); static_assert( std::is_arithmetic::value, ""); static_assert( std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert(!std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_integral() { test_integral_imp(); test_integral_imp(); test_integral_imp(); test_integral_imp(); } int main() { test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // integral #include template void test_integral_imp() { static_assert(!std::is_reference::value, ""); static_assert( std::is_arithmetic::value, ""); static_assert( std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert(!std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_integral() { test_integral_imp(); test_integral_imp(); test_integral_imp(); test_integral_imp(); } int main() { test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); test_integral(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/lvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/lvalue_ref.pass.cpp index 363c5268091..db749b0e8b8 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/lvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/lvalue_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // lvalue_ref #include template void test_lvalue_ref() { static_assert( std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } int main() { test_lvalue_ref(); test_lvalue_ref(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // lvalue_ref #include template void test_lvalue_ref() { static_assert( std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } int main() { test_lvalue_ref(); test_lvalue_ref(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_function_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_function_pointer.pass.cpp index 579a803c696..9e8f15973f0 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_function_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_function_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_function_pointer #include template void test_member_function_pointer_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert( std::is_member_pointer::value, ""); } template void test_member_function_pointer() { test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); } class Class { }; int main() { test_member_function_pointer(); test_member_function_pointer(); test_member_function_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_function_pointer #include template void test_member_function_pointer_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert( std::is_member_pointer::value, ""); } template void test_member_function_pointer() { test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); test_member_function_pointer_imp(); } class Class { }; int main() { test_member_function_pointer(); test_member_function_pointer(); test_member_function_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_object_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_object_pointer.pass.cpp index 685a985dba4..6af0606f02e 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_object_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/member_object_pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_object_pointer #include template void test_member_object_pointer_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert( std::is_member_pointer::value, ""); } template void test_member_object_pointer() { test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); } class Class { }; int main() { test_member_object_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // member_object_pointer #include template void test_member_object_pointer_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert( std::is_member_pointer::value, ""); } template void test_member_object_pointer() { test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); test_member_object_pointer_imp(); } class Class { }; int main() { test_member_object_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/pointer.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/pointer.pass.cpp index 88721696f56..ccc936b13ce 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/pointer.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // pointer #include template void test_pointer_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_pointer() { test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); } int main() { test_pointer(); test_pointer(); test_pointer(); test_pointer(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // pointer #include template void test_pointer_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert( std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_pointer() { test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); test_pointer_imp(); } int main() { test_pointer(); test_pointer(); test_pointer(); test_pointer(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp index f7bef396842..7233ba99f3f 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // rvalue_ref #include template void test_rvalue_ref() { static_assert(std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } int main() { #ifdef _LIBCPP_MOVE test_rvalue_ref(); test_rvalue_ref(); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // rvalue_ref #include template void test_rvalue_ref() { static_assert(std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } int main() { #ifdef _LIBCPP_MOVE test_rvalue_ref(); test_rvalue_ref(); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/union.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/union.pass.cpp index 535a181e887..8eb85706490 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/union.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/union.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // union #include template void test_union_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_union() { test_union_imp(); test_union_imp(); test_union_imp(); test_union_imp(); } union Union { int _; double __; }; int main() { test_union(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // union #include template void test_union_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert(!std::is_fundamental::value, ""); static_assert( std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert( std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_union() { test_union_imp(); test_union_imp(); test_union_imp(); test_union_imp(); } union Union { int _; double __; }; int main() { test_union(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/void.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/void.pass.cpp index 8abad5ac9dd..88c2fa8a0e7 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/void.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.comp/void.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // void #include template void test_void_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert( std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert(!std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_void() { test_void_imp(); test_void_imp(); test_void_imp(); test_void_imp(); } int main() { test_void(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // void #include template void test_void_imp() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_arithmetic::value, ""); static_assert( std::is_fundamental::value, ""); static_assert(!std::is_object::value, ""); static_assert(!std::is_scalar::value, ""); static_assert(!std::is_compound::value, ""); static_assert(!std::is_member_pointer::value, ""); } template void test_void() { test_void_imp(); test_void_imp(); test_void_imp(); test_void_imp(); } int main() { test_void(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/alignment_of.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/alignment_of.pass.cpp index f44396918b3..093ca33c98d 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/alignment_of.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/alignment_of.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // alignment_of #include template void test_alignment_of() { static_assert( std::alignment_of::value == A, ""); static_assert( std::alignment_of::value == A, ""); static_assert( std::alignment_of::value == A, ""); static_assert( std::alignment_of::value == A, ""); } class Class { public: ~Class(); }; int main() { test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // alignment_of #include template void test_alignment_of() { static_assert( std::alignment_of::value == A, ""); static_assert( std::alignment_of::value == A, ""); static_assert( std::alignment_of::value == A, ""); static_assert( std::alignment_of::value == A, ""); } class Class { public: ~Class(); }; int main() { test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); test_alignment_of(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/extent.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/extent.pass.cpp index 8deb5bf3f5a..d149eb3d9d3 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/extent.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/extent.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // extent #include template void test_extent() { static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); } template void test_extent1() { static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); } class Class { public: ~Class(); }; int main() { test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent1(); test_extent1(); test_extent1(); test_extent1(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // extent #include template void test_extent() { static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); } template void test_extent1() { static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); static_assert((std::extent::value == A), ""); } class Class { public: ~Class(); }; int main() { test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent(); test_extent1(); test_extent1(); test_extent1(); test_extent1(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp index 0c9c6fc6d68..787cd79c3e2 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp index 1223249337d..7acb69509fe 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp index 2d48cdbac1f..d253a821e76 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_assign.pass.cpp index 926d3fd5215..0c115686df9 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_assign.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_assign.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_constructor.pass.cpp index 26b060cbdd4..1f5b5632633 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_move_constructor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp index a08ac8f6ce3..31a5a7c1c1f 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_copy_assign #include template void test_has_nothrow_assign() { static_assert( std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert( std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); } template void test_has_not_nothrow_assign() { static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A& operator=(const A&); }; int main() { test_has_not_nothrow_assign(); test_has_not_nothrow_assign(); test_has_not_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_copy_assign #include template void test_has_nothrow_assign() { static_assert( std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert( std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); } template void test_has_not_nothrow_assign() { static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A& operator=(const A&); }; int main() { test_has_not_nothrow_assign(); test_has_not_nothrow_assign(); test_has_not_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp index 2561939a45c..1a9beaa5d77 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_copy_constructor #include template void test_has_nothrow_copy_constructor() { static_assert( std::has_nothrow_copy_constructor::value, ""); static_assert( std::has_nothrow_copy_constructor::value, ""); static_assert( std::has_nothrow_copy_constructor::value, ""); static_assert( std::has_nothrow_copy_constructor::value, ""); } template void test_has_not_nothrow_copy_constructor() { static_assert(!std::has_nothrow_copy_constructor::value, ""); static_assert(!std::has_nothrow_copy_constructor::value, ""); static_assert(!std::has_nothrow_copy_constructor::value, ""); static_assert(!std::has_nothrow_copy_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(const A&); }; int main() { test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_copy_constructor #include template void test_has_nothrow_copy_constructor() { static_assert( std::has_nothrow_copy_constructor::value, ""); static_assert( std::has_nothrow_copy_constructor::value, ""); static_assert( std::has_nothrow_copy_constructor::value, ""); static_assert( std::has_nothrow_copy_constructor::value, ""); } template void test_has_not_nothrow_copy_constructor() { static_assert(!std::has_nothrow_copy_constructor::value, ""); static_assert(!std::has_nothrow_copy_constructor::value, ""); static_assert(!std::has_nothrow_copy_constructor::value, ""); static_assert(!std::has_nothrow_copy_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(const A&); }; int main() { test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp index 6e608ee70fe..2a4e81e5de4 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_default_constructor #include template void test_has_nothrow_default_constructor() { static_assert( std::has_nothrow_default_constructor::value, ""); static_assert( std::has_nothrow_default_constructor::value, ""); static_assert( std::has_nothrow_default_constructor::value, ""); static_assert( std::has_nothrow_default_constructor::value, ""); } template void test_has_not_nothrow_default_constructor() { static_assert(!std::has_nothrow_default_constructor::value, ""); static_assert(!std::has_nothrow_default_constructor::value, ""); static_assert(!std::has_nothrow_default_constructor::value, ""); static_assert(!std::has_nothrow_default_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(); }; int main() { test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_default_constructor #include template void test_has_nothrow_default_constructor() { static_assert( std::has_nothrow_default_constructor::value, ""); static_assert( std::has_nothrow_default_constructor::value, ""); static_assert( std::has_nothrow_default_constructor::value, ""); static_assert( std::has_nothrow_default_constructor::value, ""); } template void test_has_not_nothrow_default_constructor() { static_assert(!std::has_nothrow_default_constructor::value, ""); static_assert(!std::has_nothrow_default_constructor::value, ""); static_assert(!std::has_nothrow_default_constructor::value, ""); static_assert(!std::has_nothrow_default_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(); }; int main() { test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_assign.pass.cpp index e1ed665d01a..a0cd0439768 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_assign.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_assign.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_constructor.pass.cpp index 1dfa5f1b15d..fb4e14f9c69 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_move_constructor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp index 9bb44c1cb40..06419502736 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_copy_assign #include template void test_has_trivial_assign() { static_assert( std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); static_assert( std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); } template void test_has_not_trivial_assign() { static_assert(!std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A& operator=(const A&); }; int main() { test_has_not_trivial_assign(); test_has_not_trivial_assign(); test_has_not_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_copy_assign #include template void test_has_trivial_assign() { static_assert( std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); static_assert( std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); } template void test_has_not_trivial_assign() { static_assert(!std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); static_assert(!std::has_trivial_copy_assign::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A& operator=(const A&); }; int main() { test_has_not_trivial_assign(); test_has_not_trivial_assign(); test_has_not_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp index e142ae75a14..711d9c3915a 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_copy_constructor #include template void test_has_trivial_copy_constructor() { static_assert( std::has_trivial_copy_constructor::value, ""); static_assert( std::has_trivial_copy_constructor::value, ""); static_assert( std::has_trivial_copy_constructor::value, ""); static_assert( std::has_trivial_copy_constructor::value, ""); } template void test_has_not_trivial_copy_constructor() { static_assert(!std::has_trivial_copy_constructor::value, ""); static_assert(!std::has_trivial_copy_constructor::value, ""); static_assert(!std::has_trivial_copy_constructor::value, ""); static_assert(!std::has_trivial_copy_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(const A&); }; int main() { test_has_not_trivial_copy_constructor(); test_has_not_trivial_copy_constructor(); test_has_not_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_copy_constructor #include template void test_has_trivial_copy_constructor() { static_assert( std::has_trivial_copy_constructor::value, ""); static_assert( std::has_trivial_copy_constructor::value, ""); static_assert( std::has_trivial_copy_constructor::value, ""); static_assert( std::has_trivial_copy_constructor::value, ""); } template void test_has_not_trivial_copy_constructor() { static_assert(!std::has_trivial_copy_constructor::value, ""); static_assert(!std::has_trivial_copy_constructor::value, ""); static_assert(!std::has_trivial_copy_constructor::value, ""); static_assert(!std::has_trivial_copy_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(const A&); }; int main() { test_has_not_trivial_copy_constructor(); test_has_not_trivial_copy_constructor(); test_has_not_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp index 807e2e3a291..841fb37ec7c 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_default_constructor #include template void test_has_trivial_default_constructor() { static_assert( std::has_trivial_default_constructor::value, ""); static_assert( std::has_trivial_default_constructor::value, ""); static_assert( std::has_trivial_default_constructor::value, ""); static_assert( std::has_trivial_default_constructor::value, ""); } template void test_has_not_trivial_default_constructor() { static_assert(!std::has_trivial_default_constructor::value, ""); static_assert(!std::has_trivial_default_constructor::value, ""); static_assert(!std::has_trivial_default_constructor::value, ""); static_assert(!std::has_trivial_default_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(); }; int main() { test_has_not_trivial_default_constructor(); test_has_not_trivial_default_constructor(); test_has_not_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_default_constructor #include template void test_has_trivial_default_constructor() { static_assert( std::has_trivial_default_constructor::value, ""); static_assert( std::has_trivial_default_constructor::value, ""); static_assert( std::has_trivial_default_constructor::value, ""); static_assert( std::has_trivial_default_constructor::value, ""); } template void test_has_not_trivial_default_constructor() { static_assert(!std::has_trivial_default_constructor::value, ""); static_assert(!std::has_trivial_default_constructor::value, ""); static_assert(!std::has_trivial_default_constructor::value, ""); static_assert(!std::has_trivial_default_constructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(); }; int main() { test_has_not_trivial_default_constructor(); test_has_not_trivial_default_constructor(); test_has_not_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_destructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_destructor.pass.cpp index cacb0754944..b0b09d9c8a9 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_destructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_destructor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_destructor #include template void test_has_trivial_destructor() { static_assert( std::has_trivial_destructor::value, ""); static_assert( std::has_trivial_destructor::value, ""); static_assert( std::has_trivial_destructor::value, ""); static_assert( std::has_trivial_destructor::value, ""); } template void test_has_not_trivial_destructor() { static_assert(!std::has_trivial_destructor::value, ""); static_assert(!std::has_trivial_destructor::value, ""); static_assert(!std::has_trivial_destructor::value, ""); static_assert(!std::has_trivial_destructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { ~A(); }; int main() { test_has_not_trivial_destructor(); test_has_not_trivial_destructor(); test_has_not_trivial_destructor(); test_has_not_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_trivial_destructor #include template void test_has_trivial_destructor() { static_assert( std::has_trivial_destructor::value, ""); static_assert( std::has_trivial_destructor::value, ""); static_assert( std::has_trivial_destructor::value, ""); static_assert( std::has_trivial_destructor::value, ""); } template void test_has_not_trivial_destructor() { static_assert(!std::has_trivial_destructor::value, ""); static_assert(!std::has_trivial_destructor::value, ""); static_assert(!std::has_trivial_destructor::value, ""); static_assert(!std::has_trivial_destructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { ~A(); }; int main() { test_has_not_trivial_destructor(); test_has_not_trivial_destructor(); test_has_not_trivial_destructor(); test_has_not_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); test_has_trivial_destructor(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_assign.pass.cpp index 9ca95a40c26..c1d2246f449 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_assign.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_assign.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_constructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_constructor.pass.cpp index 245c5892cf2..d5068f549d3 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_constructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_move_constructor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp index 7563806f0de..05198ba130d 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_virtual_destructor #include template void test_has_virtual_destructor() { static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); } template void test_has_not_virtual_destructor() { static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { ~A(); }; int main() { test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_virtual_destructor(); test_has_virtual_destructor(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_virtual_destructor #include template void test_has_virtual_destructor() { static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); static_assert( std::has_virtual_destructor::value, ""); } template void test_has_not_virtual_destructor() { static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); static_assert(!std::has_virtual_destructor::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { ~A(); }; int main() { test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_not_virtual_destructor(); test_has_virtual_destructor(); test_has_virtual_destructor(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp index b213049025c..583cbff8ffa 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_abstract #include template void test_is_abstract() { static_assert( std::is_abstract::value, ""); static_assert( std::is_abstract::value, ""); static_assert( std::is_abstract::value, ""); static_assert( std::is_abstract::value, ""); } template void test_is_not_abstract() { static_assert(!std::is_abstract::value, ""); static_assert(!std::is_abstract::value, ""); static_assert(!std::is_abstract::value, ""); static_assert(!std::is_abstract::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; int main() { test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_abstract(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_abstract #include template void test_is_abstract() { static_assert( std::is_abstract::value, ""); static_assert( std::is_abstract::value, ""); static_assert( std::is_abstract::value, ""); static_assert( std::is_abstract::value, ""); } template void test_is_not_abstract() { static_assert(!std::is_abstract::value, ""); static_assert(!std::is_abstract::value, ""); static_assert(!std::is_abstract::value, ""); static_assert(!std::is_abstract::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; int main() { test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_not_abstract(); test_is_abstract(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp index fc3a459ee9a..c56b78ba519 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_const #include template void test_is_const() { static_assert(!std::is_const::value, ""); static_assert( std::is_const::value, ""); static_assert(!std::is_const::value, ""); static_assert( std::is_const::value, ""); } int main() { test_is_const(); test_is_const(); test_is_const(); test_is_const(); test_is_const(); test_is_const(); test_is_const(); static_assert(!std::is_const::value, ""); static_assert(!std::is_const::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_const #include template void test_is_const() { static_assert(!std::is_const::value, ""); static_assert( std::is_const::value, ""); static_assert(!std::is_const::value, ""); static_assert( std::is_const::value, ""); } int main() { test_is_const(); test_is_const(); test_is_const(); test_is_const(); test_is_const(); test_is_const(); test_is_const(); static_assert(!std::is_const::value, ""); static_assert(!std::is_const::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp index 0868242ce27..a4601fd9b6a 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // template // struct is_constructible; #include #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE struct A { explicit A(int); A(int, double); }; #endif int main() { #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE static_assert((std::is_constructible::value), ""); static_assert((std::is_constructible::value), ""); static_assert((std::is_constructible::value), ""); static_assert((std::is_constructible::value), ""); static_assert((!std::is_constructible::value), ""); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // template // struct is_constructible; #include #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE struct A { explicit A(int); A(int, double); }; #endif int main() { #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE static_assert((std::is_constructible::value), ""); static_assert((std::is_constructible::value), ""); static_assert((std::is_constructible::value), ""); static_assert((std::is_constructible::value), ""); static_assert((!std::is_constructible::value), ""); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp index b365dfb11f7..e1dc14f7e70 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_empty #include template void test_is_empty() { static_assert( std::is_empty::value, ""); static_assert( std::is_empty::value, ""); static_assert( std::is_empty::value, ""); static_assert( std::is_empty::value, ""); } template void test_is_not_empty() { static_assert(!std::is_empty::value, ""); static_assert(!std::is_empty::value, ""); static_assert(!std::is_empty::value, ""); static_assert(!std::is_empty::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; int main() { test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_empty(); test_is_empty(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_empty #include template void test_is_empty() { static_assert( std::is_empty::value, ""); static_assert( std::is_empty::value, ""); static_assert( std::is_empty::value, ""); static_assert( std::is_empty::value, ""); } template void test_is_not_empty() { static_assert(!std::is_empty::value, ""); static_assert(!std::is_empty::value, ""); static_assert(!std::is_empty::value, ""); static_assert(!std::is_empty::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; int main() { test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); test_is_empty(); test_is_empty(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp index b2827155f4f..cbce73730c4 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_literal_type #include int main() { static_assert( std::is_literal_type::value, ""); static_assert( std::is_literal_type::value, ""); static_assert(!std::is_literal_type::value, ""); static_assert(!std::is_literal_type::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_literal_type #include int main() { static_assert( std::is_literal_type::value, ""); static_assert( std::is_literal_type::value, ""); static_assert(!std::is_literal_type::value, ""); static_assert(!std::is_literal_type::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp index e839e09254b..0974ee3aa33 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // template // struct is_nothrow_constructible; #include #ifndef _LIBCPP_HAS_NO_VARIADICS class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(const A&); }; #endif int main() { #ifndef _LIBCPP_HAS_NO_VARIADICS static_assert((std::is_nothrow_constructible::value), ""); #endif } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // template // struct is_nothrow_constructible; #include #ifndef _LIBCPP_HAS_NO_VARIADICS class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A(const A&); }; #endif int main() { #ifndef _LIBCPP_HAS_NO_VARIADICS static_assert((std::is_nothrow_constructible::value), ""); #endif } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp index f55427906ca..8f783b0734a 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_pod #include template void test_is_pod() { static_assert( std::is_pod::value, ""); static_assert( std::is_pod::value, ""); static_assert( std::is_pod::value, ""); static_assert( std::is_pod::value, ""); } template void test_is_not_pod() { static_assert(!std::is_pod::value, ""); static_assert(!std::is_pod::value, ""); static_assert(!std::is_pod::value, ""); static_assert(!std::is_pod::value, ""); } class Class { public: ~Class(); }; int main() { test_is_not_pod(); test_is_not_pod(); test_is_not_pod(); test_is_pod(); test_is_pod(); test_is_pod(); test_is_pod(); test_is_pod(); test_is_pod(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_pod #include template void test_is_pod() { static_assert( std::is_pod::value, ""); static_assert( std::is_pod::value, ""); static_assert( std::is_pod::value, ""); static_assert( std::is_pod::value, ""); } template void test_is_not_pod() { static_assert(!std::is_pod::value, ""); static_assert(!std::is_pod::value, ""); static_assert(!std::is_pod::value, ""); static_assert(!std::is_pod::value, ""); } class Class { public: ~Class(); }; int main() { test_is_not_pod(); test_is_not_pod(); test_is_not_pod(); test_is_pod(); test_is_pod(); test_is_pod(); test_is_pod(); test_is_pod(); test_is_pod(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp index b933b7e7e48..07004b9fa89 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_polymorphic #include template void test_is_polymorphic() { static_assert( std::is_polymorphic::value, ""); static_assert( std::is_polymorphic::value, ""); static_assert( std::is_polymorphic::value, ""); static_assert( std::is_polymorphic::value, ""); } template void test_is_not_polymorphic() { static_assert(!std::is_polymorphic::value, ""); static_assert(!std::is_polymorphic::value, ""); static_assert(!std::is_polymorphic::value, ""); static_assert(!std::is_polymorphic::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; int main() { test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_polymorphic(); test_is_polymorphic(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_polymorphic #include template void test_is_polymorphic() { static_assert( std::is_polymorphic::value, ""); static_assert( std::is_polymorphic::value, ""); static_assert( std::is_polymorphic::value, ""); static_assert( std::is_polymorphic::value, ""); } template void test_is_not_polymorphic() { static_assert(!std::is_polymorphic::value, ""); static_assert(!std::is_polymorphic::value, ""); static_assert(!std::is_polymorphic::value, ""); static_assert(!std::is_polymorphic::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; int main() { test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_not_polymorphic(); test_is_polymorphic(); test_is_polymorphic(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp index 53d788228a8..0416e3a96b6 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_signed #include template void test_is_signed() { static_assert( std::is_signed::value, ""); static_assert( std::is_signed::value, ""); static_assert( std::is_signed::value, ""); static_assert( std::is_signed::value, ""); } template void test_is_not_signed() { static_assert(!std::is_signed::value, ""); static_assert(!std::is_signed::value, ""); static_assert(!std::is_signed::value, ""); static_assert(!std::is_signed::value, ""); } class Class { public: ~Class(); }; int main() { test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_signed(); test_is_signed(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_signed #include template void test_is_signed() { static_assert( std::is_signed::value, ""); static_assert( std::is_signed::value, ""); static_assert( std::is_signed::value, ""); static_assert( std::is_signed::value, ""); } template void test_is_not_signed() { static_assert(!std::is_signed::value, ""); static_assert(!std::is_signed::value, ""); static_assert(!std::is_signed::value, ""); static_assert(!std::is_signed::value, ""); } class Class { public: ~Class(); }; int main() { test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_not_signed(); test_is_signed(); test_is_signed(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp index f88d2e697bb..ede3b834a5f 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_standard_layout #include int main() { static_assert( std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_standard_layout #include int main() { static_assert( std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp index 484bfaabad4..3a48ccab228 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_trivial #include int main() { static_assert( std::is_trivial::value, ""); static_assert(!std::is_trivial::value, ""); static_assert(!std::is_trivial::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_trivial #include int main() { static_assert( std::is_trivial::value, ""); static_assert(!std::is_trivial::value, ""); static_assert(!std::is_trivial::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp index 872b23442b2..b589c2b9291 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_trivially_copyable #include #include struct A { int i_; }; struct B { int i_; ~B() {assert(i_ == 0);} }; int main() { static_assert( std::is_trivially_copyable::value, ""); static_assert( std::is_trivially_copyable::value, ""); static_assert(!std::is_trivially_copyable::value, ""); static_assert( std::is_trivially_copyable::value, ""); static_assert( std::is_trivially_copyable::value, ""); static_assert(!std::is_trivially_copyable::value, ""); static_assert(!std::is_trivially_copyable::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_trivially_copyable #include #include struct A { int i_; }; struct B { int i_; ~B() {assert(i_ == 0);} }; int main() { static_assert( std::is_trivially_copyable::value, ""); static_assert( std::is_trivially_copyable::value, ""); static_assert(!std::is_trivially_copyable::value, ""); static_assert( std::is_trivially_copyable::value, ""); static_assert( std::is_trivially_copyable::value, ""); static_assert(!std::is_trivially_copyable::value, ""); static_assert(!std::is_trivially_copyable::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp index 8d6b6b0f634..9967cc4ab41 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_unsigned #include template void test_is_unsigned() { static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); } template void test_is_not_unsigned() { static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); } class Class { public: ~Class(); }; int main() { test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_unsigned(); test_is_unsigned(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_unsigned #include template void test_is_unsigned() { static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); } template void test_is_not_unsigned() { static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); } class Class { public: ~Class(); }; int main() { test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_unsigned(); test_is_unsigned(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp index 19b2cfa273a..00ff887e696 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_volatile #include template void test_is_volatile() { static_assert(!std::is_volatile::value, ""); static_assert(!std::is_volatile::value, ""); static_assert( std::is_volatile::value, ""); static_assert( std::is_volatile::value, ""); } int main() { test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); static_assert(!std::is_volatile::value, ""); static_assert(!std::is_volatile::value, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_volatile #include template void test_is_volatile() { static_assert(!std::is_volatile::value, ""); static_assert(!std::is_volatile::value, ""); static_assert( std::is_volatile::value, ""); static_assert( std::is_volatile::value, ""); } int main() { test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); test_is_volatile(); static_assert(!std::is_volatile::value, ""); static_assert(!std::is_volatile::value, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/rank.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/rank.pass.cpp index bfb96b22c42..0cd61f685f0 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/rank.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/rank.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // rank #include template void test_rank() { static_assert( std::rank::value == A, ""); static_assert( std::rank::value == A, ""); static_assert( std::rank::value == A, ""); static_assert( std::rank::value == A, ""); } class Class { public: ~Class(); }; int main() { test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // rank #include template void test_rank() { static_assert( std::rank::value == A, ""); static_assert( std::rank::value == A, ""); static_assert( std::rank::value == A, ""); static_assert( std::rank::value == A, ""); } class Class { public: ~Class(); }; int main() { test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); test_rank(); } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/meta.unary/nothing_to_do.pass.cpp b/libcxx/test/utilities/meta/meta.unary/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/meta/meta.unary/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/meta/version.pass.cpp b/libcxx/test/utilities/meta/version.pass.cpp index 0286825f5c4..513d4080a53 100644 --- a/libcxx/test/utilities/meta/version.pass.cpp +++ b/libcxx/test/utilities/meta/version.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/nothing_to_do.pass.cpp b/libcxx/test/utilities/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.fail.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.fail.cpp index ca3af4bec2a..4b88d7ca1af 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_add #include int main() { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_add #include int main() { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.pass.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.pass.cpp index 596710f216e..8ab8ad98527 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_add.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_add #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 2 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 3 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_add::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_add::type R; static_assert(R::num == 127970191639601LL && R::den == 5177331081415LL, ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_add #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 2 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 3 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_add::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_add::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_add::type R; static_assert(R::num == 127970191639601LL && R::den == 5177331081415LL, ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.fail.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.fail.cpp index 00724156ab3..6058f7cdb9e 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_divide #include int main() { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<1, 2> R2; typedef std::ratio_divide::type R; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_divide #include int main() { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<1, 2> R2; typedef std::ratio_divide::type R; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.pass.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.pass.cpp index 64fa46a4264..79623e67498 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_divide.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_divide #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == 1 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_divide::type R; static_assert(R::num == 630992477165LL && R::den == 127339199162436LL, ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_divide #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == 1 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_divide::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_divide::type R; static_assert(R::num == 630992477165LL && R::den == 127339199162436LL, ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.fail.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.fail.cpp index c01538f015b..04e7683d18d 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_multiply #include int main() { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<2, 1> R2; typedef std::ratio_multiply::type R; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_multiply #include int main() { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<2, 1> R2; typedef std::ratio_multiply::type R; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.pass.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.pass.cpp index ae7d439f1f2..b4b3f6a725e 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_multiply.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_multiply #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == 1 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_multiply::type R; static_assert(R::num == 15519594064236LL && R::den == 5177331081415LL, ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_multiply #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == 1 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == 1 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_multiply::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_multiply::type R; static_assert(R::num == 15519594064236LL && R::den == 5177331081415LL, ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.fail.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.fail.cpp index f5ce71b2daf..7d03fb7a694 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_subtract #include int main() { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_subtract #include int main() { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.pass.cpp b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.pass.cpp index 25ea9f781f3..3068ecaf997 100644 --- a/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.arithmetic/ratio_subtract.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_subtract #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == 0 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -3 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -3 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == 3 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == 3 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -126708206685271LL && R::den == 5177331081415LL, ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_subtract #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == 0 && R::den == 1, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -1 && R::den == 2, ""); } { typedef std::ratio<-1, 2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -3 && R::den == 2, ""); } { typedef std::ratio<1, -2> R1; typedef std::ratio<1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -3 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<-1, 1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == 3 && R::den == 2, ""); } { typedef std::ratio<1, 2> R1; typedef std::ratio<1, -1> R2; typedef std::ratio_subtract::type R; static_assert(R::num == 3 && R::den == 2, ""); } { typedef std::ratio<56987354, 467584654> R1; typedef std::ratio<544668, 22145> R2; typedef std::ratio_subtract::type R; static_assert(R::num == -126708206685271LL && R::den == 5177331081415LL, ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp b/libcxx/test/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp index d56357be9a2..7f77c02b4cf 100644 --- a/libcxx/test/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((!std::ratio_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_equal::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((!std::ratio_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_equal::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp b/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp index 19014f57824..5f75f19dc5d 100644 --- a/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_greater #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((std::ratio_greater::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_greater::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_greater #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((std::ratio_greater::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_greater::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp b/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp index c47f1c79008..05533cfa7ac 100644 --- a/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_greater_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_greater_equal::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_greater_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_greater_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_greater_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_greater_equal::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.comparison/ratio_less.pass.cpp b/libcxx/test/utilities/ratio/ratio.comparison/ratio_less.pass.cpp index a650f8de7c9..0b264d840df 100644 --- a/libcxx/test/utilities/ratio/ratio.comparison/ratio_less.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.comparison/ratio_less.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_less #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFELL, 0x7FFFFFFFFFFFFFFDLL> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<641981, 1339063> R1; typedef std::ratio<1291640, 2694141LL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<1291640, 2694141LL> R1; typedef std::ratio<641981, 1339063> R2; static_assert((std::ratio_less::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_less #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFELL, 0x7FFFFFFFFFFFFFFDLL> R2; static_assert((std::ratio_less::value), ""); } { typedef std::ratio<641981, 1339063> R1; typedef std::ratio<1291640, 2694141LL> R2; static_assert((!std::ratio_less::value), ""); } { typedef std::ratio<1291640, 2694141LL> R1; typedef std::ratio<641981, 1339063> R2; static_assert((std::ratio_less::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp b/libcxx/test/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp index 59271d3e570..3db02068ab3 100644 --- a/libcxx/test/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_less_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((!std::ratio_less_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_less_equal::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_less_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((!std::ratio_less_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_less_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_less_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_less_equal::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp b/libcxx/test/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp index fec10a3f7c3..fa35cef7046 100644 --- a/libcxx/test/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_not_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((std::ratio_not_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_not_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_not_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_not_equal::value), ""); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio_not_equal #include int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; static_assert((!std::ratio_not_equal::value), ""); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; static_assert((std::ratio_not_equal::value), ""); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_not_equal::value), ""); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; static_assert((std::ratio_not_equal::value), ""); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; static_assert((std::ratio_not_equal::value), ""); } } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.ratio/ratio.pass.cpp b/libcxx/test/utilities/ratio/ratio.ratio/ratio.pass.cpp index 18be924dfbe..c2c8166fbe8 100644 --- a/libcxx/test/utilities/ratio/ratio.ratio/ratio.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.ratio/ratio.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: The static data members num and den shall have thcommon // divisor of the absolute values of N and D: #include template void test() { static_assert((std::ratio::num == eN), ""); static_assert((std::ratio::den == eD), ""); } int main() { test<1, 1, 1, 1>(); test<1, 10, 1, 10>(); test<10, 10, 1, 1>(); test<10, 1, 10, 1>(); test<12, 4, 3, 1>(); test<12, -4, -3, 1>(); test<-12, 4, -3, 1>(); test<-12, -4, 3, 1>(); test<4, 12, 1, 3>(); test<4, -12, -1, 3>(); test<-4, 12, -1, 3>(); test<-4, -12, 1, 3>(); test<222, 333, 2, 3>(); test<222, -333, -2, 3>(); test<-222, 333, -2, 3>(); test<-222, -333, 2, 3>(); test<0x7FFFFFFFFFFFFFFFLL, 127, 72624976668147841LL, 1>(); test<-0x7FFFFFFFFFFFFFFFLL, 127, -72624976668147841LL, 1>(); test<0x7FFFFFFFFFFFFFFFLL, -127, -72624976668147841LL, 1>(); test<-0x7FFFFFFFFFFFFFFFLL, -127, 72624976668147841LL, 1>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: The static data members num and den shall have thcommon // divisor of the absolute values of N and D: #include template void test() { static_assert((std::ratio::num == eN), ""); static_assert((std::ratio::den == eD), ""); } int main() { test<1, 1, 1, 1>(); test<1, 10, 1, 10>(); test<10, 10, 1, 1>(); test<10, 1, 10, 1>(); test<12, 4, 3, 1>(); test<12, -4, -3, 1>(); test<-12, 4, -3, 1>(); test<-12, -4, 3, 1>(); test<4, 12, 1, 3>(); test<4, -12, -1, 3>(); test<-4, 12, -1, 3>(); test<-4, -12, 1, 3>(); test<222, 333, 2, 3>(); test<222, -333, -2, 3>(); test<-222, 333, -2, 3>(); test<-222, -333, 2, 3>(); test<0x7FFFFFFFFFFFFFFFLL, 127, 72624976668147841LL, 1>(); test<-0x7FFFFFFFFFFFFFFFLL, 127, -72624976668147841LL, 1>(); test<0x7FFFFFFFFFFFFFFFLL, -127, -72624976668147841LL, 1>(); test<-0x7FFFFFFFFFFFFFFFLL, -127, 72624976668147841LL, 1>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.ratio/ratio1.fail.cpp b/libcxx/test/utilities/ratio/ratio.ratio/ratio1.fail.cpp index 6304b2ef23a..f3d12d2a0e7 100644 --- a/libcxx/test/utilities/ratio/ratio.ratio/ratio1.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.ratio/ratio1.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: The template argument D shall not be zero #include #include int main() { const std::intmax_t t1 = std::ratio<1, 0>::num; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: The template argument D shall not be zero #include #include int main() { const std::intmax_t t1 = std::ratio<1, 0>::num; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.ratio/ratio2.fail.cpp b/libcxx/test/utilities/ratio/ratio.ratio/ratio2.fail.cpp index 99f352acc1e..e371ed9d064 100644 --- a/libcxx/test/utilities/ratio/ratio.ratio/ratio2.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.ratio/ratio2.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: the absolute values of the template arguments N and D // shall be representable by type intmax_t. #include #include int main() { const std::intmax_t t1 = std::ratio<0x8000000000000000ULL, 1>::num; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: the absolute values of the template arguments N and D // shall be representable by type intmax_t. #include #include int main() { const std::intmax_t t1 = std::ratio<0x8000000000000000ULL, 1>::num; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.ratio/ratio3.fail.cpp b/libcxx/test/utilities/ratio/ratio.ratio/ratio3.fail.cpp index 3e99b6eeebd..36097d023b2 100644 --- a/libcxx/test/utilities/ratio/ratio.ratio/ratio3.fail.cpp +++ b/libcxx/test/utilities/ratio/ratio.ratio/ratio3.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: the absolute values of the template arguments N and D // shall be representable by type intmax_t. #include #include int main() { const std::intmax_t t1 = std::ratio<1, 0x8000000000000000ULL>::num; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio: the absolute values of the template arguments N and D // shall be representable by type intmax_t. #include #include int main() { const std::intmax_t t1 = std::ratio<1, 0x8000000000000000ULL>::num; } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/ratio.si/nothing_to_do.pass.cpp b/libcxx/test/utilities/ratio/ratio.si/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/ratio/ratio.si/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/ratio/ratio.si/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/typedefs.pass.cpp b/libcxx/test/utilities/ratio/typedefs.pass.cpp index 68bfa8d7540..83ef47ec2e2 100644 --- a/libcxx/test/utilities/ratio/typedefs.pass.cpp +++ b/libcxx/test/utilities/ratio/typedefs.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio typedef's #include int main() { static_assert(std::atto::num == 1 && std::atto::den == 1000000000000000000ULL, ""); static_assert(std::femto::num == 1 && std::femto::den == 1000000000000000ULL, ""); static_assert(std::pico::num == 1 && std::pico::den == 1000000000000ULL, ""); static_assert(std::nano::num == 1 && std::nano::den == 1000000000ULL, ""); static_assert(std::micro::num == 1 && std::micro::den == 1000000ULL, ""); static_assert(std::milli::num == 1 && std::milli::den == 1000ULL, ""); static_assert(std::centi::num == 1 && std::centi::den == 100ULL, ""); static_assert(std::deci::num == 1 && std::deci::den == 10ULL, ""); static_assert(std::deca::num == 10ULL && std::deca::den == 1, ""); static_assert(std::hecto::num == 100ULL && std::hecto::den == 1, ""); static_assert(std::kilo::num == 1000ULL && std::kilo::den == 1, ""); static_assert(std::mega::num == 1000000ULL && std::mega::den == 1, ""); static_assert(std::giga::num == 1000000000ULL && std::giga::den == 1, ""); static_assert(std::tera::num == 1000000000000ULL && std::tera::den == 1, ""); static_assert(std::peta::num == 1000000000000000ULL && std::peta::den == 1, ""); static_assert(std::exa::num == 1000000000000000000ULL && std::exa::den == 1, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test ratio typedef's #include int main() { static_assert(std::atto::num == 1 && std::atto::den == 1000000000000000000ULL, ""); static_assert(std::femto::num == 1 && std::femto::den == 1000000000000000ULL, ""); static_assert(std::pico::num == 1 && std::pico::den == 1000000000000ULL, ""); static_assert(std::nano::num == 1 && std::nano::den == 1000000000ULL, ""); static_assert(std::micro::num == 1 && std::micro::den == 1000000ULL, ""); static_assert(std::milli::num == 1 && std::milli::den == 1000ULL, ""); static_assert(std::centi::num == 1 && std::centi::den == 100ULL, ""); static_assert(std::deci::num == 1 && std::deci::den == 10ULL, ""); static_assert(std::deca::num == 10ULL && std::deca::den == 1, ""); static_assert(std::hecto::num == 100ULL && std::hecto::den == 1, ""); static_assert(std::kilo::num == 1000ULL && std::kilo::den == 1, ""); static_assert(std::mega::num == 1000000ULL && std::mega::den == 1, ""); static_assert(std::giga::num == 1000000000ULL && std::giga::den == 1, ""); static_assert(std::tera::num == 1000000000000ULL && std::tera::den == 1, ""); static_assert(std::peta::num == 1000000000000000ULL && std::peta::den == 1, ""); static_assert(std::exa::num == 1000000000000000000ULL && std::exa::den == 1, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/ratio/version.pass.cpp b/libcxx/test/utilities/ratio/version.pass.cpp index c381cecb027..1d6b9e4c938 100644 --- a/libcxx/test/utilities/ratio/version.pass.cpp +++ b/libcxx/test/utilities/ratio/version.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp index 5bc60f05367..e446fc00704 100644 --- a/libcxx/test/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset(const char *str); #include #include template void test_char_pointer_ctor() { { try { std::bitset v("xxx1010101010xxxx"); assert(false); } catch (std::invalid_argument&) { } } { const char str[] ="1010101010"; std::bitset v(str); std::size_t M = std::min(N, 10); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (str[M - 1 - i] == '1')); for (std::size_t i = 10; i < N; ++i) assert(v[i] == false); } } int main() { test_char_pointer_ctor<0>(); test_char_pointer_ctor<1>(); test_char_pointer_ctor<31>(); test_char_pointer_ctor<32>(); test_char_pointer_ctor<33>(); test_char_pointer_ctor<63>(); test_char_pointer_ctor<64>(); test_char_pointer_ctor<65>(); test_char_pointer_ctor<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset(const char *str); #include #include template void test_char_pointer_ctor() { { try { std::bitset v("xxx1010101010xxxx"); assert(false); } catch (std::invalid_argument&) { } } { const char str[] ="1010101010"; std::bitset v(str); std::size_t M = std::min(N, 10); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (str[M - 1 - i] == '1')); for (std::size_t i = 10; i < N; ++i) assert(v[i] == false); } } int main() { test_char_pointer_ctor<0>(); test_char_pointer_ctor<1>(); test_char_pointer_ctor<31>(); test_char_pointer_ctor<32>(); test_char_pointer_ctor<33>(); test_char_pointer_ctor<63>(); test_char_pointer_ctor<64>(); test_char_pointer_ctor<65>(); test_char_pointer_ctor<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.cons/default.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.cons/default.pass.cpp index 8470ee54760..e0abc516e15 100644 --- a/libcxx/test/utilities/template.bitset/bitset.cons/default.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.cons/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test default ctor #include #include template void test_default_ctor() { { std::bitset v1; assert(v1.size() == N); for (std::size_t i = 0; i < N; ++i) assert(v1[i] == false); } } int main() { test_default_ctor<0>(); test_default_ctor<1>(); test_default_ctor<31>(); test_default_ctor<32>(); test_default_ctor<33>(); test_default_ctor<63>(); test_default_ctor<64>(); test_default_ctor<65>(); test_default_ctor<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test default ctor #include #include template void test_default_ctor() { { std::bitset v1; assert(v1.size() == N); for (std::size_t i = 0; i < N; ++i) assert(v1[i] == false); } } int main() { test_default_ctor<0>(); test_default_ctor<1>(); test_default_ctor<31>(); test_default_ctor<32>(); test_default_ctor<33>(); test_default_ctor<63>(); test_default_ctor<64>(); test_default_ctor<65>(); test_default_ctor<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp index 4af86503eb4..800dfc6db3e 100644 --- a/libcxx/test/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset(string, pos, n, zero, one); #include #include template void test_string_ctor() { { try { std::string str("xxx1010101010xxxx"); std::bitset v(str, str.size()+1, 10); assert(false); } catch (std::out_of_range&) { } } { try { std::string str("xxx1010101010xxxx"); std::bitset v(str, 2, 10); assert(false); } catch (std::invalid_argument&) { } } { std::string str("xxx1010101010xxxx"); std::bitset v(str, 3, 10); std::size_t M = std::min(N, 10); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (str[3 + M - 1 - i] == '1')); for (std::size_t i = 10; i < N; ++i) assert(v[i] == false); } { try { std::string str("xxxbababababaxxxx"); std::bitset v(str, 2, 10, 'a', 'b'); assert(false); } catch (std::invalid_argument&) { } } { std::string str("xxxbababababaxxxx"); std::bitset v(str, 3, 10, 'a', 'b'); std::size_t M = std::min(N, 10); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (str[3 + M - 1 - i] == 'b')); for (std::size_t i = 10; i < N; ++i) assert(v[i] == false); } } int main() { test_string_ctor<0>(); test_string_ctor<1>(); test_string_ctor<31>(); test_string_ctor<32>(); test_string_ctor<33>(); test_string_ctor<63>(); test_string_ctor<64>(); test_string_ctor<65>(); test_string_ctor<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset(string, pos, n, zero, one); #include #include template void test_string_ctor() { { try { std::string str("xxx1010101010xxxx"); std::bitset v(str, str.size()+1, 10); assert(false); } catch (std::out_of_range&) { } } { try { std::string str("xxx1010101010xxxx"); std::bitset v(str, 2, 10); assert(false); } catch (std::invalid_argument&) { } } { std::string str("xxx1010101010xxxx"); std::bitset v(str, 3, 10); std::size_t M = std::min(N, 10); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (str[3 + M - 1 - i] == '1')); for (std::size_t i = 10; i < N; ++i) assert(v[i] == false); } { try { std::string str("xxxbababababaxxxx"); std::bitset v(str, 2, 10, 'a', 'b'); assert(false); } catch (std::invalid_argument&) { } } { std::string str("xxxbababababaxxxx"); std::bitset v(str, 3, 10, 'a', 'b'); std::size_t M = std::min(N, 10); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (str[3 + M - 1 - i] == 'b')); for (std::size_t i = 10; i < N; ++i) assert(v[i] == false); } } int main() { test_string_ctor<0>(); test_string_ctor<1>(); test_string_ctor<31>(); test_string_ctor<32>(); test_string_ctor<33>(); test_string_ctor<63>(); test_string_ctor<64>(); test_string_ctor<65>(); test_string_ctor<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp index 6d39a625fee..6e20abd489e 100644 --- a/libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset(unsigned long long val); #include #include template void test_val_ctor() { { std::bitset v(0xAAAAAAAAAAAAAAAAULL); assert(v.size() == N); unsigned M = std::min(N, 64); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (i & 1)); for (std::size_t i = M; i < N; ++i) assert(v[i] == false); } } int main() { test_val_ctor<0>(); test_val_ctor<1>(); test_val_ctor<31>(); test_val_ctor<32>(); test_val_ctor<33>(); test_val_ctor<63>(); test_val_ctor<64>(); test_val_ctor<65>(); test_val_ctor<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset(unsigned long long val); #include #include template void test_val_ctor() { { std::bitset v(0xAAAAAAAAAAAAAAAAULL); assert(v.size() == N); unsigned M = std::min(N, 64); for (std::size_t i = 0; i < M; ++i) assert(v[i] == (i & 1)); for (std::size_t i = M; i < N; ++i) assert(v[i] == false); } } int main() { test_val_ctor<0>(); test_val_ctor<1>(); test_val_ctor<31>(); test_val_ctor<32>(); test_val_ctor<33>(); test_val_ctor<63>(); test_val_ctor<64>(); test_val_ctor<65>(); test_val_ctor<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.hash/bitset.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.hash/bitset.pass.cpp index edfe45dce2b..09c25becda4 100644 --- a/libcxx/test/utilities/template.bitset/bitset.hash/bitset.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.hash/bitset.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/template.bitset/bitset.members/all.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/all.pass.cpp index 45a3cb46db6..fbe6447b075 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/all.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/all.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bool all() const; #include #include template void test_all() { std::bitset v; v.reset(); assert(v.all() == (N == 0)); v.set(); assert(v.all() == true); if (N > 1) { v[N/2] = false; assert(v.all() == false); } } int main() { test_all<0>(); test_all<1>(); test_all<31>(); test_all<32>(); test_all<33>(); test_all<63>(); test_all<64>(); test_all<65>(); test_all<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bool all() const; #include #include template void test_all() { std::bitset v; v.reset(); assert(v.all() == (N == 0)); v.set(); assert(v.all() == true); if (N > 1) { v[N/2] = false; assert(v.all() == false); } } int main() { test_all<0>(); test_all<1>(); test_all<31>(); test_all<32>(); test_all<33>(); test_all<63>(); test_all<64>(); test_all<65>(); test_all<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/any.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/any.pass.cpp index ede38cdcadf..40cd0067bc6 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/any.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/any.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bool any() const; #include #include template void test_any() { std::bitset v; v.reset(); assert(v.any() == false); v.set(); assert(v.any() == (N != 0)); if (N > 1) { v[N/2] = false; assert(v.any() == true); v.reset(); v[N/2] = true; assert(v.any() == true); } } int main() { test_any<0>(); test_any<1>(); test_any<31>(); test_any<32>(); test_any<33>(); test_any<63>(); test_any<64>(); test_any<65>(); test_any<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bool any() const; #include #include template void test_any() { std::bitset v; v.reset(); assert(v.any() == false); v.set(); assert(v.any() == (N != 0)); if (N > 1) { v[N/2] = false; assert(v.any() == true); v.reset(); v[N/2] = true; assert(v.any() == true); } } int main() { test_any<0>(); test_any<1>(); test_any<31>(); test_any<32>(); test_any<33>(); test_any<63>(); test_any<64>(); test_any<65>(); test_any<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/count.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/count.pass.cpp index fbb1cffc4ed..8b5a727361a 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/count.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/count.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test size_t count() const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_count() { const std::bitset v = make_bitset(); std::size_t c1 = v.count(); std::size_t c2 = 0; for (std::size_t i = 0; i < N; ++i) if (v[i]) ++c2; assert(c1 == c2); } int main() { test_count<0>(); test_count<1>(); test_count<31>(); test_count<32>(); test_count<33>(); test_count<63>(); test_count<64>(); test_count<65>(); test_count<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test size_t count() const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_count() { const std::bitset v = make_bitset(); std::size_t c1 = v.count(); std::size_t c2 = 0; for (std::size_t i = 0; i < N; ++i) if (v[i]) ++c2; assert(c1 == c2); } int main() { test_count<0>(); test_count<1>(); test_count<31>(); test_count<32>(); test_count<33>(); test_count<63>(); test_count<64>(); test_count<65>(); test_count<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/flip_all.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/flip_all.pass.cpp index bb180d7f2f0..790d0b22cd9 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/flip_all.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/flip_all.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& flip(); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_flip_all() { std::bitset v1 = make_bitset(); std::bitset v2 = v1; v2.flip(); for (std::size_t i = 0; i < N; ++i) assert(v2[i] == ~v1[i]); } int main() { test_flip_all<0>(); test_flip_all<1>(); test_flip_all<31>(); test_flip_all<32>(); test_flip_all<33>(); test_flip_all<63>(); test_flip_all<64>(); test_flip_all<65>(); test_flip_all<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& flip(); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_flip_all() { std::bitset v1 = make_bitset(); std::bitset v2 = v1; v2.flip(); for (std::size_t i = 0; i < N; ++i) assert(v2[i] == ~v1[i]); } int main() { test_flip_all<0>(); test_flip_all<1>(); test_flip_all<31>(); test_flip_all<32>(); test_flip_all<33>(); test_flip_all<63>(); test_flip_all<64>(); test_flip_all<65>(); test_flip_all<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/flip_one.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/flip_one.pass.cpp index 8985e374c92..10e1b7dbe4d 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/flip_one.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/flip_one.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& flip(size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_flip_one() { std::bitset v = make_bitset(); try { v.flip(50); bool b = v[50]; if (50 >= v.size()) assert(false); assert(v[50] == b); v.flip(50); assert(v[50] != b); v.flip(50); assert(v[50] == b); } catch (std::out_of_range&) { } } int main() { test_flip_one<0>(); test_flip_one<1>(); test_flip_one<31>(); test_flip_one<32>(); test_flip_one<33>(); test_flip_one<63>(); test_flip_one<64>(); test_flip_one<65>(); test_flip_one<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& flip(size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_flip_one() { std::bitset v = make_bitset(); try { v.flip(50); bool b = v[50]; if (50 >= v.size()) assert(false); assert(v[50] == b); v.flip(50); assert(v[50] != b); v.flip(50); assert(v[50] == b); } catch (std::out_of_range&) { } } int main() { test_flip_one<0>(); test_flip_one<1>(); test_flip_one<31>(); test_flip_one<32>(); test_flip_one<33>(); test_flip_one<63>(); test_flip_one<64>(); test_flip_one<65>(); test_flip_one<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/index.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/index.pass.cpp index f59e4746148..b18489037eb 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/index.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/index.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset::reference operator[](size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_index_const() { std::bitset v1 = make_bitset(); if (N > 0) { assert(v1[N/2] == v1.test(N/2)); typename std::bitset::reference r = v1[N/2]; assert(r == v1.test(N/2)); typename std::bitset::reference r2 = v1[N/2]; r = r2; assert(r == v1.test(N/2)); r = false; assert(r == false); assert(v1.test(N/2) == false); r = true; assert(r == true); assert(v1.test(N/2) == true); bool b = ~r; assert(r == true); assert(v1.test(N/2) == true); assert(b == false); r.flip(); assert(r == false); assert(v1.test(N/2) == false); } } int main() { test_index_const<0>(); test_index_const<1>(); test_index_const<31>(); test_index_const<32>(); test_index_const<33>(); test_index_const<63>(); test_index_const<64>(); test_index_const<65>(); test_index_const<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset::reference operator[](size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_index_const() { std::bitset v1 = make_bitset(); if (N > 0) { assert(v1[N/2] == v1.test(N/2)); typename std::bitset::reference r = v1[N/2]; assert(r == v1.test(N/2)); typename std::bitset::reference r2 = v1[N/2]; r = r2; assert(r == v1.test(N/2)); r = false; assert(r == false); assert(v1.test(N/2) == false); r = true; assert(r == true); assert(v1.test(N/2) == true); bool b = ~r; assert(r == true); assert(v1.test(N/2) == true); assert(b == false); r.flip(); assert(r == false); assert(v1.test(N/2) == false); } } int main() { test_index_const<0>(); test_index_const<1>(); test_index_const<31>(); test_index_const<32>(); test_index_const<33>(); test_index_const<63>(); test_index_const<64>(); test_index_const<65>(); test_index_const<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/index_const.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/index_const.pass.cpp index 0b74f8208f9..60973a275a8 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/index_const.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/index_const.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test constexpr bool operator[](size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_index_const() { const std::bitset v1 = make_bitset(); if (N > 0) { assert(v1[N/2] == v1.test(N/2)); } } int main() { test_index_const<0>(); test_index_const<1>(); test_index_const<31>(); test_index_const<32>(); test_index_const<33>(); test_index_const<63>(); test_index_const<64>(); test_index_const<65>(); test_index_const<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test constexpr bool operator[](size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_index_const() { const std::bitset v1 = make_bitset(); if (N > 0) { assert(v1[N/2] == v1.test(N/2)); } } int main() { test_index_const<0>(); test_index_const<1>(); test_index_const<31>(); test_index_const<32>(); test_index_const<33>(); test_index_const<63>(); test_index_const<64>(); test_index_const<65>(); test_index_const<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/left_shift.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/left_shift.pass.cpp index e6017e04525..b1d373187e4 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/left_shift.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/left_shift.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator<<(size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_left_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert((v1 <<= s) == (v2 << s)); } } int main() { test_left_shift<0>(); test_left_shift<1>(); test_left_shift<31>(); test_left_shift<32>(); test_left_shift<33>(); test_left_shift<63>(); test_left_shift<64>(); test_left_shift<65>(); test_left_shift<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator<<(size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_left_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert((v1 <<= s) == (v2 << s)); } } int main() { test_left_shift<0>(); test_left_shift<1>(); test_left_shift<31>(); test_left_shift<32>(); test_left_shift<33>(); test_left_shift<63>(); test_left_shift<64>(); test_left_shift<65>(); test_left_shift<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp index 11da5ad4cee..8ea0981c525 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator<<=(size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_left_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; v1 <<= s; for (std::size_t i = 0; i < N; ++i) if (i < s) assert(v1[i] == 0); else assert(v1[i] == v2[i-s]); } } int main() { test_left_shift<0>(); test_left_shift<1>(); test_left_shift<31>(); test_left_shift<32>(); test_left_shift<33>(); test_left_shift<63>(); test_left_shift<64>(); test_left_shift<65>(); test_left_shift<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator<<=(size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_left_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; v1 <<= s; for (std::size_t i = 0; i < N; ++i) if (i < s) assert(v1[i] == 0); else assert(v1[i] == v2[i-s]); } } int main() { test_left_shift<0>(); test_left_shift<1>(); test_left_shift<31>(); test_left_shift<32>(); test_left_shift<33>(); test_left_shift<63>(); test_left_shift<64>(); test_left_shift<65>(); test_left_shift<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/none.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/none.pass.cpp index a695285a45e..abba3fd54f0 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/none.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/none.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bool none() const; #include #include template void test_none() { std::bitset v; v.reset(); assert(v.none() == true); v.set(); assert(v.none() == (N == 0)); if (N > 1) { v[N/2] = false; assert(v.none() == false); v.reset(); v[N/2] = true; assert(v.none() == false); } } int main() { test_none<0>(); test_none<1>(); test_none<31>(); test_none<32>(); test_none<33>(); test_none<63>(); test_none<64>(); test_none<65>(); test_none<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bool none() const; #include #include template void test_none() { std::bitset v; v.reset(); assert(v.none() == true); v.set(); assert(v.none() == (N == 0)); if (N > 1) { v[N/2] = false; assert(v.none() == false); v.reset(); v[N/2] = true; assert(v.none() == false); } } int main() { test_none<0>(); test_none<1>(); test_none<31>(); test_none<32>(); test_none<33>(); test_none<63>(); test_none<64>(); test_none<65>(); test_none<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/not_all.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/not_all.pass.cpp index 4b5bcbd9222..edaeac67305 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/not_all.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/not_all.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator~() const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_not_all() { std::bitset v1 = make_bitset(); std::bitset v2 = ~v1; for (std::size_t i = 0; i < N; ++i) assert(v2[i] == ~v1[i]); } int main() { test_not_all<0>(); test_not_all<1>(); test_not_all<31>(); test_not_all<32>(); test_not_all<33>(); test_not_all<63>(); test_not_all<64>(); test_not_all<65>(); test_not_all<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator~() const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_not_all() { std::bitset v1 = make_bitset(); std::bitset v2 = ~v1; for (std::size_t i = 0; i < N; ++i) assert(v2[i] == ~v1[i]); } int main() { test_not_all<0>(); test_not_all<1>(); test_not_all<31>(); test_not_all<32>(); test_not_all<33>(); test_not_all<63>(); test_not_all<64>(); test_not_all<65>(); test_not_all<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp index 940ef95b991..420443ea3ac 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator&=(const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_and_eq() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; v1 &= v2; for (std::size_t i = 0; i < N; ++i) assert(v1[i] == (v3[i] && v2[i])); } int main() { test_op_and_eq<0>(); test_op_and_eq<1>(); test_op_and_eq<31>(); test_op_and_eq<32>(); test_op_and_eq<33>(); test_op_and_eq<63>(); test_op_and_eq<64>(); test_op_and_eq<65>(); test_op_and_eq<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator&=(const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_and_eq() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; v1 &= v2; for (std::size_t i = 0; i < N; ++i) assert(v1[i] == (v3[i] && v2[i])); } int main() { test_op_and_eq<0>(); test_op_and_eq<1>(); test_op_and_eq<31>(); test_op_and_eq<32>(); test_op_and_eq<33>(); test_op_and_eq<63>(); test_op_and_eq<64>(); test_op_and_eq<65>(); test_op_and_eq<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp index 8e2e5e593c1..beac3d31c77 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // bool operator==(const bitset& rhs) const; // bool operator!=(const bitset& rhs) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_equality() { const std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert(v1 == v2); if (N > 0) { v2[N/2].flip(); assert(v1 != v2); } } int main() { test_equality<0>(); test_equality<1>(); test_equality<31>(); test_equality<32>(); test_equality<33>(); test_equality<63>(); test_equality<64>(); test_equality<65>(); test_equality<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // bool operator==(const bitset& rhs) const; // bool operator!=(const bitset& rhs) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_equality() { const std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert(v1 == v2); if (N > 0) { v2[N/2].flip(); assert(v1 != v2); } } int main() { test_equality<0>(); test_equality<1>(); test_equality<31>(); test_equality<32>(); test_equality<33>(); test_equality<63>(); test_equality<64>(); test_equality<65>(); test_equality<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp index 70300d667dd..6de4b037693 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator|=(const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_or_eq() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; v1 |= v2; for (std::size_t i = 0; i < N; ++i) assert(v1[i] == (v3[i] || v2[i])); } int main() { test_op_or_eq<0>(); test_op_or_eq<1>(); test_op_or_eq<31>(); test_op_or_eq<32>(); test_op_or_eq<33>(); test_op_or_eq<63>(); test_op_or_eq<64>(); test_op_or_eq<65>(); test_op_or_eq<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator|=(const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_or_eq() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; v1 |= v2; for (std::size_t i = 0; i < N; ++i) assert(v1[i] == (v3[i] || v2[i])); } int main() { test_op_or_eq<0>(); test_op_or_eq<1>(); test_op_or_eq<31>(); test_op_or_eq<32>(); test_op_or_eq<33>(); test_op_or_eq<63>(); test_op_or_eq<64>(); test_op_or_eq<65>(); test_op_or_eq<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp index 00724f4d2ec..b02e5cd5d00 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator^=(const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_xor_eq() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; v1 ^= v2; for (std::size_t i = 0; i < N; ++i) assert(v1[i] == (v3[i] != v2[i])); } int main() { test_op_xor_eq<0>(); test_op_xor_eq<1>(); test_op_xor_eq<31>(); test_op_xor_eq<32>(); test_op_xor_eq<33>(); test_op_xor_eq<63>(); test_op_xor_eq<64>(); test_op_xor_eq<65>(); test_op_xor_eq<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator^=(const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_xor_eq() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; v1 ^= v2; for (std::size_t i = 0; i < N; ++i) assert(v1[i] == (v3[i] != v2[i])); } int main() { test_op_xor_eq<0>(); test_op_xor_eq<1>(); test_op_xor_eq<31>(); test_op_xor_eq<32>(); test_op_xor_eq<33>(); test_op_xor_eq<63>(); test_op_xor_eq<64>(); test_op_xor_eq<65>(); test_op_xor_eq<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/reset_all.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/reset_all.pass.cpp index 5bde1d374b9..0d8695bd089 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/reset_all.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/reset_all.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& reset(); #include #include template void test_reset_all() { std::bitset v; v.set(); v.reset(); for (std::size_t i = 0; i < N; ++i) assert(!v[i]); } int main() { test_reset_all<0>(); test_reset_all<1>(); test_reset_all<31>(); test_reset_all<32>(); test_reset_all<33>(); test_reset_all<63>(); test_reset_all<64>(); test_reset_all<65>(); test_reset_all<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& reset(); #include #include template void test_reset_all() { std::bitset v; v.set(); v.reset(); for (std::size_t i = 0; i < N; ++i) assert(!v[i]); } int main() { test_reset_all<0>(); test_reset_all<1>(); test_reset_all<31>(); test_reset_all<32>(); test_reset_all<33>(); test_reset_all<63>(); test_reset_all<64>(); test_reset_all<65>(); test_reset_all<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/reset_one.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/reset_one.pass.cpp index 631030a50d9..61c1410c007 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/reset_one.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/reset_one.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& reset(size_t pos); #include #include template void test_reset_one() { std::bitset v; try { v.set(); v.reset(50); if (50 >= v.size()) assert(false); for (unsigned i = 0; i < v.size(); ++i) if (i == 50) assert(!v[i]); else assert(v[i]); } catch (std::out_of_range&) { } } int main() { test_reset_one<0>(); test_reset_one<1>(); test_reset_one<31>(); test_reset_one<32>(); test_reset_one<33>(); test_reset_one<63>(); test_reset_one<64>(); test_reset_one<65>(); test_reset_one<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& reset(size_t pos); #include #include template void test_reset_one() { std::bitset v; try { v.set(); v.reset(50); if (50 >= v.size()) assert(false); for (unsigned i = 0; i < v.size(); ++i) if (i == 50) assert(!v[i]); else assert(v[i]); } catch (std::out_of_range&) { } } int main() { test_reset_one<0>(); test_reset_one<1>(); test_reset_one<31>(); test_reset_one<32>(); test_reset_one<33>(); test_reset_one<63>(); test_reset_one<64>(); test_reset_one<65>(); test_reset_one<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/right_shift.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/right_shift.pass.cpp index 372d32a0ac8..4c48638ed38 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/right_shift.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/right_shift.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator>>(size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_right_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert((v1 >>= s) == (v2 >> s)); } } int main() { test_right_shift<0>(); test_right_shift<1>(); test_right_shift<31>(); test_right_shift<32>(); test_right_shift<33>(); test_right_shift<63>(); test_right_shift<64>(); test_right_shift<65>(); test_right_shift<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator>>(size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_right_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert((v1 >>= s) == (v2 >> s)); } } int main() { test_right_shift<0>(); test_right_shift<1>(); test_right_shift<31>(); test_right_shift<32>(); test_right_shift<33>(); test_right_shift<63>(); test_right_shift<64>(); test_right_shift<65>(); test_right_shift<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp index 724c39e10c1..71f3347961b 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator<<=(size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_right_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; v1 >>= s; for (std::size_t i = 0; i < N; ++i) if (i + s < N) assert(v1[i] == v2[i + s]); else assert(v1[i] == 0); } } int main() { test_right_shift<0>(); test_right_shift<1>(); test_right_shift<31>(); test_right_shift<32>(); test_right_shift<33>(); test_right_shift<63>(); test_right_shift<64>(); test_right_shift<65>(); test_right_shift<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& operator<<=(size_t pos); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_right_shift() { for (std::size_t s = 0; s <= N+1; ++s) { std::bitset v1 = make_bitset(); std::bitset v2 = v1; v1 >>= s; for (std::size_t i = 0; i < N; ++i) if (i + s < N) assert(v1[i] == v2[i + s]); else assert(v1[i] == 0); } } int main() { test_right_shift<0>(); test_right_shift<1>(); test_right_shift<31>(); test_right_shift<32>(); test_right_shift<33>(); test_right_shift<63>(); test_right_shift<64>(); test_right_shift<65>(); test_right_shift<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/set_all.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/set_all.pass.cpp index a26a47dc7a9..289eae31622 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/set_all.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/set_all.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& set(); #include #include template void test_set_all() { std::bitset v; v.set(); for (std::size_t i = 0; i < N; ++i) assert(v[i]); } int main() { test_set_all<0>(); test_set_all<1>(); test_set_all<31>(); test_set_all<32>(); test_set_all<33>(); test_set_all<63>(); test_set_all<64>(); test_set_all<65>(); test_set_all<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& set(); #include #include template void test_set_all() { std::bitset v; v.set(); for (std::size_t i = 0; i < N; ++i) assert(v[i]); } int main() { test_set_all<0>(); test_set_all<1>(); test_set_all<31>(); test_set_all<32>(); test_set_all<33>(); test_set_all<63>(); test_set_all<64>(); test_set_all<65>(); test_set_all<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/set_one.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/set_one.pass.cpp index d01a70d49e5..899b2f4cfb8 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/set_one.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/set_one.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& set(size_t pos, bool val = true); #include #include template void test_set_one() { std::bitset v; try { v.set(50); if (50 >= v.size()) assert(false); assert(v[50]); } catch (std::out_of_range&) { } try { v.set(50, false); if (50 >= v.size()) assert(false); assert(!v[50]); } catch (std::out_of_range&) { } } int main() { test_set_one<0>(); test_set_one<1>(); test_set_one<31>(); test_set_one<32>(); test_set_one<33>(); test_set_one<63>(); test_set_one<64>(); test_set_one<65>(); test_set_one<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset& set(size_t pos, bool val = true); #include #include template void test_set_one() { std::bitset v; try { v.set(50); if (50 >= v.size()) assert(false); assert(v[50]); } catch (std::out_of_range&) { } try { v.set(50, false); if (50 >= v.size()) assert(false); assert(!v[50]); } catch (std::out_of_range&) { } } int main() { test_set_one<0>(); test_set_one<1>(); test_set_one<31>(); test_set_one<32>(); test_set_one<33>(); test_set_one<63>(); test_set_one<64>(); test_set_one<65>(); test_set_one<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/size.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/size.pass.cpp index 5641b1d2d3c..9109d2a2c0f 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/size.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/size.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test size_t count() const; #include #include template void test_size() { const std::bitset v; assert(v.size() == N); } int main() { test_size<0>(); test_size<1>(); test_size<31>(); test_size<32>(); test_size<33>(); test_size<63>(); test_size<64>(); test_size<65>(); test_size<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test size_t count() const; #include #include template void test_size() { const std::bitset v; assert(v.size() == N); } int main() { test_size<0>(); test_size<1>(); test_size<31>(); test_size<32>(); test_size<33>(); test_size<63>(); test_size<64>(); test_size<65>(); test_size<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/test.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/test.pass.cpp index 2f290377ec0..530cc1d9fe6 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/test.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/test.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test constexpr bool test(size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_test() { const std::bitset v1 = make_bitset(); try { bool b = v1.test(50); if (50 >= v1.size()) assert(false); assert(b == v1[50]); } catch (std::out_of_range&) { } } int main() { test_test<0>(); test_test<1>(); test_test<31>(); test_test<32>(); test_test<33>(); test_test<63>(); test_test<64>(); test_test<65>(); test_test<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test constexpr bool test(size_t pos) const; #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_test() { const std::bitset v1 = make_bitset(); try { bool b = v1.test(50); if (50 >= v1.size()) assert(false); assert(b == v1[50]); } catch (std::out_of_range&) { } } int main() { test_test<0>(); test_test<1>(); test_test<31>(); test_test<32>(); test_test<33>(); test_test<63>(); test_test<64>(); test_test<65>(); test_test<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/to_string.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/to_string.pass.cpp index c1c11f1002f..a44877902b3 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/to_string.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/to_string.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // template // basic_string // to_string(charT zero = charT('0'), charT one = charT('1')) const; // // template // basic_string > to_string() const; // // template // basic_string, allocator > to_string() const; // // basic_string, allocator > to_string() const; #include #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_to_string() { { std::bitset v = make_bitset(); { std::wstring s = v.template to_string, std::allocator >(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::wstring s = v.template to_string >(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.template to_string(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.to_string(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } } { std::bitset v = make_bitset(); { std::wstring s = v.template to_string, std::allocator >('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::wstring s = v.template to_string >('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.template to_string('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.to_string('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } } { std::bitset v = make_bitset(); { std::wstring s = v.template to_string, std::allocator >('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::wstring s = v.template to_string >('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.template to_string('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.to_string('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } } } int main() { test_to_string<0>(); test_to_string<1>(); test_to_string<31>(); test_to_string<32>(); test_to_string<33>(); test_to_string<63>(); test_to_string<64>(); test_to_string<65>(); test_to_string<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // template // basic_string // to_string(charT zero = charT('0'), charT one = charT('1')) const; // // template // basic_string > to_string() const; // // template // basic_string, allocator > to_string() const; // // basic_string, allocator > to_string() const; #include #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_to_string() { { std::bitset v = make_bitset(); { std::wstring s = v.template to_string, std::allocator >(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::wstring s = v.template to_string >(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.template to_string(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.to_string(); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } } { std::bitset v = make_bitset(); { std::wstring s = v.template to_string, std::allocator >('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::wstring s = v.template to_string >('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.template to_string('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.to_string('0'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } } { std::bitset v = make_bitset(); { std::wstring s = v.template to_string, std::allocator >('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::wstring s = v.template to_string >('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.template to_string('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } { std::string s = v.to_string('0', '1'); for (std::size_t i = 0; i < N; ++i) if (v[i]) assert(s[N - 1 - i] == '1'); else assert(s[N - 1 - i] == '0'); } } } int main() { test_to_string<0>(); test_to_string<1>(); test_to_string<31>(); test_to_string<32>(); test_to_string<33>(); test_to_string<63>(); test_to_string<64>(); test_to_string<65>(); test_to_string<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp index c975c187f7f..0fbf212e82e 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test unsigned long long to_ullong() const; #include #include #include #include template void test_to_ullong() { const std::size_t M = sizeof(unsigned long long) * CHAR_BIT < N ? sizeof(unsigned long long) * CHAR_BIT : N; const std::size_t X = M == 0 ? sizeof(unsigned long long) * CHAR_BIT - 1 : sizeof(unsigned long long) * CHAR_BIT - M; const unsigned long long max = M == 0 ? 0 : (unsigned long long)(-1) >> X; unsigned long long tests[] = {0, std::min(1, max), std::min(2, max), std::min(3, max), std::min(max, max-3), std::min(max, max-2), std::min(max, max-1), max}; for (std::size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) { unsigned long long j = tests[i]; std::bitset v(j); assert(j == v.to_ullong()); } } int main() { test_to_ullong<0>(); test_to_ullong<1>(); test_to_ullong<31>(); test_to_ullong<32>(); test_to_ullong<33>(); test_to_ullong<63>(); test_to_ullong<64>(); test_to_ullong<65>(); test_to_ullong<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test unsigned long long to_ullong() const; #include #include #include #include template void test_to_ullong() { const std::size_t M = sizeof(unsigned long long) * CHAR_BIT < N ? sizeof(unsigned long long) * CHAR_BIT : N; const std::size_t X = M == 0 ? sizeof(unsigned long long) * CHAR_BIT - 1 : sizeof(unsigned long long) * CHAR_BIT - M; const unsigned long long max = M == 0 ? 0 : (unsigned long long)(-1) >> X; unsigned long long tests[] = {0, std::min(1, max), std::min(2, max), std::min(3, max), std::min(max, max-3), std::min(max, max-2), std::min(max, max-1), max}; for (std::size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) { unsigned long long j = tests[i]; std::bitset v(j); assert(j == v.to_ullong()); } } int main() { test_to_ullong<0>(); test_to_ullong<1>(); test_to_ullong<31>(); test_to_ullong<32>(); test_to_ullong<33>(); test_to_ullong<63>(); test_to_ullong<64>(); test_to_ullong<65>(); test_to_ullong<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp index 954a5b52dab..da5f163362b 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test unsigned long to_ulong() const; #include #include #include #include template void test_to_ulong() { const std::size_t M = sizeof(unsigned long) * CHAR_BIT < N ? sizeof(unsigned long) * CHAR_BIT : N; const std::size_t X = M == 0 ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M; const std::size_t max = M == 0 ? 0 : std::size_t(-1) >> X; std::size_t tests[] = {0, std::min(1, max), std::min(2, max), std::min(3, max), std::min(max, max-3), std::min(max, max-2), std::min(max, max-1), max}; for (std::size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) { std::size_t j = tests[i]; std::bitset v(j); assert(j == v.to_ulong()); } } int main() { test_to_ulong<0>(); test_to_ulong<1>(); test_to_ulong<31>(); test_to_ulong<32>(); test_to_ulong<33>(); test_to_ulong<63>(); test_to_ulong<64>(); test_to_ulong<65>(); test_to_ulong<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test unsigned long to_ulong() const; #include #include #include #include template void test_to_ulong() { const std::size_t M = sizeof(unsigned long) * CHAR_BIT < N ? sizeof(unsigned long) * CHAR_BIT : N; const std::size_t X = M == 0 ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M; const std::size_t max = M == 0 ? 0 : std::size_t(-1) >> X; std::size_t tests[] = {0, std::min(1, max), std::min(2, max), std::min(3, max), std::min(max, max-3), std::min(max, max-2), std::min(max, max-1), max}; for (std::size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) { std::size_t j = tests[i]; std::bitset v(j); assert(j == v.to_ulong()); } } int main() { test_to_ulong<0>(); test_to_ulong<1>(); test_to_ulong<31>(); test_to_ulong<32>(); test_to_ulong<33>(); test_to_ulong<63>(); test_to_ulong<64>(); test_to_ulong<65>(); test_to_ulong<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.operators/op_and.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.operators/op_and.pass.cpp index f525057e5e7..a27b55bdbd9 100644 --- a/libcxx/test/utilities/template.bitset/bitset.operators/op_and.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.operators/op_and.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator&(const bitset& lhs, const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_and() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; assert((v1 & v2) == (v3 &= v2));; } int main() { test_op_and<0>(); test_op_and<1>(); test_op_and<31>(); test_op_and<32>(); test_op_and<33>(); test_op_and<63>(); test_op_and<64>(); test_op_and<65>(); test_op_and<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator&(const bitset& lhs, const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_and() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; assert((v1 & v2) == (v3 &= v2));; } int main() { test_op_and<0>(); test_op_and<1>(); test_op_and<31>(); test_op_and<32>(); test_op_and<33>(); test_op_and<63>(); test_op_and<64>(); test_op_and<65>(); test_op_and<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.operators/op_not.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.operators/op_not.pass.cpp index 7f6479ec538..e4b20fd9a95 100644 --- a/libcxx/test/utilities/template.bitset/bitset.operators/op_not.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.operators/op_not.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator^(const bitset& lhs, const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_not() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; assert((v1 ^ v2) == (v3 ^= v2));; } int main() { test_op_not<0>(); test_op_not<1>(); test_op_not<31>(); test_op_not<32>(); test_op_not<33>(); test_op_not<63>(); test_op_not<64>(); test_op_not<65>(); test_op_not<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator^(const bitset& lhs, const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_not() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; assert((v1 ^ v2) == (v3 ^= v2));; } int main() { test_op_not<0>(); test_op_not<1>(); test_op_not<31>(); test_op_not<32>(); test_op_not<33>(); test_op_not<63>(); test_op_not<64>(); test_op_not<65>(); test_op_not<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.operators/op_or.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.operators/op_or.pass.cpp index a55b61b206b..573ab8e6e0a 100644 --- a/libcxx/test/utilities/template.bitset/bitset.operators/op_or.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.operators/op_or.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator|(const bitset& lhs, const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_or() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; assert((v1 | v2) == (v3 |= v2));; } int main() { test_op_or<0>(); test_op_or<1>(); test_op_or<31>(); test_op_or<32>(); test_op_or<33>(); test_op_or<63>(); test_op_or<64>(); test_op_or<65>(); test_op_or<1000>(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test bitset operator|(const bitset& lhs, const bitset& rhs); #include #include #include template std::bitset make_bitset() { std::bitset v; for (std::size_t i = 0; i < N; ++i) v[i] = static_cast(std::rand() & 1); return v; } template void test_op_or() { std::bitset v1 = make_bitset(); std::bitset v2 = make_bitset(); std::bitset v3 = v1; assert((v1 | v2) == (v3 |= v2));; } int main() { test_op_or<0>(); test_op_or<1>(); test_op_or<31>(); test_op_or<32>(); test_op_or<33>(); test_op_or<63>(); test_op_or<64>(); test_op_or<65>(); test_op_or<1000>(); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.operators/stream_in.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.operators/stream_in.pass.cpp index 2a37097b4e3..b18007e41b6 100644 --- a/libcxx/test/utilities/template.bitset/bitset.operators/stream_in.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.operators/stream_in.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // template // basic_ostream& // operator<<(basic_ostream& os, const bitset& x); #include #include #include int main() { std::istringstream in("01011010"); std::bitset<8> b; in >> b; assert(b.to_ulong() == 0x5A); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // template // basic_ostream& // operator<<(basic_ostream& os, const bitset& x); #include #include #include int main() { std::istringstream in("01011010"); std::bitset<8> b; in >> b; assert(b.to_ulong() == 0x5A); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/bitset.operators/stream_out.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.operators/stream_out.pass.cpp index 1bd1b85ea17..41486d9b4fe 100644 --- a/libcxx/test/utilities/template.bitset/bitset.operators/stream_out.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.operators/stream_out.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // template // basic_istream& // operator>>(basic_istream& is, bitset& x); #include #include #include int main() { std::ostringstream os; std::bitset<8> b(0x5A); os << b; assert(os.str() == "01011010"); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test: // template // basic_istream& // operator>>(basic_istream& is, bitset& x); #include #include #include int main() { std::ostringstream os; std::bitset<8> b(0x5A); os << b; assert(os.str() == "01011010"); } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/includes.pass.cpp b/libcxx/test/utilities/template.bitset/includes.pass.cpp index 2a6e444dc11..4812424b6dc 100644 --- a/libcxx/test/utilities/template.bitset/includes.pass.cpp +++ b/libcxx/test/utilities/template.bitset/includes.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test that includes , , and #include #ifndef _LIBCPP_CSTDDEF #error has not been included #endif #ifndef _LIBCPP_STRING #error has not been included #endif #ifndef _LIBCPP_STDEXCEPT #error has not been included #endif #ifndef _LIBCPP_IOSFWD #error has not been included #endif int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test that includes , , and #include #ifndef _LIBCPP_CSTDDEF #error has not been included #endif #ifndef _LIBCPP_STRING #error has not been included #endif #ifndef _LIBCPP_STDEXCEPT #error has not been included #endif #ifndef _LIBCPP_IOSFWD #error has not been included #endif int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/template.bitset/version.pass.cpp b/libcxx/test/utilities/template.bitset/version.pass.cpp index af190275643..37f3671f2d8 100644 --- a/libcxx/test/utilities/template.bitset/version.pass.cpp +++ b/libcxx/test/utilities/template.bitset/version.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // #include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined #endif int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/time/hours.pass.cpp b/libcxx/test/utilities/time/hours.pass.cpp index dd73a3fcdb9..f76fdf007d2 100644 --- a/libcxx/test/utilities/time/hours.pass.cpp +++ b/libcxx/test/utilities/time/hours.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration> hours; #include #include #include int main() { typedef std::chrono::hours D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 22, ""); static_assert((std::is_same >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration> hours; #include #include #include int main() { typedef std::chrono::hours D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 22, ""); static_assert((std::is_same >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/microseconds.pass.cpp b/libcxx/test/utilities/time/microseconds.pass.cpp index dc1f83d33ce..f04a2de5df5 100644 --- a/libcxx/test/utilities/time/microseconds.pass.cpp +++ b/libcxx/test/utilities/time/microseconds.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration microseconds; #include #include #include int main() { typedef std::chrono::microseconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 54, ""); static_assert((std::is_same::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration microseconds; #include #include #include int main() { typedef std::chrono::microseconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 54, ""); static_assert((std::is_same::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/milliseconds.pass.cpp b/libcxx/test/utilities/time/milliseconds.pass.cpp index d7f26765988..6002fa028cb 100644 --- a/libcxx/test/utilities/time/milliseconds.pass.cpp +++ b/libcxx/test/utilities/time/milliseconds.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration milliseconds; #include #include #include int main() { typedef std::chrono::milliseconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 44, ""); static_assert((std::is_same::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration milliseconds; #include #include #include int main() { typedef std::chrono::milliseconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 44, ""); static_assert((std::is_same::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/minutes.pass.cpp b/libcxx/test/utilities/time/minutes.pass.cpp index ad4810fc97e..afa1b320b5c 100644 --- a/libcxx/test/utilities/time/minutes.pass.cpp +++ b/libcxx/test/utilities/time/minutes.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration> minutes; #include #include #include int main() { typedef std::chrono::minutes D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 28, ""); static_assert((std::is_same >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration> minutes; #include #include #include int main() { typedef std::chrono::minutes D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 28, ""); static_assert((std::is_same >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/nanoseconds.pass.cpp b/libcxx/test/utilities/time/nanoseconds.pass.cpp index 57e8df4151e..929bd9a15ec 100644 --- a/libcxx/test/utilities/time/nanoseconds.pass.cpp +++ b/libcxx/test/utilities/time/nanoseconds.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration nanoseconds; #include #include #include int main() { typedef std::chrono::nanoseconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 63, ""); static_assert((std::is_same::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration nanoseconds; #include #include #include int main() { typedef std::chrono::nanoseconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 63, ""); static_assert((std::is_same::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/seconds.pass.cpp b/libcxx/test/utilities/time/seconds.pass.cpp index e5e0118b141..0022b56a719 100644 --- a/libcxx/test/utilities/time/seconds.pass.cpp +++ b/libcxx/test/utilities/time/seconds.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration seconds; #include #include #include int main() { typedef std::chrono::seconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 34, ""); static_assert((std::is_same >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // typedef duration seconds; #include #include #include int main() { typedef std::chrono::seconds D; typedef D::rep Rep; typedef D::period Period; static_assert(std::is_signed::value, ""); static_assert(std::is_integral::value, ""); static_assert(std::numeric_limits::digits >= 34, ""); static_assert((std::is_same >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp b/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp b/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp index 92348261209..e8db90cbee0 100644 --- a/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main() { } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp index 12633368d93..5ad13d0b65f 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // high_resolution_clock // check clock invariants #include int main() { typedef std::chrono::high_resolution_clock C; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(C::is_monotonic || !C::is_monotonic, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // high_resolution_clock // check clock invariants #include int main() { typedef std::chrono::high_resolution_clock C; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(C::is_monotonic || !C::is_monotonic, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp index a1adf3d653c..d98e07310f6 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // high_resolution_clock // static time_point now(); #include int main() { typedef std::chrono::high_resolution_clock C; C::time_point t1 = C::now(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // high_resolution_clock // static time_point now(); #include int main() { typedef std::chrono::high_resolution_clock C; C::time_point t1 = C::now(); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp index 4e2f86af64f..63690ff6b57 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.monotonic/consistency.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // monotonic_clock // check clock invariants #include int main() { typedef std::chrono::monotonic_clock C; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(C::is_monotonic, ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // monotonic_clock // check clock invariants #include int main() { typedef std::chrono::monotonic_clock C; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(C::is_monotonic, ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp index dd8a4c8fa16..994e9375027 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.monotonic/now.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // monotonic_clock // static time_point now(); #include #include int main() { typedef std::chrono::monotonic_clock C; C::time_point t1 = C::now(); C::time_point t2 = C::now(); assert(t2 >= t1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // monotonic_clock // static time_point now(); #include #include int main() { typedef std::chrono::monotonic_clock C; C::time_point t1 = C::now(); C::time_point t2 = C::now(); assert(t2 >= t1); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp index c210b58fad0..f1b43e62664 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // check clock invariants #include int main() { typedef std::chrono::system_clock C; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((C::is_monotonic || !C::is_monotonic), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // check clock invariants #include int main() { typedef std::chrono::system_clock C; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((C::is_monotonic || !C::is_monotonic), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp index 36f86570211..9b44a1084e1 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // static time_point from_time_t(time_t t); #include #include int main() { typedef std::chrono::system_clock C; C::time_point t1 = C::from_time_t(C::to_time_t(C::now())); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // static time_point from_time_t(time_t t); #include #include int main() { typedef std::chrono::system_clock C; C::time_point t1 = C::from_time_t(C::to_time_t(C::now())); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp index 1c31f1a3ae2..a4739568040 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // static time_point now(); #include int main() { typedef std::chrono::system_clock C; C::time_point t1 = C::now(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // static time_point now(); #include int main() { typedef std::chrono::system_clock C; C::time_point t1 = C::now(); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp index 02112fc561f..d9b574e5341 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // rep should be signed #include #include int main() { assert(std::chrono::system_clock::duration::min() < std::chrono::system_clock::duration::zero()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // rep should be signed #include #include int main() { assert(std::chrono::system_clock::duration::min() < std::chrono::system_clock::duration::zero()); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp index a04fe02cfd6..f87bd84d727 100644 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp +++ b/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // time_t to_time_t(const time_point& t); #include #include int main() { typedef std::chrono::system_clock C; std::time_t t1 = C::to_time_t(C::now()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // system_clock // time_t to_time_t(const time_point& t); #include #include int main() { typedef std::chrono::system_clock C; std::time_t t1 = C::to_time_t(C::now()); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp b/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp index 5294c69c095..2d323049616 100644 --- a/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // Test default template arg: // template > // class duration; #include #include int main() { static_assert((std::is_same >, std::chrono::duration >::value), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // Test default template arg: // template > // class duration; #include #include int main() { static_assert((std::is_same >, std::chrono::duration >::value), ""); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/duration.fail.cpp b/libcxx/test/utilities/time/time.duration/duration.fail.cpp index e28883820c0..11a157d3e58 100644 --- a/libcxx/test/utilities/time/time.duration/duration.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/duration.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // If a program instantiates duration with a duration type for the template // argument Rep a diagnostic is required. #include int main() { typedef std::chrono::duration D; D d; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // If a program instantiates duration with a duration type for the template // argument Rep a diagnostic is required. #include int main() { typedef std::chrono::duration D; D d; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp b/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp index 26e8c0f3b02..afb51a5a1fa 100644 --- a/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // Period::num shall be positive, diagnostic required. #include int main() { typedef std::chrono::duration > D; D d; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // Period::num shall be positive, diagnostic required. #include int main() { typedef std::chrono::duration > D; D d; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/ratio.fail.cpp b/libcxx/test/utilities/time/time.duration/ratio.fail.cpp index adcc21e8da6..e3e104ebf0e 100644 --- a/libcxx/test/utilities/time/time.duration/ratio.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/ratio.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // Period shall be a specialization of ratio, diagnostic required. #include template class Ratio { public: static const int num = N; static const int den = D; }; int main() { typedef std::chrono::duration > D; D d; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // Period shall be a specialization of ratio, diagnostic required. #include template class Ratio { public: static const int num = N; static const int den = D; }; int main() { typedef std::chrono::duration > D; D d; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp index 0be2410eda3..beaa5cb5f13 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator++(); #include #include int main() { std::chrono::hours h(3); std::chrono::hours& href = ++h; assert(&href == &h); assert(h.count() == 4); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator++(); #include #include int main() { std::chrono::hours h(3); std::chrono::hours& href = ++h; assert(&href == &h); assert(h.count() == 4); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp index 124ec392052..129c0efd712 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator++(int); #include #include int main() { std::chrono::hours h(3); std::chrono::hours h2 = h++; assert(h.count() == 4); assert(h2.count() == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator++(int); #include #include int main() { std::chrono::hours h(3); std::chrono::hours h2 = h++; assert(h.count() == 4); assert(h2.count() == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp index 2d6f997d8ab..667b1959f2b 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator+() const; #include #include int main() { const std::chrono::minutes m(3); std::chrono::minutes m2 = +m; assert(m.count() == m2.count()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator+() const; #include #include int main() { const std::chrono::minutes m(3); std::chrono::minutes m2 = +m; assert(m.count() == m2.count()); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp index 84c6fadf919..244de3c8e83 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator+=(const duration& d); #include #include int main() { std::chrono::seconds s(3); s += std::chrono::seconds(2); assert(s.count() == 5); s += std::chrono::minutes(2); assert(s.count() == 125); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator+=(const duration& d); #include #include int main() { std::chrono::seconds s(3); s += std::chrono::seconds(2); assert(s.count() == 5); s += std::chrono::minutes(2); assert(s.count() == 125); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp index 5423d6fe273..cb60a618cb4 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator--(); #include #include int main() { std::chrono::hours h(3); std::chrono::hours& href = --h; assert(&href == &h); assert(h.count() == 2); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator--(); #include #include int main() { std::chrono::hours h(3); std::chrono::hours& href = --h; assert(&href == &h); assert(h.count() == 2); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp index 9fee8c3a9e4..6b88ddfdc4c 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator--(int); #include #include int main() { std::chrono::hours h(3); std::chrono::hours h2 = h--; assert(h.count() == 2); assert(h2.count() == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator--(int); #include #include int main() { std::chrono::hours h(3); std::chrono::hours h2 = h--; assert(h.count() == 2); assert(h2.count() == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp index 4df2fcdc56f..8ea6e46e363 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator-() const; #include #include int main() { const std::chrono::minutes m(3); std::chrono::minutes m2 = -m; assert(m2.count() == -m.count()); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration operator-() const; #include #include int main() { const std::chrono::minutes m(3); std::chrono::minutes m2 = -m; assert(m2.count() == -m.count()); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp index cb798a47e57..87ce32c93aa 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator-=(const duration& d); #include #include int main() { std::chrono::seconds s(3); s -= std::chrono::seconds(2); assert(s.count() == 1); s -= std::chrono::minutes(2); assert(s.count() == -119); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator-=(const duration& d); #include #include int main() { std::chrono::seconds s(3); s -= std::chrono::seconds(2); assert(s.count() == 1); s -= std::chrono::minutes(2); assert(s.count() == -119); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp index 5fce07acce1..3371c392dc2 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator/=(const rep& rhs); #include #include int main() { std::chrono::nanoseconds ns(15); ns /= 5; assert(ns.count() == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator/=(const rep& rhs); #include #include int main() { std::chrono::nanoseconds ns(15); ns /= 5; assert(ns.count() == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp index 912b43e74aa..953e778a981 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator%=(const duration& rhs) #include #include int main() { std::chrono::microseconds us(11); std::chrono::microseconds us2(3); us %= us2; assert(us.count() == 2); us %= std::chrono::milliseconds(3); assert(us.count() == 2); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator%=(const duration& rhs) #include #include int main() { std::chrono::microseconds us(11); std::chrono::microseconds us2(3); us %= us2; assert(us.count() == 2); us %= std::chrono::milliseconds(3); assert(us.count() == 2); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp index b8a7930dd2b..ab7d7ca82fd 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator%=(const rep& rhs) #include #include int main() { std::chrono::microseconds us(11); us %= 3; assert(us.count() == 2); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator%=(const rep& rhs) #include #include int main() { std::chrono::microseconds us(11); us %= 3; assert(us.count() == 2); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp index 1cd89251d8c..869eb7fcb6f 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator*=(const rep& rhs); #include #include int main() { std::chrono::nanoseconds ns(3); ns *= 5; assert(ns.count() == 15); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration& operator*=(const rep& rhs); #include #include int main() { std::chrono::nanoseconds ns(3); ns *= 5; assert(ns.count() == 15); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp index a972949a784..acc41bb1aaf 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // ToDuration // duration_cast(const duration& d); #include #include #include template void test(const FromDuration& f, const ToDuration& d) { typedef decltype(std::chrono::duration_cast(f)) R; static_assert((std::is_same::value), ""); assert(std::chrono::duration_cast(f) == d); } int main() { test(std::chrono::milliseconds(7265000), std::chrono::hours(2)); test(std::chrono::milliseconds(7265000), std::chrono::minutes(121)); test(std::chrono::milliseconds(7265000), std::chrono::seconds(7265)); test(std::chrono::milliseconds(7265000), std::chrono::milliseconds(7265000)); test(std::chrono::milliseconds(7265000), std::chrono::microseconds(7265000000LL)); test(std::chrono::milliseconds(7265000), std::chrono::nanoseconds(7265000000000LL)); test(std::chrono::milliseconds(7265000), std::chrono::duration >(7265./3600)); test(std::chrono::duration >(9), std::chrono::duration >(10)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // ToDuration // duration_cast(const duration& d); #include #include #include template void test(const FromDuration& f, const ToDuration& d) { typedef decltype(std::chrono::duration_cast(f)) R; static_assert((std::is_same::value), ""); assert(std::chrono::duration_cast(f) == d); } int main() { test(std::chrono::milliseconds(7265000), std::chrono::hours(2)); test(std::chrono::milliseconds(7265000), std::chrono::minutes(121)); test(std::chrono::milliseconds(7265000), std::chrono::seconds(7265)); test(std::chrono::milliseconds(7265000), std::chrono::milliseconds(7265000)); test(std::chrono::milliseconds(7265000), std::chrono::microseconds(7265000000LL)); test(std::chrono::milliseconds(7265000), std::chrono::nanoseconds(7265000000000LL)); test(std::chrono::milliseconds(7265000), std::chrono::duration >(7265./3600)); test(std::chrono::duration >(9), std::chrono::duration >(10)); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp index e9f2a484143..d90502cba4b 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // ToDuration // duration_cast(const duration& d); // ToDuration shall be an instantiation of duration. #include int main() { std::chrono::duration_cast(std::chrono::milliseconds(3)); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // ToDuration // duration_cast(const duration& d); // ToDuration shall be an instantiation of duration. #include int main() { std::chrono::duration_cast(std::chrono::milliseconds(3)); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp index c7d2269eecf..86d23704954 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // bool // operator==(const duration& lhs, const duration& rhs); // template // bool // operator!=(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(3); assert(s1 == s2); assert(!(s1 != s2)); } { std::chrono::seconds s1(3); std::chrono::seconds s2(4); assert(!(s1 == s2)); assert(s1 != s2); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(3000); assert(s1 == s2); assert(!(s1 != s2)); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(4000); assert(!(s1 == s2)); assert(s1 != s2); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(s1 == s2); assert(!(s1 != s2)); } { std::chrono::duration > s1(10); std::chrono::duration > s2(9); assert(!(s1 == s2)); assert(s1 != s2); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(s1 == s2); assert(!(s1 != s2)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // bool // operator==(const duration& lhs, const duration& rhs); // template // bool // operator!=(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(3); assert(s1 == s2); assert(!(s1 != s2)); } { std::chrono::seconds s1(3); std::chrono::seconds s2(4); assert(!(s1 == s2)); assert(s1 != s2); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(3000); assert(s1 == s2); assert(!(s1 != s2)); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(4000); assert(!(s1 == s2)); assert(s1 != s2); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(s1 == s2); assert(!(s1 != s2)); } { std::chrono::duration > s1(10); std::chrono::duration > s2(9); assert(!(s1 == s2)); assert(s1 != s2); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(s1 == s2); assert(!(s1 != s2)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp index f477f424f9f..5d447115da5 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // bool // operator< (const duration& lhs, const duration& rhs); // template // bool // operator> (const duration& lhs, const duration& rhs); // template // bool // operator<=(const duration& lhs, const duration& rhs); // template // bool // operator>=(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(3); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::seconds s1(3); std::chrono::seconds s2(4); assert( (s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert(!(s1 >= s2)); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(3000); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(4000); assert( (s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert(!(s1 >= s2)); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::duration > s1(10); std::chrono::duration > s2(9); assert(!(s1 < s2)); assert( (s1 > s2)); assert(!(s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // bool // operator< (const duration& lhs, const duration& rhs); // template // bool // operator> (const duration& lhs, const duration& rhs); // template // bool // operator<=(const duration& lhs, const duration& rhs); // template // bool // operator>=(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(3); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::seconds s1(3); std::chrono::seconds s2(4); assert( (s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert(!(s1 >= s2)); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(3000); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::milliseconds s1(3); std::chrono::microseconds s2(4000); assert( (s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert(!(s1 >= s2)); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::duration > s1(10); std::chrono::duration > s2(9); assert(!(s1 < s2)); assert( (s1 > s2)); assert(!(s1 <= s2)); assert( (s1 >= s2)); } { std::chrono::duration > s1(9); std::chrono::duration > s2(10); assert(!(s1 < s2)); assert(!(s1 > s2)); assert( (s1 <= s2)); assert( (s1 >= s2)); } } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp index 318f336e48d..356fd1bd8e3 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // exact conversions allowed for integral reps #include #include int main() { std::chrono::milliseconds ms(1); std::chrono::microseconds us = ms; assert(us.count() == 1000); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // exact conversions allowed for integral reps #include #include int main() { std::chrono::milliseconds ms(1); std::chrono::microseconds us = ms; assert(us.count() == 1000); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp index 42b02ac38d0..5d53a39d594 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // conversions from floating point to integral durations disallowed #include int main() { std::chrono::duration d; std::chrono::duration i = d; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // conversions from floating point to integral durations disallowed #include int main() { std::chrono::duration d; std::chrono::duration i = d; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp index dc5bde48685..1e87931a01d 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // inexact conversions disallowed for integral reps #include int main() { std::chrono::microseconds us(1); std::chrono::milliseconds ms = us; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // inexact conversions disallowed for integral reps #include int main() { std::chrono::microseconds us(1); std::chrono::milliseconds ms = us; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp index 0539ab072d4..1359be9c0eb 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // inexact conversions allowed for floating point reps #include #include int main() { std::chrono::duration us(1); std::chrono::duration ms = us; assert(ms.count() == 1./1000); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // inexact conversions allowed for floating point reps #include #include int main() { std::chrono::duration us(1); std::chrono::duration ms = us; assert(ms.count() == 1./1000); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp index 43f026de656..32328cac805 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // conversions from integral to floating point durations allowed #include #include int main() { std::chrono::duration i(3); std::chrono::duration d = i; assert(d.count() == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration(const duration& d); // conversions from integral to floating point durations allowed #include #include int main() { std::chrono::duration i(3); std::chrono::duration d = i; assert(d.count() == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp index 1dd7c5e29c3..1d86be2ecac 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration() = default; // Rep must be default initialized, not initialized with 0 #include #include #include "../../rep.h" template void test() { D d; assert(d.count() == typename D::rep()); } int main() { test >(); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // duration() = default; // Rep must be default initialized, not initialized with 0 #include #include #include "../../rep.h" template void test() { D d; assert(d.count() == typename D::rep()); } int main() { test >(); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp index eea99f563f9..7538605d073 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); #include #include #include "../../rep.h" template void test(R r) { D d(r); assert(d.count() == r); } int main() { test >(5); test > >(5); test > >(Rep(3)); test > >(5.5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); #include #include #include "../../rep.h" template void test(R r) { D d(r); assert(d.count() == r); } int main() { test >(5); test > >(5); test > >(Rep(3)); test > >(5.5); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp index 435091ef277..da9d886c249 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // test for explicit #include #include "../../rep.h" int main() { std::chrono::duration d = 1; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // test for explicit #include #include "../../rep.h" int main() { std::chrono::duration d = 1; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp index 8fa3d038568..17d532cbadb 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // Rep2 shall be implicitly convertible to rep #include #include "../../rep.h" int main() { std::chrono::duration d(1); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // Rep2 shall be implicitly convertible to rep #include #include "../../rep.h" int main() { std::chrono::duration d(1); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp index 2e63a34e042..38844c7811c 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // construct double with int #include #include int main() { std::chrono::duration d(5); assert(d.count() == 5); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // construct double with int #include #include int main() { std::chrono::duration d(5); assert(d.count() == 5); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp index 10b44d0e8a9..fb6c83a1d3d 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // treat_as_floating_point::value shall be false #include int main() { std::chrono::duration d(1.); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // explicit duration(const Rep2& r); // treat_as_floating_point::value shall be false #include int main() { std::chrono::duration d(1.); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp index 4979b156aa1..168e7a0437a 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type, duration>::type // operator+(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(5); std::chrono::seconds r = s1 + s2; assert(r.count() == 8); } { std::chrono::seconds s1(3); std::chrono::microseconds s2(5); std::chrono::microseconds r = s1 + s2; assert(r.count() == 3000005); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 + s2; assert(r.count() == 75); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 + s2; assert(r.count() == 75); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type, duration>::type // operator+(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(5); std::chrono::seconds r = s1 + s2; assert(r.count() == 8); } { std::chrono::seconds s1(3); std::chrono::microseconds s2(5); std::chrono::microseconds r = s1 + s2; assert(r.count() == 3000005); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 + s2; assert(r.count() == 75); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 + s2; assert(r.count() == 75); } } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp index b349cf56fbe..918f62d5d20 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type, duration>::type // operator-(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(5); std::chrono::seconds r = s1 - s2; assert(r.count() == -2); } { std::chrono::seconds s1(3); std::chrono::microseconds s2(5); std::chrono::microseconds r = s1 - s2; assert(r.count() == 2999995); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 - s2; assert(r.count() == -15); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 - s2; assert(r.count() == -15); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type, duration>::type // operator-(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::seconds s1(3); std::chrono::seconds s2(5); std::chrono::seconds r = s1 - s2; assert(r.count() == -2); } { std::chrono::seconds s1(3); std::chrono::microseconds s2(5); std::chrono::microseconds r = s1 - s2; assert(r.count() == 2999995); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 - s2; assert(r.count() == -15); } { std::chrono::duration > s1(3); std::chrono::duration > s2(5); std::chrono::duration > r = s1 - s2; assert(r.count() == -15); } } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp index 181fc6a1cdb..4ad5961fc8a 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type::type // operator/(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::nanoseconds ns1(15); std::chrono::nanoseconds ns2(5); assert(ns1 / ns2 == 3); } { std::chrono::microseconds us1(15); std::chrono::nanoseconds ns2(5); assert(us1 / ns2 == 3000); } { std::chrono::duration > s1(30); std::chrono::duration > s2(5); assert(s1 / s2 == 6); } { std::chrono::duration > s1(30); std::chrono::duration > s2(5); assert(s1 / s2 == 20./3); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type::type // operator/(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::nanoseconds ns1(15); std::chrono::nanoseconds ns2(5); assert(ns1 / ns2 == 3); } { std::chrono::microseconds us1(15); std::chrono::nanoseconds ns2(5); assert(us1 / ns2 == 3000); } { std::chrono::duration > s1(30); std::chrono::duration > s2(5); assert(s1 / s2 == 6); } { std::chrono::duration > s1(30); std::chrono::duration > s2(5); assert(s1 / s2 == 20./3); } } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp index 2ce8069428d..244061fb2a0 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration::type, Period> // operator/(const duration& d, const Rep2& s); #include #include "../../rep.h" int main() { std::chrono::duration d(Rep(15)); d = d / 5; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration::type, Period> // operator/(const duration& d, const Rep2& s); #include #include "../../rep.h" int main() { std::chrono::duration d(Rep(15)); d = d / 5; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp index a010c57084d..81848a84f10 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration::type, Period> // operator/(const duration& d, const Rep2& s); #include #include int main() { std::chrono::nanoseconds ns(15); ns = ns / 5; assert(ns.count() == 3); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration::type, Period> // operator/(const duration& d, const Rep2& s); #include #include int main() { std::chrono::nanoseconds ns(15); ns = ns / 5; assert(ns.count() == 3); } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp index 5b428e3961c..2e664d9860b 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type, duration>::type // operator%(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::nanoseconds ns1(15); std::chrono::nanoseconds ns2(6); std::chrono::nanoseconds r = ns1 % ns2; assert(r.count() == 3); } { std::chrono::microseconds us1(15); std::chrono::nanoseconds ns2(28); std::chrono::nanoseconds r = us1 % ns2; assert(r.count() == 20); } { std::chrono::duration > s1(6); std::chrono::duration > s2(3); std::chrono::duration > r = s1 % s2; assert(r.count() == 24); } } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // typename common_type, duration>::type // operator%(const duration& lhs, const duration& rhs); #include #include int main() { { std::chrono::nanoseconds ns1(15); std::chrono::nanoseconds ns2(6); std::chrono::nanoseconds r = ns1 % ns2; assert(r.count() == 3); } { std::chrono::microseconds us1(15); std::chrono::nanoseconds ns2(28); std::chrono::nanoseconds r = us1 % ns2; assert(r.count() == 20); } { std::chrono::duration > s1(6); std::chrono::duration > s2(3); std::chrono::duration > r = s1 % s2; assert(r.count() == 24); } } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp index c7b63575956..9e82fdfc1ff 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration::type, Period> // operator%(const duration& d, const Rep2& s) #include #include "../../rep.h" int main() { std::chrono::duration d(Rep(15)); d = d % 5; } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // duration // template // duration::type, Period> // operator%(const duration& d, const Rep2& s) #include #include "../../rep.h" int main() { std::chrono::duration d(Rep(15)); d = d % 5; } \ No newline at end of file diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp index 98c4eb725f5..63aa5335e87 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp index 4240134bcb2..c27ac5c797d 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp index 45d6a3eb02d..d6cdcbe05dc 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp index e2134fb5c4f..0b1a38ab058 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp index 2cedbf87371..bfd8b473ef6 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp index 827bd067c42..6537a2e9d12 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp index 1ee11bdd7e6..6e66baf404d 100644 --- a/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.duration/types.pass.cpp b/libcxx/test/utilities/time/time.duration/types.pass.cpp index ab423178d57..5b6aa81c4a6 100644 --- a/libcxx/test/utilities/time/time.duration/types.pass.cpp +++ b/libcxx/test/utilities/time/time.duration/types.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/default_duration.pass.cpp b/libcxx/test/utilities/time/time.point/default_duration.pass.cpp index d4ac693df7d..fe220d3e210 100644 --- a/libcxx/test/utilities/time/time.point/default_duration.pass.cpp +++ b/libcxx/test/utilities/time/time.point/default_duration.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/duration.fail.cpp b/libcxx/test/utilities/time/time.point/duration.fail.cpp index 5c2b71734c2..f391e05e0aa 100644 --- a/libcxx/test/utilities/time/time.point/duration.fail.cpp +++ b/libcxx/test/utilities/time/time.point/duration.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp index 8eb2a41a7c3..315b6db37de 100644 --- a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp index 0c28e7db642..afc72f48570 100644 --- a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp index 41544c9682a..d12c692bb8e 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp index af0f3786174..412cc07afe0 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp index 92502c1850a..7122a8ba298 100644 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp index f49cd3207d2..6d1a0dcc7cf 100644 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp index e2c26c2603a..f98dca131bd 100644 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp index cbb2f109190..abbb304d04e 100644 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp index 88cef151283..68fd0a0cbe6 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp index bb8587f0db2..69547a4c1b4 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp index 736a0ca14ea..33c01d222ff 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp index 4a742c85687..e005e73b928 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp index 3c53686ac3a..3c1f4f23936 100644 --- a/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp index 016391ee374..ed31cece003 100644 --- a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp index 98cfa6c878d..c3e0d62b660 100644 --- a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp index 76fb101dd41..f8ac80bde37 100644 --- a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp index 65d9598a327..5bbf6adae56 100644 --- a/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp index e411f5b5285..f6dbf916a1a 100644 --- a/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp +++ b/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp b/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp index 2d18f4acf0b..a01ada5653c 100644 --- a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp index 73c4baa2b5d..d7435efaef6 100644 --- a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp index 6651841a64f..43c320724a4 100644 --- a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp index 466e09d08d7..fd473bfb2b2 100644 --- a/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp index 1d76bfc6f62..dfccbd5cbf8 100644 --- a/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp index b3e95c46596..b0965e10457 100644 --- a/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp +++ b/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/time/version.pass.cpp b/libcxx/test/utilities/time/version.pass.cpp index b25adae630a..650253ff05e 100644 --- a/libcxx/test/utilities/time/version.pass.cpp +++ b/libcxx/test/utilities/time/version.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.general/nothing_to_do.pass.cpp b/libcxx/test/utilities/tuple/tuple.general/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/tuple/tuple.general/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.general/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/empty_member.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/empty_member.pass.cpp index 53783cc8b96..c9b35b84e92 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/empty_member.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/empty_member.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp index b1c98599da0..17f09884a5d 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp index b47d4b62671..0575df1c6ec 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp index 7c599072df1..43a62057387 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.fail.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.fail.cpp index 39a6a1a4597..b7eacb70c4e 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.fail.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp index 70604bfee7a..aa562372af8 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp index 423e9bfa3e2..7e3731aca98 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp index 886efdaed1d..793cef9d288 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.fail.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.fail.cpp index 65c2fa63ea3..88d1379e1b0 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.fail.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp index 43416afbf05..3e04808c418 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp index e9ad4524b7d..9b93e8601fc 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp index c3e09b9b5a4..262a4d6edb0 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_UTypes.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.pass.cpp index d32e62d805e..4dba15da988 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp index 00ee35add78..b6dbf259d0d 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp index 4b5310a735f..77d9ede496f 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.pass.cpp index 2c3c5dcc1d2..868c408087b 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp index 2bb2bc05fa1..3d0293a8c28 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp index 938230bd3c2..7c5474099b8 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move_pair.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move_pair.pass.cpp index d04c946c8cf..b0821dc3018 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move_pair.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp index 93f28d5e6d7..8a31d6d8906 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp index b2a945db21f..ee1def7635f 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types2.fail.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types2.fail.cpp index 864896e0b21..3fb464b9eb2 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types2.fail.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types2.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp index 91b14f5c7be..031e38db336 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp index 4672b9eb24b..070c3766d76 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp index 4ab026d8faa..9fe264aa29d 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.fail.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.fail.cpp index 6aff2270d2b..62c0a697754 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.fail.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp index 1c637f354d6..6239aa82785 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp index 0321fc13a7b..4f04b5d1ac5 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp index dd4867b18f3..1f439888376 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp index c6f8e710965..b06da1cb063 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp index 86fa52f4569..ff22bda98ae 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp index a232c9a2e0d..163b4c2d3dd 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp index 27e25d22def..03949bfae07 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.fail.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.fail.cpp index d32fbde53ae..08277516093 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.fail.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp index 2746f820893..a922452ab81 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp index dc9d1ee70c0..b92c61d8741 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp index e446e8c3ffb..0b1817ddcf9 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp index 3020b99706d..3e7f0651b25 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.range/begin.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.range/begin.pass.cpp index 9bab42e3241..fc711b24275 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.range/begin.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.range/begin.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp index 4fb08df30e6..e14cf1998d1 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp index 4ebaf6f162d..2e79379ec1d 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp index 534c6e0d2e5..13bd88cf7dd 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp index 64e40957a11..401e86516c8 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.traits/uses_allocator.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.traits/uses_allocator.pass.cpp index 80f141fbb23..77741d80741 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.traits/uses_allocator.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.traits/uses_allocator.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/tuple/version.pass.cpp b/libcxx/test/utilities/tuple/version.pass.cpp index 7c7c35cc69c..52dd76d5898 100644 --- a/libcxx/test/utilities/tuple/version.pass.cpp +++ b/libcxx/test/utilities/tuple/version.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.hash/hash.pass.cpp b/libcxx/test/utilities/type.index/type.index.hash/hash.pass.cpp index 25d4725a2c2..7afe3912a8c 100644 --- a/libcxx/test/utilities/type.index/type.index.hash/hash.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.hash/hash.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.members/ctor.pass.cpp b/libcxx/test/utilities/type.index/type.index.members/ctor.pass.cpp index 14a019a628b..280089f7f8d 100644 --- a/libcxx/test/utilities/type.index/type.index.members/ctor.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.members/ctor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.members/eq.pass.cpp b/libcxx/test/utilities/type.index/type.index.members/eq.pass.cpp index 0dccef026d0..3d6da0399d4 100644 --- a/libcxx/test/utilities/type.index/type.index.members/eq.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.members/eq.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.members/hash_code.pass.cpp b/libcxx/test/utilities/type.index/type.index.members/hash_code.pass.cpp index e0b614f7ca3..e563e3b99f2 100644 --- a/libcxx/test/utilities/type.index/type.index.members/hash_code.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.members/hash_code.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp b/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp index c047bdc87f0..732c30141c5 100644 --- a/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.members/lt.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.members/name.pass.cpp b/libcxx/test/utilities/type.index/type.index.members/name.pass.cpp index 9075a466d83..5794e5ece9f 100644 --- a/libcxx/test/utilities/type.index/type.index.members/name.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.members/name.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.overview/copy_assign.pass.cpp b/libcxx/test/utilities/type.index/type.index.overview/copy_assign.pass.cpp index 872b1759cd3..7f83d75f00e 100644 --- a/libcxx/test/utilities/type.index/type.index.overview/copy_assign.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.overview/copy_assign.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.overview/copy_ctor.pass.cpp b/libcxx/test/utilities/type.index/type.index.overview/copy_ctor.pass.cpp index 08d7f3fb0dc..bb74a5459d7 100644 --- a/libcxx/test/utilities/type.index/type.index.overview/copy_ctor.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.overview/copy_ctor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp b/libcxx/test/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp index 9a79a505ce0..a2695cc2be6 100644 --- a/libcxx/test/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp +++ b/libcxx/test/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/type.index/version.pass.cpp b/libcxx/test/utilities/type.index/version.pass.cpp index 6310ecdc1a2..d8a1252ac36 100644 --- a/libcxx/test/utilities/type.index/version.pass.cpp +++ b/libcxx/test/utilities/type.index/version.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utilities.general/nothing_to_do.pass.cpp b/libcxx/test/utilities/utilities.general/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utilities.general/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utilities.general/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility.requirements/allocator.requirements/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility.requirements/allocator.requirements/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility.requirements/allocator.requirements/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility.requirements/allocator.requirements/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility.requirements/hash.requirements/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility.requirements/hash.requirements/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility.requirements/hash.requirements/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility.requirements/hash.requirements/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility.requirements/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility.requirements/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility.requirements/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility.requirements/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility.requirements/nullablepointer.requirements/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility.requirements/nullablepointer.requirements/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility.requirements/nullablepointer.requirements/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility.requirements/nullablepointer.requirements/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility.requirements/swappable.requirements/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility.requirements/swappable.requirements/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility.requirements/swappable.requirements/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility.requirements/swappable.requirements/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility.requirements/utility.arg.requirements/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility.requirements/utility.arg.requirements/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility.requirements/utility.arg.requirements/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility.requirements/utility.arg.requirements/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/declval/declval.pass.cpp b/libcxx/test/utilities/utility/declval/declval.pass.cpp index eacf1f1daa6..ddeb67cd9b1 100644 --- a/libcxx/test/utilities/utility/declval/declval.pass.cpp +++ b/libcxx/test/utilities/utility/declval/declval.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward.pass.cpp b/libcxx/test/utilities/utility/forward/forward.pass.cpp index 1667491a4f2..ebb1b518def 100644 --- a/libcxx/test/utilities/utility/forward/forward.pass.cpp +++ b/libcxx/test/utilities/utility/forward/forward.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward1.fail.cpp b/libcxx/test/utilities/utility/forward/forward1.fail.cpp index eab3b8bb210..e31ba67788f 100644 --- a/libcxx/test/utilities/utility/forward/forward1.fail.cpp +++ b/libcxx/test/utilities/utility/forward/forward1.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward2.fail.cpp b/libcxx/test/utilities/utility/forward/forward2.fail.cpp index e2c387401c2..31fcafbc14c 100644 --- a/libcxx/test/utilities/utility/forward/forward2.fail.cpp +++ b/libcxx/test/utilities/utility/forward/forward2.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward3.fail.cpp b/libcxx/test/utilities/utility/forward/forward3.fail.cpp index 3a681fc9f48..6c774e5b35c 100644 --- a/libcxx/test/utilities/utility/forward/forward3.fail.cpp +++ b/libcxx/test/utilities/utility/forward/forward3.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward4.fail.cpp b/libcxx/test/utilities/utility/forward/forward4.fail.cpp index f6e0036db9e..2afedd98f5c 100644 --- a/libcxx/test/utilities/utility/forward/forward4.fail.cpp +++ b/libcxx/test/utilities/utility/forward/forward4.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward5.fail.cpp b/libcxx/test/utilities/utility/forward/forward5.fail.cpp index a590ea63271..5051364536d 100644 --- a/libcxx/test/utilities/utility/forward/forward5.fail.cpp +++ b/libcxx/test/utilities/utility/forward/forward5.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/forward6.fail.cpp b/libcxx/test/utilities/utility/forward/forward6.fail.cpp index 0c13448f533..23541e212ed 100644 --- a/libcxx/test/utilities/utility/forward/forward6.fail.cpp +++ b/libcxx/test/utilities/utility/forward/forward6.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_copy.pass.cpp b/libcxx/test/utilities/utility/forward/move_copy.pass.cpp index 94a27d5f034..dd0281eab7b 100644 --- a/libcxx/test/utilities/utility/forward/move_copy.pass.cpp +++ b/libcxx/test/utilities/utility/forward/move_copy.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_if_noexcept.pass.cpp b/libcxx/test/utilities/utility/forward/move_if_noexcept.pass.cpp index 1646b20d299..2e59f36e20d 100644 --- a/libcxx/test/utilities/utility/forward/move_if_noexcept.pass.cpp +++ b/libcxx/test/utilities/utility/forward/move_if_noexcept.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_only.pass.cpp b/libcxx/test/utilities/utility/forward/move_only.pass.cpp index 350ed86dfb8..de12e3ff62c 100644 --- a/libcxx/test/utilities/utility/forward/move_only.pass.cpp +++ b/libcxx/test/utilities/utility/forward/move_only.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_only1.fail.cpp b/libcxx/test/utilities/utility/forward/move_only1.fail.cpp index 53559bc47b9..5c577d695e4 100644 --- a/libcxx/test/utilities/utility/forward/move_only1.fail.cpp +++ b/libcxx/test/utilities/utility/forward/move_only1.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_only2.fail.cpp b/libcxx/test/utilities/utility/forward/move_only2.fail.cpp index 7f4eff51d08..6c50b4cfc59 100644 --- a/libcxx/test/utilities/utility/forward/move_only2.fail.cpp +++ b/libcxx/test/utilities/utility/forward/move_only2.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_only3.fail.cpp b/libcxx/test/utilities/utility/forward/move_only3.fail.cpp index a6f87cfaed0..105c19178ec 100644 --- a/libcxx/test/utilities/utility/forward/move_only3.fail.cpp +++ b/libcxx/test/utilities/utility/forward/move_only3.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/forward/move_only4.fail.cpp b/libcxx/test/utilities/utility/forward/move_only4.fail.cpp index 181aa3451ed..10df3f57a54 100644 --- a/libcxx/test/utilities/utility/forward/move_only4.fail.cpp +++ b/libcxx/test/utilities/utility/forward/move_only4.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/operators/rel_ops.pass.cpp b/libcxx/test/utilities/utility/operators/rel_ops.pass.cpp index 4be33ea5e32..10a0489a041 100644 --- a/libcxx/test/utilities/utility/operators/rel_ops.pass.cpp +++ b/libcxx/test/utilities/utility/operators/rel_ops.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility/pairs/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility/pairs/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.fail.cpp b/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.fail.cpp index b9a53ada329..6ee057c364c 100644 --- a/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.fail.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.fail.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.pass.cpp index a04f16f0ca6..37472dfa85c 100644 --- a/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.astuple/get_const.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp index 27e207bba1d..13dec753772 100644 --- a/libcxx/test/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp index 0edf08b0b43..60e15c24e11 100644 --- a/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_element.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_size.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_size.pass.cpp index eba41f1c75b..29e3300f723 100644 --- a/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_size.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.astuple/tuple_size.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp index 106eed9cbe3..e9e8747d212 100644 --- a/libcxx/test/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.range/begin.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.range/begin.pass.cpp index 7f7de2960d5..a457ad09f50 100644 --- a/libcxx/test/utilities/utility/pairs/pair.range/begin.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.range/begin.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pair.range/end.pass.cpp b/libcxx/test/utilities/utility/pairs/pair.range/end.pass.cpp index b1d8dacee3e..1c1a8625149 100644 --- a/libcxx/test/utilities/utility/pairs/pair.range/end.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pair.range/end.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.general/nothing_to_do.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.general/nothing_to_do.pass.cpp index fa4d462f18d..b89f168e9c4 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.general/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.general/nothing_to_do.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/U_V.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/U_V.pass.cpp index c4ecf6ebd10..6809c27cf60 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/U_V.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/U_V.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp index 99f29918fe0..5de0271bfff 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp index 2c7b2bda2c2..bd82eb3fd6c 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp index 0048ce8f119..c0708c79d27 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/comparison.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/comparison.pass.cpp index 0c6297a6466..a553e4e0c27 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/comparison.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/comparison.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp index d13b1c59e0c..61de3777cb4 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp index 86fa7904d66..d9ac7fd969a 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp index 874d17e67be..53d5f6ee01f 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/default.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/default.pass.cpp index 16ff4bde762..be949edc976 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/default.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/default.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/make_pair.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/make_pair.pass.cpp index 60e7e101f10..5b19a5fd3f0 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/make_pair.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/make_pair.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/non_member_swap.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/non_member_swap.pass.cpp index 626d98f647d..d7633d16f15 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/non_member_swap.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/non_member_swap.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp index 3f411029180..6685166908b 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp index 0476a370f04..13fbfe84b4a 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/swap.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/swap.pass.cpp index 2898144db96..fbccb314289 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/swap.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/swap.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/pairs/pairs.pair/types.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.pair/types.pass.cpp index dd217a56e22..8ed4d1b7a18 100644 --- a/libcxx/test/utilities/utility/pairs/pairs.pair/types.pass.cpp +++ b/libcxx/test/utilities/utility/pairs/pairs.pair/types.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/utility.swap/swap.pass.cpp b/libcxx/test/utilities/utility/utility.swap/swap.pass.cpp index acb366418d6..e4c0f388ea6 100644 --- a/libcxx/test/utilities/utility/utility.swap/swap.pass.cpp +++ b/libcxx/test/utilities/utility/utility.swap/swap.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/utility.swap/swap_array.pass.cpp b/libcxx/test/utilities/utility/utility.swap/swap_array.pass.cpp index 1ab168973ac..a8b351ebc5b 100644 --- a/libcxx/test/utilities/utility/utility.swap/swap_array.pass.cpp +++ b/libcxx/test/utilities/utility/utility.swap/swap_array.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. diff --git a/libcxx/test/utilities/utility/version.pass.cpp b/libcxx/test/utilities/utility/version.pass.cpp index 5eb9b212718..921d0b5466e 100644 --- a/libcxx/test/utilities/utility/version.pass.cpp +++ b/libcxx/test/utilities/utility/version.pass.cpp @@ -1,6 +1,6 @@ //===----------------------------------------------------------------------===// // -// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -- cgit v1.2.3