[all-commits] [llvm/llvm-project] 6f9ac3: [libc++][test] Cover byteswap _BitInt padding on e...
Xavier Roche via All-commits
all-commits at lists.llvm.org
Thu Jul 2 02:10:01 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6f9ac38b7c1934fbce49683e32c732c73e5e1ab4
https://github.com/llvm/llvm-project/commit/6f9ac38b7c1934fbce49683e32c732c73e5e1ab4
Author: Xavier Roche <roche at httrack.com>
Date: 2026-07-02 (Thu, 02 Jul 2026)
Changed paths:
M libcxx/test/std/numerics/bit/byteswap.verify.cpp
Log Message:
-----------
[libc++][test] Cover byteswap _BitInt padding on every ABI with width 72 (#206360)
`std::byteswap` is required to reject integer types that have padding
bits, and one test case checks that it does. The case used `unsigned
_BitInt(96)`, but #205295 had to skip it on 32-bit x86. On the i386
System V ABI, `_BitInt(96)` is exactly 12 bytes with no padding, so
`std::byteswap` accepts it and the expected error never fires. The skip
used `!defined(__i386__)`, a target name that stands in for an object
layout the preprocessor cannot see.
This change uses `unsigned _BitInt(72)` instead. Its 9 value bytes round
up to 12 bytes on 32-bit x86 and 16 bytes everywhere else, so the type
always has padding and `std::byteswap` always rejects it. The case now
runs on every target, 32-bit x86 included, with no target guard.
Follows up on #205295.
Assisted-by: Claude (Anthropic)
---------
Co-authored-by: Claude Opus 4.6 <noreply at anthropic.com>
Co-authored-by: A. Jiang <de34 at live.cn>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list