llvm-project
6f9ac38b - [libc++][test] Cover byteswap _BitInt padding on every ABI with width 72 (#206360)

Commit
13 hours ago
[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@anthropic.com> Co-authored-by: A. Jiang <de34@live.cn>
Author
Parents
Loading