[libcxx-commits] [libcxx] 492bf8e - [libc++] Add a test for the ABI of std::once_flag (#218924)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 2 07:13:05 PDT 2026


Author: Nikolas Klauser
Date: 2026-09-02T16:12:58+02:00
New Revision: 492bf8e7fb9e3fc5fd8fd899d96bc91d7e3a657e

URL: https://github.com/llvm/llvm-project/commit/492bf8e7fb9e3fc5fd8fd899d96bc91d7e3a657e
DIFF: https://github.com/llvm/llvm-project/commit/492bf8e7fb9e3fc5fd8fd899d96bc91d7e3a657e.diff

LOG: [libc++] Add a test for the ABI of std::once_flag (#218924)

Added: 
    libcxx/test/libcxx/thread/thread.mutex/thread.once/once_flag.abi.compile.pass.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/thread/thread.mutex/thread.once/once_flag.abi.compile.pass.cpp b/libcxx/test/libcxx/thread/thread.mutex/thread.once/once_flag.abi.compile.pass.cpp
new file mode 100644
index 0000000000000..c7e65574cadc0
--- /dev/null
+++ b/libcxx/test/libcxx/thread/thread.mutex/thread.once/once_flag.abi.compile.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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::once_flag
+
+#include <mutex>
+#include <type_traits>
+
+static_assert(sizeof(std::once_flag) == sizeof(void*), "");
+static_assert(alignof(std::once_flag) == alignof(void*), "");
+static_assert(std::is_trivially_destructible<std::once_flag>::value, "");


        


More information about the libcxx-commits mailing list