Skip to content

Conversation

philnik777
Copy link
Contributor

#134253 refactors a few classes to use [[no_unique_address]] instead of the EBO. This adds tests to ensure there are no ABI breaks.

@philnik777 philnik777 force-pushed the add_abi_tests_for_compressed_element branch from d122fe9 to eb5fde2 Compare September 2, 2025 17:01
Copy link

github-actions bot commented Sep 2, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp -- libcxx/test/libcxx/utilities/tuple/abi.compile.pass.cpp libcxx/test/libcxx/containers/associative/map/abi.compile.pass.cpp libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp b/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
index 39fc9fe94..41400a002 100644
--- a/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
@@ -152,11 +152,11 @@ static_assert(TEST_ALIGNOF(unordered_map_alloc<char, small_iter_allocator<std::p
 static_assert(TEST_ALIGNOF(unordered_map_alloc<char, final_small_iter_allocator<std::pair<const char, char> > >) == 4,
               "");
 
-#ifdef TEST_COMPILER_GCC
+#  ifdef TEST_COMPILER_GCC
 static_assert(sizeof(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 40, "");
-#else
+#  else
 static_assert(sizeof(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 48, "");
-#endif
+#  endif
 static_assert(sizeof(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 48, "");
 static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 48, "");
 static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 56, "");

@ldionne ldionne marked this pull request as ready for review September 2, 2025 18:16
@ldionne ldionne requested a review from a team as a code owner September 2, 2025 18:16
Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor comments.

@philnik777 philnik777 force-pushed the add_abi_tests_for_compressed_element branch 2 times, most recently from 1a23b35 to c50832b Compare September 3, 2025 13:01
@philnik777 philnik777 force-pushed the add_abi_tests_for_compressed_element branch from c50832b to 1c478d3 Compare September 3, 2025 13:57
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2025

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

Changes

#134253 refactors a few classes to use [[no_unique_address]] instead of the EBO. This adds tests to ensure there are no ABI breaks.


Full diff: https://github.com/llvm/llvm-project/pull/156416.diff

3 Files Affected:

  • (modified) libcxx/test/libcxx/containers/associative/map/abi.compile.pass.cpp (+23-5)
  • (modified) libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp (+50-4)
  • (added) libcxx/test/libcxx/utilities/tuple/abi.compile.pass.cpp (+124)
diff --git a/libcxx/test/libcxx/containers/associative/map/abi.compile.pass.cpp b/libcxx/test/libcxx/containers/associative/map/abi.compile.pass.cpp
index e0598b4ff1746..ca4e9747bc490 100644
--- a/libcxx/test/libcxx/containers/associative/map/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/map/abi.compile.pass.cpp
@@ -87,6 +87,18 @@ struct user_struct {
   [[no_unique_address]] common_base_allocator<int> a;
 };
 
+struct TEST_ALIGNAS(32) AlignedLess {};
+struct FinalLess final {};
+struct NonEmptyLess {
+  int i;
+  char c;
+};
+
+static_assert(std::is_empty<std::__map_value_compare<int, std::pair<const int, int>, std::less<int> > >::value, "");
+static_assert(std::is_empty<std::__map_value_compare<int, std::pair<const int, int>, AlignedLess> >::value, "");
+static_assert(!std::is_empty<std::__map_value_compare<int, std::pair<const int, int>, FinalLess> >::value, "");
+static_assert(!std::is_empty<std::__map_value_compare<int, std::pair<const int, int>, NonEmptyLess> >::value, "");
+
 #if __SIZE_WIDTH__ == 64
 // TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed
 #  ifdef TEST_COMPILER_GCC
@@ -120,10 +132,13 @@ static_assert(TEST_ALIGNOF(map_alloc<char, test_allocator<std::pair<const char,
 static_assert(TEST_ALIGNOF(map_alloc<char, small_iter_allocator<std::pair<const char, char> > >) == 2, "");
 static_assert(TEST_ALIGNOF(map_alloc<char, final_small_iter_allocator<std::pair<const char, char> > >) == 2, "");
 
-struct TEST_ALIGNAS(32) AlignedLess {};
-
 static_assert(sizeof(std::map<int, int, AlignedLess>) == 64, "");
+static_assert(sizeof(std::map<int, int, FinalLess>) == 32, "");
+static_assert(sizeof(std::map<int, int, NonEmptyLess>) == 32, "");
+
 static_assert(TEST_ALIGNOF(std::map<int, int, AlignedLess>) == 32, "");
+static_assert(TEST_ALIGNOF(std::map<int, int, FinalLess>) == 8, "");
+static_assert(TEST_ALIGNOF(std::map<int, int, NonEmptyLess>) == 8, "");
 
 #elif __SIZE_WIDTH__ == 32
 // TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed
@@ -158,10 +173,13 @@ static_assert(TEST_ALIGNOF(map_alloc<char, test_allocator<std::pair<const char,
 static_assert(TEST_ALIGNOF(map_alloc<char, small_iter_allocator<std::pair<const char, char> > >) == 2, "");
 static_assert(TEST_ALIGNOF(map_alloc<char, final_small_iter_allocator<std::pair<const char, char> > >) == 2, "");
 
-struct TEST_ALIGNAS(32) AlignedLess {};
+static_assert(sizeof(std::map<int, int, AlignedLess>) == 64, "");
+static_assert(sizeof(std::map<int, int, FinalLess>) == 16, "");
+static_assert(sizeof(std::map<int, int, NonEmptyLess>) == 20, "");
 
-static_assert(sizeof(std::map<int, int, AlignedLess>) == 64);
-static_assert(TEST_ALIGNOF(std::map<int, int, AlignedLess>) == 32);
+static_assert(TEST_ALIGNOF(std::map<int, int, AlignedLess>) == 32, "");
+static_assert(TEST_ALIGNOF(std::map<int, int, FinalLess>) == 4, "");
+static_assert(TEST_ALIGNOF(std::map<int, int, NonEmptyLess>) == 4, "");
 
 #else
 #  error std::size_t has an unexpected size
diff --git a/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp b/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
index 60c3e5bf31b00..39fc9fe94a83c 100644
--- a/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
@@ -91,6 +91,33 @@ struct user_struct {
   [[no_unique_address]] common_base_allocator<int> a;
 };
 
+struct TEST_ALIGNAS(32) AlignedHash {};
+struct FinalHash final {};
+struct NonEmptyHash final {
+  int i;
+  char c;
+};
+struct UnalignedEqualTo {};
+struct FinalEqualTo final {};
+struct NonEmptyEqualTo {
+  int i;
+  char c;
+};
+
+static_assert(std::is_empty<std::__unordered_map_hasher<int, std::pair<const int, int>, std::hash<int>, int> >::value,
+              "");
+static_assert(std::is_empty<std::__unordered_map_hasher<int, std::pair<const int, int>, AlignedHash, int> >::value, "");
+static_assert(!std::is_empty<std::__unordered_map_hasher<int, std::pair<const int, int>, FinalHash, int> >::value, "");
+static_assert(!std::is_empty<std::__unordered_map_hasher<int, std::pair<const int, int>, NonEmptyHash, int> >::value,
+              "");
+
+static_assert(std::is_empty<std::__unordered_map_equal<int, std::pair<const int, int>, std::hash<int>, int> >::value,
+              "");
+static_assert(std::is_empty<std::__unordered_map_equal<int, std::pair<const int, int>, AlignedHash, int> >::value, "");
+static_assert(!std::is_empty<std::__unordered_map_equal<int, std::pair<const int, int>, FinalHash, int> >::value, "");
+static_assert(!std::is_empty<std::__unordered_map_equal<int, std::pair<const int, int>, NonEmptyHash, int> >::value,
+              "");
+
 #if __SIZE_WIDTH__ == 64
 // TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed
 #  ifdef TEST_COMPILER_GCC
@@ -125,8 +152,20 @@ static_assert(TEST_ALIGNOF(unordered_map_alloc<char, small_iter_allocator<std::p
 static_assert(TEST_ALIGNOF(unordered_map_alloc<char, final_small_iter_allocator<std::pair<const char, char> > >) == 4,
               "");
 
-struct TEST_ALIGNAS(32) AlignedHash {};
-struct UnalignedEqualTo {};
+#ifdef TEST_COMPILER_GCC
+static_assert(sizeof(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 40, "");
+#else
+static_assert(sizeof(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 48, "");
+#endif
+static_assert(sizeof(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 48, "");
+static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 48, "");
+static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 56, "");
+
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 8, "");
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 8, "");
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 8, "");
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 8, "");
+
 // TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed
 #  ifdef TEST_COMPILER_GCC
 static_assert(sizeof(std::unordered_map<int, int, AlignedHash, UnalignedEqualTo>) == 64, "");
@@ -169,8 +208,15 @@ static_assert(TEST_ALIGNOF(unordered_map_alloc<char, small_iter_allocator<std::p
 static_assert(TEST_ALIGNOF(unordered_map_alloc<char, final_small_iter_allocator<std::pair<const char, char> > >) == 4,
               "");
 
-struct TEST_ALIGNAS(32) AlignedHash {};
-struct UnalignedEqualTo {};
+static_assert(sizeof(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 24, "");
+static_assert(sizeof(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 24, "");
+static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 28, "");
+static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 32, "");
+
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, FinalHash, UnalignedEqualTo>) == 4, "");
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 4, "");
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 4, "");
+static_assert(TEST_ALIGNOF(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 4, "");
 
 // TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed
 #  ifdef TEST_COMPILER_GCC
diff --git a/libcxx/test/libcxx/utilities/tuple/abi.compile.pass.cpp b/libcxx/test/libcxx/utilities/tuple/abi.compile.pass.cpp
new file mode 100644
index 0000000000000..467214a0779db
--- /dev/null
+++ b/libcxx/test/libcxx/utilities/tuple/abi.compile.pass.cpp
@@ -0,0 +1,124 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// UNSUPPORTED: libcpp-abi-no-compressed-pair-padding
+
+#include <tuple>
+#include <type_traits>
+
+#include "test_macros.h"
+
+struct S {};
+
+struct Final final {};
+
+struct NonEmpty {
+  int i;
+  char c;
+};
+
+struct NonEmptyFinal final {
+  int i;
+  char c;
+};
+
+struct TEST_ALIGNAS(16) Overaligned {};
+struct TEST_ALIGNAS(16) OveralignedFinal final {};
+
+static_assert(std::is_empty<std::tuple<>>::value, "");
+static_assert(!std::is_empty<std::tuple<S>>::value, "");
+static_assert(!std::is_empty<std::tuple<S&>>::value, "");
+static_assert(!std::is_empty<std::tuple<S&&>>::value, "");
+static_assert(!std::is_empty<std::tuple<Final>>::value, "");
+static_assert(!std::is_empty<std::tuple<NonEmpty>>::value, "");
+static_assert(!std::is_empty<std::tuple<NonEmptyFinal>>::value, "");
+static_assert(!std::is_empty<std::tuple<Overaligned>>::value, "");
+static_assert(!std::is_empty<std::tuple<OveralignedFinal>>::value, "");
+
+static_assert(sizeof(std::tuple<S>) == 1, "");
+static_assert(sizeof(std::tuple<S&>) == sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&&>) == sizeof(void*), "");
+static_assert(sizeof(std::tuple<Final>) == 1, "");
+static_assert(sizeof(std::tuple<NonEmpty>) == 8, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal>) == 8, "");
+static_assert(sizeof(std::tuple<Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal>) == 16, "");
+
+static_assert(sizeof(std::tuple<S, S>) == 2, "");
+static_assert(sizeof(std::tuple<S&, S>) == sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&&, S>) == sizeof(void*), "");
+static_assert(sizeof(std::tuple<Final, S>) == 1, "");
+static_assert(sizeof(std::tuple<NonEmpty, S>) == 8, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, S>) == 8, "");
+static_assert(sizeof(std::tuple<Overaligned, S>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, S>) == 16, "");
+
+static_assert(sizeof(std::tuple<S, S&>) == sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&, S&>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&&, S&>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<Final, S&>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<NonEmpty, S&>) == 8 + sizeof(void*), "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, S&>) == 8 + sizeof(void*), "");
+static_assert(sizeof(std::tuple<Overaligned, S&>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, S&>) == 32, "");
+
+static_assert(sizeof(std::tuple<S, S&&>) == sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&, S&&>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&&, S&&>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<Final, S&&>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<NonEmpty, S&&>) == 8 + sizeof(void*), "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, S&&>) == 8 + sizeof(void*), "");
+static_assert(sizeof(std::tuple<Overaligned, S&&>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, S&&>) == 32, "");
+
+static_assert(sizeof(std::tuple<S, Final>) == 1, "");
+static_assert(sizeof(std::tuple<S&, Final>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<S&&, Final>) == 2 * sizeof(void*), "");
+static_assert(sizeof(std::tuple<Final, Final>) == 2, "");
+static_assert(sizeof(std::tuple<NonEmpty, Final>) == 12, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, Final>) == 12, "");
+static_assert(sizeof(std::tuple<Overaligned, Final>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, Final>) == 32, "");
+
+static_assert(sizeof(std::tuple<S, NonEmpty>) == 8, "");
+static_assert(sizeof(std::tuple<S&, NonEmpty>) == sizeof(void*) + 8, "");
+static_assert(sizeof(std::tuple<S&&, NonEmpty>) == sizeof(void*) + 8, "");
+static_assert(sizeof(std::tuple<Final, NonEmpty>) == 12, "");
+static_assert(sizeof(std::tuple<NonEmpty, NonEmpty>) == 16, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, NonEmpty>) == 16, "");
+static_assert(sizeof(std::tuple<Overaligned, NonEmpty>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, NonEmpty>) == 32, "");
+
+static_assert(sizeof(std::tuple<S, NonEmptyFinal>) == 8, "");
+static_assert(sizeof(std::tuple<S&, NonEmptyFinal>) == sizeof(void*) + 8, "");
+static_assert(sizeof(std::tuple<S&&, NonEmptyFinal>) == sizeof(void*) + 8, "");
+static_assert(sizeof(std::tuple<Final, NonEmptyFinal>) == 12, "");
+static_assert(sizeof(std::tuple<NonEmpty, NonEmptyFinal>) == 16, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, NonEmptyFinal>) == 16, "");
+static_assert(sizeof(std::tuple<Overaligned, NonEmptyFinal>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, NonEmptyFinal>) == 32, "");
+
+static_assert(sizeof(std::tuple<S, Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<S&, Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<S&&, Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<Final, Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<NonEmpty, Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, Overaligned>) == 16, "");
+static_assert(sizeof(std::tuple<Overaligned, Overaligned>) == 32, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, Overaligned>) == 16, "");
+
+static_assert(sizeof(std::tuple<S, OveralignedFinal>) == 16, "");
+static_assert(sizeof(std::tuple<S&, OveralignedFinal>) == 32, "");
+static_assert(sizeof(std::tuple<S&&, OveralignedFinal>) == 32, "");
+static_assert(sizeof(std::tuple<Final, OveralignedFinal>) == 32, "");
+static_assert(sizeof(std::tuple<NonEmpty, OveralignedFinal>) == 32, "");
+static_assert(sizeof(std::tuple<NonEmptyFinal, OveralignedFinal>) == 32, "");
+static_assert(sizeof(std::tuple<Overaligned, OveralignedFinal>) == 16, "");
+static_assert(sizeof(std::tuple<OveralignedFinal, OveralignedFinal>) == 32, "");

@philnik777 philnik777 merged commit 387860e into llvm:main Sep 4, 2025
62 of 79 checks passed
@Sharjeel-Khan
Copy link
Contributor

Sharjeel-Khan commented Sep 4, 2025

Three of the new tests are showing a size mismatch on Android ToT builds causing our builds to fail. They are off by 4.

******************** TEST 'llvm-libc++-shared.cfg.in :: libcxx/containers/associative/unord.map/abi.compile.pass.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
/b/f/w/src/git/out/stage2/./bin/clang++ /b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp -pthread --target=i386-unknown-linux-gnu -nostdinc++ -I /b/f/w/src/git/out/stage2/runtimes/runtimes-i386-unknown-linux-gnu-bins/libcxx/test-suite-install/include/i386-unknown-linux-gnu/c++/v1 -I /b/f/w/src/git/out/stage2/runtimes/runtimes-i386-unknown-linux-gnu-bins/libcxx/test-suite-install/include/c++/v1 -I /b/f/w/src/git/out/llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings  -fsyntax-only
# executed command: /b/f/w/src/git/out/stage2/./bin/clang++ /b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp -pthread --target=i386-unknown-linux-gnu -nostdinc++ -I /b/f/w/src/git/out/stage2/runtimes/runtimes-i386-unknown-linux-gnu-bins/libcxx/test-suite-install/include/i386-unknown-linux-gnu/c++/v1 -I /b/f/w/src/git/out/stage2/runtimes/runtimes-i386-unknown-linux-gnu-bins/libcxx/test-suite-install/include/c++/v1 -I /b/f/w/src/git/out/llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings -fsyntax-only
# .---command stderr------------
# | /[b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp:212](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp?l=212):15: error: static assertion failed due to requirement 'sizeof(std::unordered_map<int, int, FinalHash, FinalEqualTo, std::allocator<std::pair<const int, int>>>) == 24': 
# |   212 | static_assert(sizeof(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 24, "");
# |       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | /[b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp:212](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp?l=212):77: note: expression evaluates to '28 == 24'
# |   212 | static_assert(sizeof(std::unordered_map<int, int, FinalHash, FinalEqualTo>) == 24, "");
# |       |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# | /[b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp:213](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp?l=213):15: error: static assertion failed due to requirement 'sizeof(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo, std::allocator<std::pair<const int, int>>>) == 28': 
# |   213 | static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 28, "");
# |       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | /[b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp:213](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp?l=213):80: note: expression evaluates to '32 == 28'
# |   213 | static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, FinalEqualTo>) == 28, "");
# |       |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# | /[b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp:214](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp?l=214):15: error: static assertion failed due to requirement 'sizeof(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo, std::allocator<std::pair<const int, int>>>) == 32': 
# |   214 | static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 32, "");
# |       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | /[b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp:214](https://cs.corp.google.com/piper///depot/google3/b/f/w/src/git/out/llvm-project/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp?l=214):83: note: expression evaluates to '36 == 32'
# |   214 | static_assert(sizeof(std::unordered_map<int, int, NonEmptyHash, NonEmptyEqualTo>) == 32, "");
# |       |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# | 3 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

@frederick-vs-ja
Copy link
Contributor

Three of the new tests are showing a size mismatch on Android ToT builds causing our builds to fail. They are off by 4.

This seems happening for (almost?) all 32-bit platforms. Looks weird to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants