[libcxx-commits] [libcxx] [libc++] Move more tests into better places (PR #148419)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 13 02:26:51 PDT 2025


https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/148419

None

>From 720050096710c40a305a877608556e781b92e0a3 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Sun, 13 Jul 2025 11:23:42 +0200
Subject: [PATCH] [libc++] Move more tests into better places

---
 .../conversions.string/ctor_move.pass.cpp     | 42 +++++++++++++++++++
 .../c.math/fdelayed-template-parsing.pass.cpp |  0
 .../rand.req.urng/valid_int_type.verify.cpp   |  0
 .../rand.req.urng/valid_real_type.verify.cpp  |  0
 .../shared_ptr_array.pass.cpp                 |  0
 5 files changed, 42 insertions(+)
 create mode 100644 libcxx/test/extensions/libcxx/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
 rename libcxx/test/{libcxx => std}/numerics/c.math/fdelayed-template-parsing.pass.cpp (100%)
 rename libcxx/test/{libcxx/numerics/rand => std/numerics/rand/rand.req}/rand.req.urng/valid_int_type.verify.cpp (100%)
 rename libcxx/test/{libcxx/numerics/rand => std/numerics/rand/rand.req}/rand.req.urng/valid_real_type.verify.cpp (100%)
 rename libcxx/test/{libcxx/memory => std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create}/shared_ptr_array.pass.cpp (100%)

diff --git a/libcxx/test/extensions/libcxx/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/libcxx/test/extensions/libcxx/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
new file mode 100644
index 0000000000000..a536e6e9b04c6
--- /dev/null
+++ b/libcxx/test/extensions/libcxx/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: no-wide-characters
+
+// UNSUPPORTED: c++03
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT -D_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT
+
+// <locale>
+
+// wstring_convert<Codecvt, Elem, Wide_alloc, Byte_alloc>
+
+// wstring_convert(wstring_convert&& other); // EXTENSION
+
+#include <locale>
+#include <codecvt>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**)
+{
+    typedef std::codecvt_utf8<wchar_t> Codecvt;
+    typedef std::wstring_convert<Codecvt> Myconv;
+    // create a converter and perform some conversions to generate some
+    // interesting state.
+    Myconv myconv;
+    myconv.from_bytes("\xEF\xBF\xBD");
+    const auto old_converted = myconv.converted();
+    assert(myconv.converted() == 3);
+    // move construct a new converter and make sure the state is the same.
+    Myconv myconv2(std::move(myconv));
+    assert(myconv2.converted() == old_converted);
+
+  return 0;
+}
diff --git a/libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp b/libcxx/test/std/numerics/c.math/fdelayed-template-parsing.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp
rename to libcxx/test/std/numerics/c.math/fdelayed-template-parsing.pass.cpp
diff --git a/libcxx/test/libcxx/numerics/rand/rand.req.urng/valid_int_type.verify.cpp b/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/valid_int_type.verify.cpp
similarity index 100%
rename from libcxx/test/libcxx/numerics/rand/rand.req.urng/valid_int_type.verify.cpp
rename to libcxx/test/std/numerics/rand/rand.req/rand.req.urng/valid_int_type.verify.cpp
diff --git a/libcxx/test/libcxx/numerics/rand/rand.req.urng/valid_real_type.verify.cpp b/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/valid_real_type.verify.cpp
similarity index 100%
rename from libcxx/test/libcxx/numerics/rand/rand.req.urng/valid_real_type.verify.cpp
rename to libcxx/test/std/numerics/rand/rand.req/rand.req.urng/valid_real_type.verify.cpp
diff --git a/libcxx/test/libcxx/memory/shared_ptr_array.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/shared_ptr_array.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/memory/shared_ptr_array.pass.cpp
rename to libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/shared_ptr_array.pass.cpp



More information about the libcxx-commits mailing list