Skip to content

Commit 4abd141

Browse files
committed
Add coverage for which sizeof(T) is not equal to alignof(T)
1 parent 80e4a2d commit 4abd141

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libcxx/test/std/utilities/memory/ptr.align/is_sufficiently_aligned.pass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ struct alignas(32) S32 {};
6767
struct alignas(64) S64 {};
6868
struct alignas(128) S128 {};
6969

70+
struct alignas(1) X {
71+
unsigned char d[2];
72+
};
73+
static_assert(sizeof(X) == 2 * alignof(X));
74+
7075
bool tests() {
7176
char c;
7277
int i;
@@ -94,6 +99,9 @@ bool tests() {
9499
check(&s64);
95100
check(&s128);
96101

102+
X x;
103+
check(&x);
104+
97105
return true;
98106
}
99107

0 commit comments

Comments
 (0)