[libcxx-commits] [libcxx] [libc++][C++26] P2562R1: `constexpr` Stable Sorting (PR #110320)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Oct 15 01:03:50 PDT 2024
================
@@ -148,22 +228,32 @@ int main(int, char**)
test_sort_<6>();
test_sort_<7>();
test_sort_<8>();
+ }
- test_larger_sorts(256);
- test_larger_sorts(257);
- test_larger_sorts(499);
- test_larger_sorts(500);
- test_larger_sorts(997);
- test_larger_sorts(1000);
- test_larger_sorts(1009);
-
-#if !defined(TEST_HAS_NO_EXCEPTIONS)
- { // check that the algorithm works without memory
- std::vector<int> vec(150, 3);
- getGlobalMemCounter()->throw_after = 0;
- std::stable_sort(vec.begin(), vec.end());
- }
-#endif // !defined(TEST_HAS_NO_EXCEPTIONS)
+ { // larger sorts
+ // run- and conditionally compile-time tests
+ test_larger_sorts<256>();
+ test_larger_sorts<257>();
+#if TEST_STD_VER >= 26
+ static_assert((test_larger_sorts<256>(), true));
+ static_assert((test_larger_sorts<257>(), true));
+#endif
----------------
philnik777 wrote:
You can simply add `// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=2000000`.
https://github.com/llvm/llvm-project/pull/110320
More information about the libcxx-commits
mailing list