[libcxx-commits] [libcxx] [libc++][string] Add constexpr initialization stress test (PR #184723)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 5 02:19:49 PST 2026


================
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// REQUIRES: clang
+
+// <string>
+
+// Stress test for constexpr std::string initialization.
+// This test ensures that we can handle a large number of constexpr strings.
+
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=1000000
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=1000000
+
+#include <string>
+#include <array>
+#include <cassert>
+
+#include "test_macros.h"
----------------
frederick-vs-ja wrote:

Do we need to include this file?

https://github.com/llvm/llvm-project/pull/184723


More information about the libcxx-commits mailing list