[libcxx-commits] [libcxx] [libc++][test] Cover byteswap _BitInt padding on every ABI with width 72 (PR #206360)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 1 05:25:43 PDT 2026


================
@@ -103,23 +103,21 @@ void test_unsigned_56() {
 
 // Same dispatch-availability guard as test_unsigned_65 above.
 #  if TEST_HAS_BUILTIN(__builtin_bswapg) || !defined(TEST_HAS_NO_INT128)
-#    if __BITINT_MAXWIDTH__ >= 80
-void test_unsigned_80() {
-  // sizeof(_BitInt(80)) == 16 on x86_64; 48 padding bits. Width 80 is also
-  // a multiple of 16, so bswapg would accept it without the static_assert.
-  unsigned _BitInt(80) v = 0;
+// 72 value bits leave padding on every ABI, unlike _BitInt(96), which is
+// exactly 12 bytes with no padding on 32-bit x86 (#205295).
----------------
frederick-vs-ja wrote:

Mostly LGTM. If we don't test `_BitInt(96)`, we can just avoid mentioning it in comments.
```suggestion
// 72 value bits leave padding on every ABI.
```

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


More information about the libcxx-commits mailing list