[libcxx-commits] [libcxx] [libc++] Add a test for the ABI of std::locale::id (PR #220857)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 3 02:48:03 PDT 2026
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/220857
None
>From aade97e4fd4023c8a767dce4579e93f57aabd914 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Thu, 3 Sep 2026 11:45:43 +0200
Subject: [PATCH] [libc++] Add a test for the ABI of std::locale::id
---
.../locale.id/id.abi.compile.pass.cpp | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 libcxx/test/libcxx/localization/locales/locale/locale.types/locale.id/id.abi.compile.pass.cpp
diff --git a/libcxx/test/libcxx/localization/locales/locale/locale.types/locale.id/id.abi.compile.pass.cpp b/libcxx/test/libcxx/localization/locales/locale/locale.types/locale.id/id.abi.compile.pass.cpp
new file mode 100644
index 0000000000000..7323d24135347
--- /dev/null
+++ b/libcxx/test/libcxx/localization/locales/locale/locale.types/locale.id/id.abi.compile.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: no-threads, c++03
+
+// <mutex>
+
+// Check the ABI of std::locale::id
+
+#include <cstdint>
+#include <locale>
+#include <type_traits>
+
+static_assert(sizeof(std::locale::id) == 2 * sizeof(std::uintptr_t), "");
+static_assert(alignof(std::locale::id) == alignof(std::uintptr_t), "");
+static_assert(std::is_trivially_destructible<std::locale::id>::value, "");
+static_assert(std::__datasizeof_v<std::locale::id> == sizeof(std::uintptr_t) + sizeof(std::int32_t), "");
More information about the libcxx-commits
mailing list