Home
last modified time | relevance | path

Searched refs:Counted (Results 1 – 25 of 31) sorted by relevance

12

/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/
H A Dranges_uninitialized_copy.pass.cpp100 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
123 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
147 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
170 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
193 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
237 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
238 Counted out[N] = {Counted(6), Counted(7), Counted(8), Counted(9), Counted(10)}; in main()
261 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
284 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
300 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
[all …]
H A Dranges_uninitialized_copy_n.pass.cpp45 Counted in[] = {Counted()}; in main()
47 Counted::reset(); in main()
56 Counted::reset(); in main()
61 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
78 Counted::reset(); in main()
86 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
87 Counted out[N] = {Counted(6), Counted(7), Counted(8), Counted(9), Counted(10)}; in main()
103 Counted::reset(); in main()
110 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
121 Counted::reset(); in main()
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/
H A Dranges_uninitialized_move.pass.cpp99 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
121 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
145 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
168 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
191 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
234 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
260 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
286 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
302 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
340 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
[all …]
H A Dranges_uninitialized_move_n.pass.cpp44 Counted in[] = {Counted()}; in main()
46 Counted::reset(); in main()
55 Counted::reset(); in main()
60 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
62 Counted::reset(); in main()
78 Counted::reset(); in main()
85 Counted in[] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
102 Counted::reset(); in main()
109 Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)}; in main()
120 Counted::reset(); in main()
[all …]
H A Duninitialized_move.pass.cpp23 struct Counted { struct
28 Counted(Counted const&) { assert(false); } in Counted() argument
33 int Counted::count = 0; argument
34 int Counted::constructed = 0;
86 alignas(Counted) char pool[sizeof(Counted)*N] = {}; in test_counted()
87 Counted* p = (Counted*)pool; in test_counted()
90 assert(Counted::constructed == 1); in test_counted()
91 assert(Counted::count == 1); in test_counted()
96 assert(Counted::count == 5); in test_counted()
97 assert(Counted::constructed == 5); in test_counted()
[all …]
H A Duninitialized_move_n.pass.cpp23 struct Counted { struct
28 Counted(Counted const&) { assert(false); } in Counted() argument
33 int Counted::count = 0; argument
34 int Counted::constructed = 0;
86 alignas(Counted) char pool[sizeof(Counted)*N] = {}; in test_counted()
87 Counted* p = (Counted*)pool; in test_counted()
91 assert(Counted::constructed == 1); in test_counted()
92 assert(Counted::count == 1); in test_counted()
98 assert(Counted::count == 5); in test_counted()
99 assert(Counted::constructed == 5); in test_counted()
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/
H A Dranges_uninitialized_default_construct.pass.cpp46 Buffer<Counted, 1> buf; in main()
70 Buffer<Counted, 5> buf; in main()
77 Counted::reset(); in main()
91 Counted::reset(); in main()
105 Counted::reset(); in main()
118 Counted::reset(); in main()
132 Counted::reset(); in main()
148 Counted::reset(); in main()
163 Counted::reset(); in main()
176 Counted::reset(); in main()
[all …]
H A Duninitialized_default_construct.pass.cpp23 struct Counted { struct
27 Counted(Counted const&) { assert(false); } in Counted() function
28 ~Counted() { --count; } in ~Counted() argument
31 int Counted::count = 0;
32 int Counted::constructed = 0;
76 alignas(Counted) char pool[sizeof(Counted)*N] = {}; in test_counted()
77 Counted* p = (Counted*)pool; in test_counted()
79 assert(Counted::count == 1); in test_counted()
80 assert(Counted::constructed == 1); in test_counted()
82 assert(Counted::count == 5); in test_counted()
[all …]
H A Duninitialized_default_construct_n.pass.cpp23 struct Counted { struct
28 Counted(Counted const&) { assert(false); } in Counted() argument
32 int Counted::count = 0;
33 int Counted::constructed = 0;
77 alignas(Counted) char pool[sizeof(Counted)*N] = {}; in test_counted()
78 Counted* p = (Counted*)pool; in test_counted()
81 assert(Counted::count == 1); in test_counted()
82 assert(Counted::constructed == 1); in test_counted()
85 assert(Counted::count == 5); in test_counted()
86 assert(Counted::constructed == 5); in test_counted()
[all …]
H A Dranges_uninitialized_default_construct_n.pass.cpp41 Buffer<Counted, 1> buf; in main()
45 assert(Counted::total_objects == 0); in main()
51 Buffer<Counted, N> buf; in main()
55 assert(Counted::total_objects == N); in main()
58 Counted::reset(); in main()
66 Buffer<Counted, N> buf; in main()
73 assert(Counted::total_objects == 3); in main()
75 Counted::reset(); in main()
82 Buffer<Counted, N> buf; in main()
86 assert(Counted::total_objects == N); in main()
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/
H A Dranges_uninitialized_value_construct.pass.cpp48 Buffer<Counted, 1> buf; in main()
72 Buffer<Counted, N> buf; in main()
79 Counted::reset(); in main()
93 Counted::reset(); in main()
106 Counted::reset(); in main()
119 Counted::reset(); in main()
133 Counted::reset(); in main()
167 Counted::reset(); in main()
183 Counted::reset(); in main()
196 Counted::reset(); in main()
[all …]
H A Duninitialized_value_construct.pass.cpp23 struct Counted { struct
28 Counted(Counted const&) { assert(false); } in Counted() argument
32 int Counted::count = 0;
33 int Counted::constructed = 0;
77 alignas(Counted) char pool[sizeof(Counted)*N] = {}; in test_counted()
78 Counted* p = (Counted*)pool; in test_counted()
80 assert(Counted::count == 1); in test_counted()
81 assert(Counted::constructed == 1); in test_counted()
83 assert(Counted::count == 5); in test_counted()
84 assert(Counted::constructed == 5); in test_counted()
[all …]
H A Dranges_uninitialized_value_construct_n.pass.cpp42 Buffer<Counted, 1> buf; in main()
46 assert(Counted::total_objects == 0); in main()
52 Buffer<Counted, N> buf; in main()
56 assert(Counted::total_objects == N); in main()
59 Counted::reset(); in main()
84 Buffer<Counted, N> buf; in main()
92 assert(Counted::total_objects == 3); in main()
94 Counted::reset(); in main()
101 Buffer<Counted, N> buf; in main()
105 assert(Counted::total_objects == N); in main()
[all …]
H A Duninitialized_value_construct_n.pass.cpp23 struct Counted { struct
28 Counted(Counted const&) { assert(false); } in Counted() function
29 ~Counted() { --count; } in ~Counted() argument
32 int Counted::count = 0;
33 int Counted::constructed = 0;
78 alignas(Counted) char pool[sizeof(Counted)*N] = {}; in test_counted()
79 Counted* p = (Counted*)pool; in test_counted()
82 assert(Counted::count == 1); in test_counted()
83 assert(Counted::constructed == 1); in test_counted()
86 assert(Counted::count == 5); in test_counted()
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/
H A Dranges_uninitialized_fill.pass.cpp46 Counted x(value); in main()
47 Counted::reset(); in main()
67 Counted::reset(); in main()
72 Counted::reset(); in main()
86 Counted::reset(); in main()
101 Counted::reset(); in main()
115 Counted::reset(); in main()
129 Counted::reset(); in main()
144 Counted::reset(); in main()
180 Counted::reset(); in main()
[all …]
/llvm-project-15.0.7/libcxx/test/std/iterators/predef.iterators/counted.iterator/
H A Dplus.pass.cpp39 using Counted = std::counted_iterator<random_access_iterator<int*>>; in test() typedef
42 assert(iter + 0 == Counted(random_access_iterator<int*>{buffer}, 8)); in test()
44 ASSERT_SAME_TYPE(decltype(iter + 2), Counted); in test()
50 assert(iter + 0 == Counted(random_access_iterator<int*>{buffer}, 8)); in test()
52 ASSERT_SAME_TYPE(decltype(iter + 2), std::remove_const_t<Counted>); in test()
58 using Counted = std::counted_iterator<random_access_iterator<int*>>; in test() typedef
63 ASSERT_SAME_TYPE(decltype(iter + 2), Counted); in test()
71 ASSERT_SAME_TYPE(decltype(iter + 2), std::remove_const_t<Counted>); in test()
82 ASSERT_SAME_TYPE(decltype(iter += 2), Counted&); in test()
85 using Counted = std::counted_iterator<contiguous_iterator<int*>>; in test() typedef
[all …]
H A Dminus.size.pass.cpp28 using Counted = std::counted_iterator<random_access_iterator<int*>>; in test() typedef
29 Counted iter(random_access_iterator<int*>{buffer + 2}, 6); in test()
34 ASSERT_SAME_TYPE(decltype(iter - 2), Counted); in test()
38 const Counted iter(random_access_iterator<int*>{buffer + 2}, 6); in test()
43 ASSERT_SAME_TYPE(decltype(iter - 2), Counted); in test()
46 using Counted = std::counted_iterator<contiguous_iterator<int*>>; in test() typedef
47 Counted iter(contiguous_iterator<int*>{buffer + 2}, 6); in test()
52 ASSERT_SAME_TYPE(decltype(iter - 2), Counted); in test()
55 using Counted = std::counted_iterator<contiguous_iterator<int*>>; in test() typedef
56 const Counted iter(contiguous_iterator<int*>{buffer + 2}, 6); in test()
[all …]
H A Ddecrement.pass.cpp31 using Counted = std::counted_iterator<bidirectional_iterator<int*>>; in test() typedef
34 assert(--iter == Counted(bidirectional_iterator<int*>{buffer}, 8)); in test()
37 ASSERT_SAME_TYPE(decltype(iter--), Counted); in test()
38 ASSERT_SAME_TYPE(decltype(--iter), Counted&); in test()
42 Counted iter(random_access_iterator<int*>{buffer + 2}, 6); in test()
47 ASSERT_SAME_TYPE(decltype(iter--), Counted); in test()
48 ASSERT_SAME_TYPE(decltype(--iter), Counted&); in test()
51 using Counted = std::counted_iterator<contiguous_iterator<int*>>; in test() typedef
54 assert(--iter == Counted(contiguous_iterator<int*>{buffer}, 8)); in test()
57 ASSERT_SAME_TYPE(decltype(iter--), Counted); in test()
[all …]
H A Dincrement.cpp66 using Counted = std::counted_iterator<forward_iterator<int*>>; in test() typedef
69 assert(iter++ == Counted(forward_iterator<int*>{buffer}, 8)); in test()
72 ASSERT_SAME_TYPE(decltype(iter++), Counted); in test()
73 ASSERT_SAME_TYPE(decltype(++iter), Counted&); in test()
82 ASSERT_SAME_TYPE(decltype(iter++), Counted); in test()
83 ASSERT_SAME_TYPE(decltype(++iter), Counted&); in test()
101 using Counted = std::counted_iterator<InputOrOutputArchetype>; in main() typedef
108 ASSERT_SAME_TYPE(decltype(++iter), Counted&); in main()
118 ASSERT_SAME_TYPE(decltype(++iter), Counted&); in main()
122 using Counted = std::counted_iterator<ThrowsOnInc<int*>>; in main() typedef
[all …]
H A Dminus.eq.pass.cpp28 using Counted = std::counted_iterator<random_access_iterator<int*>>; in test() typedef
29 Counted iter(random_access_iterator<int*>{buffer + 2}, 6); in test()
30 assert((iter -= 2) == Counted(random_access_iterator<int*>{buffer}, 8)); in test()
31 assert((iter -= 0) == Counted(random_access_iterator<int*>{buffer}, 8)); in test()
34 ASSERT_SAME_TYPE(decltype(iter -= 2), Counted&); in test()
37 using Counted = std::counted_iterator<contiguous_iterator<int*>>; in test() typedef
38 Counted iter(contiguous_iterator<int*>{buffer + 2}, 6); in test()
39 assert((iter -= 2) == Counted(contiguous_iterator<int*>{buffer}, 8)); in test()
40 assert((iter -= 0) == Counted(contiguous_iterator<int*>{buffer}, 8)); in test()
43 ASSERT_SAME_TYPE(decltype(iter -= 2), Counted&); in test()
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/
H A Dcounted.h15 struct Counted { struct
25 explicit Counted() { in Counted() argument
43 Counted(const Counted& rhs) : value(rhs.value) { in Counted() function
49 Counted(Counted&& rhs) : value(rhs.value) { in Counted() function
57 friend bool operator==(const Counted& l, const Counted& r) {
61 friend bool operator!=(const Counted& l, const Counted& r) {
79 int Counted::current_objects = 0; argument
80 int Counted::total_objects = 0;
81 int Counted::total_copies = 0;
82 int Counted::total_moves = 0;
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/
H A Dranges_uninitialized_fill_n.pass.cpp41 Counted x(value); in main()
42 Counted::reset(); in main()
47 Buffer<Counted, 1> buf; in main()
51 assert(Counted::total_objects == 0); in main()
57 Buffer<Counted, N> buf; in main()
61 assert(Counted::total_objects == N); in main()
65 Counted::reset(); in main()
90 Buffer<Counted, N> buf; in main()
101 Counted::reset(); in main()
108 Buffer<Counted, N> buf; in main()
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/
H A Dconstruct_at.pass.cpp36 struct Counted { struct
39 constexpr Counted(Counted const& that) : count_(that.count_) { ++count_; } in Counted() argument
40 constexpr ~Counted() { --count_; } in ~Counted() argument
69 std::allocator<Counted> a; in test()
70 Counted* p = a.allocate(2); in test()
76 (p+1)->~Counted(); in test()
78 p->~Counted(); in test()
84 std::allocator<Counted const> a; in test()
85 Counted const* p = a.allocate(2); in test()
91 (p+1)->~Counted(); in test()
[all …]
/llvm-project-15.0.7/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/
H A Ddestroy.pass.cpp23 struct Counted { struct
26 TEST_CONSTEXPR Counted(Counted const& other) : counter_(other.counter_) { ++*counter_; } in Counted() argument
27 TEST_CONSTEXPR_CXX20 ~Counted() { --*counter_; } in ~Counted() argument
28 friend void operator&(Counted) = delete;
34 using Array = Counted[3]; in test_arrays()
55 using Array = Counted[3][2]; in test_arrays()
84 using Alloc = std::allocator<Counted>; in test()
87 Counted* pool = std::allocator_traits<Alloc>::allocate(alloc, 5); in test()
89 for (Counted* p = pool; p != pool + 5; ++p) in test()
101 test<Counted*>(); in tests()
[all …]
H A Ddestroy_n.pass.cpp23 struct Counted { struct
26 TEST_CONSTEXPR Counted(Counted const& other) : counter_(other.counter_) { ++*counter_; } in Counted() function
27 TEST_CONSTEXPR_CXX20 ~Counted() { --*counter_; } in ~Counted() argument
28 friend void operator&(Counted) = delete;
34 using Array = Counted[3]; in test_arrays()
56 using Array = Counted[3][2]; in test_arrays()
86 using Alloc = std::allocator<Counted>; in test()
89 Counted* pool = std::allocator_traits<Alloc>::allocate(alloc, 5); in test()
91 for (Counted* p = pool; p != pool + 5; ++p) in test()
104 test<Counted*>(); in tests()
[all …]

12