diff --git a/tests/std/test.lst b/tests/std/test.lst index 934f31f1d5e..5bb68adcb1d 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -277,6 +277,7 @@ tests\GH_005546_containers_size_type_cast tests\GH_005553_regex_character_translation tests\GH_005768_pow_accuracy tests\GH_005800_stable_sort_large_alignment +tests\GH_005968_headers_provide_begin_end tests\LWG2381_num_get_floating_point tests\LWG2510_tag_classes tests\LWG2597_complex_branch_cut diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/__init__.py b/tests/std/tests/GH_005968_headers_provide_begin_end/__init__.py new file mode 100644 index 00000000000..2ac2a854cb0 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/__init__.py @@ -0,0 +1,2 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/custom_format.py b/tests/std/tests/GH_005968_headers_provide_begin_end/custom_format.py new file mode 100644 index 00000000000..2d698f717b2 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/custom_format.py @@ -0,0 +1,27 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import os + +from stl.test.format import STLTestFormat, TestStep +from stl.test.tests import TestType + + +class CustomTestFormat(STLTestFormat): + def getBuildSteps(self, test, litConfig, shared): + exeSourceDir = os.path.dirname(test.getSourcePath()) + _, outputBase = test.getTempPaths() + + sourceFiles = [] + for filename in os.listdir(exeSourceDir): + if filename.endswith('.cpp'): + sourceFiles.append(os.path.join(exeSourceDir, filename)) + + if TestType.COMPILE in test.testType: + cmd = [test.cxx, '/c', *sourceFiles, *test.flags, *test.compileFlags] + elif TestType.RUN in test.testType: + shared.execFile = outputBase + '.exe' + cmd = [test.cxx, *sourceFiles, *test.flags, *test.compileFlags, '/Fe' + shared.execFile, + '/link', *test.linkFlags] + + yield TestStep(cmd, shared.execDir, shared.env, False) diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/env.lst b/tests/std/tests/GH_005968_headers_provide_begin_end/env.lst new file mode 100644 index 00000000000..19f025bd0e6 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/lit.local.cfg b/tests/std/tests/GH_005968_headers_provide_begin_end/lit.local.cfg new file mode 100644 index 00000000000..a2eb46b33dc --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/lit.local.cfg @@ -0,0 +1,9 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import os +import site +site.addsitedir(os.path.dirname(os.path.dirname(__file__))) +import GH_005968_headers_provide_begin_end.custom_format + +config.test_format = GH_005968_headers_provide_begin_end.custom_format.CustomTestFormat() diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/shared_test.hpp b/tests/std/tests/GH_005968_headers_provide_begin_end/shared_test.hpp new file mode 100644 index 00000000000..0937ddb1d26 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/shared_test.hpp @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#pragma once + +// Intentionally avoid including anything. Order assumption: shared_test.hpp assumes +// that the relevant Standard headers have already been included by the .cpp files. + +// Test requirements of N5032 [iterator.range]/1. + +namespace detail { + + // file test_iterator.cpp uses a non-std container and thus we can't rely on ADL to find begin/end etc. + using namespace std; + + // Define minimal metaprogramming tools, avoid including anything + +#define DEFINE_CONDITIONAL_CALLER_OF_FREE_MEMBER(free_name, member_name) \ + template \ + struct conditional_caller_of_##free_name { \ + constexpr void operator()(T&) {} \ + }; \ + \ + template \ + struct conditional_caller_of_##free_name(nullptr)->member_name())> { \ + constexpr auto operator()(T& t) { \ + return free_name(t); \ + } \ + }; + +#define DEFINE_CONDITIONAL_CALLER_OF(name) DEFINE_CONDITIONAL_CALLER_OF_FREE_MEMBER(name, name) + +#define CONDITIONALLY_CALL(c, name) conditional_caller_of_##name{}(c) + + DEFINE_CONDITIONAL_CALLER_OF(rbegin); + DEFINE_CONDITIONAL_CALLER_OF(rend); + DEFINE_CONDITIONAL_CALLER_OF(crbegin); + DEFINE_CONDITIONAL_CALLER_OF(crend); + DEFINE_CONDITIONAL_CALLER_OF(size); +#if _HAS_CXX20 + DEFINE_CONDITIONAL_CALLER_OF_FREE_MEMBER(ssize, size); // N5032 [iterator.range]/18 +#endif + DEFINE_CONDITIONAL_CALLER_OF(empty); + DEFINE_CONDITIONAL_CALLER_OF(data); + + template + void test_free_container_functions(C& c) { + (void) begin(c); + (void) end(c); + (void) cbegin(c); + (void) cend(c); + CONDITIONALLY_CALL(c, rbegin); // missing e.g. for forward_list + CONDITIONALLY_CALL(c, rend); // missing e.g. for forward_list + CONDITIONALLY_CALL(c, crbegin); // missing e.g. for forward_list + CONDITIONALLY_CALL(c, crend); // missing e.g. for forward_list + CONDITIONALLY_CALL(c, size); // missing e.g. for optional +#if _HAS_CXX20 + CONDITIONALLY_CALL(c, ssize); // missing e.g. for optional +#endif + CONDITIONALLY_CALL(c, empty); // missing e.g. for valarray + CONDITIONALLY_CALL(c, data); // missing e.g. for valarray + } + + inline void test_free_array_functions() { + int a[]{1, 2, 3}; + + (void) begin(a); + (void) end(a); + (void) cbegin(a); + (void) cend(a); + (void) rbegin(a); + (void) rend(a); + (void) crbegin(a); + (void) crend(a); + (void) size(a); +#if _HAS_CXX20 + (void) ssize(a); +#endif + (void) empty(a); + (void) data(a); + } +} // namespace detail + +template +void shared_test(C& c) { + detail::test_free_container_functions(c); + // as_const from not required to be available + detail::test_free_container_functions(const_cast(c)); + + detail::test_free_array_functions(); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test.cpp new file mode 100644 index 00000000000..96e52373adc --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test.cpp @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +void test_array(); +void test_deque(); +void test_flat_map(); +void test_flat_set(); +void test_forward_list(); +void test_hive(); +void test_inplace_vector(); +void test_iterator(); +void test_list(); +void test_map(); +void test_optional(); +void test_regex(); +void test_set(); +void test_span(); +void test_stacktrace(); +void test_string(); +void test_string_view(); +void test_unordered_map(); +void test_unordered_set(); +void test_valarray(); +void test_vector(); + +int main() { + test_array(); + test_deque(); + test_flat_map(); + test_flat_set(); + test_forward_list(); + test_hive(); + test_inplace_vector(); + test_iterator(); + test_list(); + test_map(); + test_optional(); + test_regex(); + test_set(); + test_span(); + test_stacktrace(); + test_string(); + test_string_view(); + test_unordered_map(); + test_unordered_set(); + test_valarray(); + test_vector(); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_array.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_array.cpp new file mode 100644 index 00000000000..f2422e0efa8 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_array.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_array() { + std::array container{1, 2, 3}; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_deque.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_deque.cpp new file mode 100644 index 00000000000..3cb47d630d6 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_deque.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_deque() { + std::deque container{1, 2, 3}; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_flat_map.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_flat_map.cpp new file mode 100644 index 00000000000..76a545f65c4 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_flat_map.cpp @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if defined(__cpp_lib_flat_map) +static_assert(false, "When this feature is implemented, update this to a Standard mode check."); + +#include + +#include "shared_test.hpp" + +void test_flat_map() { + { + std::flat_map container{ + {1, 5}, + {3, 7}, + }; + shared_test(container); + } + + { + std::flat_multimap container2{ + {1, 5}, + {3, 7}, + }; + shared_test(container2); + } +} + +#else // ^^^ defined(__cpp_lib_flat_map) / !defined(__cpp_lib_flat_map) vvv + +void test_flat_map() {} + +#endif // ^^^ !defined(__cpp_lib_flat_map) ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_flat_set.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_flat_set.cpp new file mode 100644 index 00000000000..811f96eeea9 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_flat_set.cpp @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if defined(__cpp_lib_flat_set) +static_assert(false, "When this feature is implemented, update this to a Standard mode check."); + +#include + +#include "shared_test.hpp" + +void test_flat_set() { + { + std::flat_set container{1, 2, 3}; + shared_test(container); + } + + { + std::flat_multiset container2{1, 2, 3}; + shared_test(container2); + } +} + +#else // ^^^ defined(__cpp_lib_flat_set) / !defined(__cpp_lib_flat_set) vvv + +void test_flat_set() {} + +#endif // ^^^ !defined(__cpp_lib_flat_set) ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_forward_list.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_forward_list.cpp new file mode 100644 index 00000000000..85421feb199 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_forward_list.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_forward_list() { + std::forward_list container{1, 2, 3}; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_hive.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_hive.cpp new file mode 100644 index 00000000000..3ef1701b4ef --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_hive.cpp @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if defined(__cpp_lib_hive) +static_assert(false, "When this feature is implemented, update this to a Standard mode check."); + +#include + +#include "shared_test.hpp" + +void test_hive() { + std::hive container{1, 2, 3}; + shared_test(container); +} + +#else // ^^^ defined(__cpp_lib_hive) / !defined(__cpp_lib_hive) vvv + +void test_hive() {} + +#endif // ^^^ !defined(__cpp_lib_hive) ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_inplace_vector.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_inplace_vector.cpp new file mode 100644 index 00000000000..990486a72ac --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_inplace_vector.cpp @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if defined(__cpp_lib_inplace_vector) +static_assert(false, "When this feature is implemented, update this to a Standard mode check."); + +#include + +#include "shared_test.hpp" + +void test_inplace_vector() { + std::inplace_vector container{1, 2, 3}; + shared_test(container); +} + +#else // ^^^ defined(__cpp_lib_inplace_vector) / !defined(__cpp_lib_inplace_vector) vvv + +void test_inplace_vector() {} + +#endif // ^^^ !defined(__cpp_lib_inplace_vector) ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_iterator.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_iterator.cpp new file mode 100644 index 00000000000..eaa4910839c --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_iterator.cpp @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +struct minimal_container { + static constexpr size_t magic_value = 3376942; + + constexpr void begin() const {} + constexpr void end() const {} + constexpr void cbegin() const {} + constexpr void cend() const {} + constexpr void rbegin() const {} + constexpr void rend() const {} + constexpr void crbegin() const {} + constexpr void crend() const {} + constexpr size_t size() const { + return magic_value; + } + constexpr void empty() const {} + constexpr void data() const {} +}; + + +// Self-test the template machinery to check it properly detects member functions +namespace detail { + template + constexpr bool minimal_container_test(C& c) { + // when the CONDITIONALLY_CALL expression fails to detect the member, it has type void, i.e. clearly + // incompatible with operator==. If the detection mechanism did not work properly, this would fail to compile. + return CONDITIONALLY_CALL(c, size) == minimal_container::magic_value; + } + + constexpr minimal_container min_cont; + static_assert(minimal_container_test(min_cont), "The member detection utility is broken"); +} // namespace detail + +void test_iterator() { + minimal_container container; + + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_list.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_list.cpp new file mode 100644 index 00000000000..265e676721b --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_list.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_list() { + std::list container{1, 2, 3}; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_map.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_map.cpp new file mode 100644 index 00000000000..2b3c7ce636c --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_map.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_map() { + { + std::map container{{1, 2}, {3, 4}}; + shared_test(container); + } + + { + std::multimap container2{{5, 2}, {6, 4}}; + shared_test(container2); + } +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_optional.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_optional.cpp new file mode 100644 index 00000000000..afcaeac5cd9 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_optional.cpp @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if defined(__cpp_lib_optional_range_support) +static_assert(false, "When this feature is implemented, update this to a Standard mode check."); + +#include + +#include "shared_test.hpp" + +void test_optional() { + std::optional container{1}; + shared_test(container); +} + +#else // ^^^ defined(__cpp_lib_optional_range_support) / !defined(__cpp_lib_optional_range_support) vvv + +void test_optional() {} + +#endif // ^^^ !defined(__cpp_lib_optional_range_support) ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_regex.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_regex.cpp new file mode 100644 index 00000000000..27f688c0726 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_regex.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_regex() { + std::smatch container; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_set.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_set.cpp new file mode 100644 index 00000000000..7f92da62da0 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_set.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_set() { + { + std::set container{1, 2, 3}; + shared_test(container); + } + + { + std::multiset container2{1, 2, 3}; + shared_test(container2); + } +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_span.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_span.cpp new file mode 100644 index 00000000000..6487b673a63 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_span.cpp @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if _HAS_CXX20 + +#include + +#include "shared_test.hpp" + +void test_span() { + int arr[]{1, 2, 3}; + std::span container(arr); + shared_test(container); +} + +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + +void test_span() {} + +#endif // ^^^ !_HAS_CXX20 ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_stacktrace.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_stacktrace.cpp new file mode 100644 index 00000000000..dab992410ba --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_stacktrace.cpp @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if _HAS_CXX23 + +#include + +#include "shared_test.hpp" + +void test_stacktrace() { + std::stacktrace container; + shared_test(container); +} + +#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv + +void test_stacktrace() {} + +#endif // ^^^ !_HAS_CXX23 ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_string.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_string.cpp new file mode 100644 index 00000000000..2957f1ecf71 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_string.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_string() { + std::string container = "hello"; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_string_view.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_string_view.cpp new file mode 100644 index 00000000000..5f16e21f046 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_string_view.cpp @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#if _HAS_CXX17 + +#include + +#include "shared_test.hpp" + +void test_string_view() { + std::string_view container = "hello"; + shared_test(container); +} +#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv + +void test_string_view() {} + +#endif // ^^^ !_HAS_CXX17 ^^^ diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_unordered_map.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_unordered_map.cpp new file mode 100644 index 00000000000..a800671ae5d --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_unordered_map.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_unordered_map() { + { + std::unordered_map container{{1, 2}, {3, 4}}; + shared_test(container); + } + + { + std::unordered_multimap container2{{5, 2}, {6, 4}}; + shared_test(container2); + } +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_unordered_set.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_unordered_set.cpp new file mode 100644 index 00000000000..478c4cf0918 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_unordered_set.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_unordered_set() { + { + std::unordered_set container{1, 2, 3}; + shared_test(container); + } + + { + std::unordered_multiset container2{4, 5, 6}; + shared_test(container2); + } +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_valarray.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_valarray.cpp new file mode 100644 index 00000000000..0fef8a143b4 --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_valarray.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_valarray() { + std::valarray container{1, 2, 3}; + shared_test(container); +} diff --git a/tests/std/tests/GH_005968_headers_provide_begin_end/test_vector.cpp b/tests/std/tests/GH_005968_headers_provide_begin_end/test_vector.cpp new file mode 100644 index 00000000000..942dcef972b --- /dev/null +++ b/tests/std/tests/GH_005968_headers_provide_begin_end/test_vector.cpp @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include "shared_test.hpp" + +void test_vector() { + std::vector container{1, 2, 3}; + shared_test(container); +}