Added further tests to #1219

This commit is contained in:
Christoffer Lerno
2024-07-03 15:14:42 +02:00
parent 10ed03d6bf
commit 9a19eeacb3
2 changed files with 23 additions and 8 deletions

View File

@@ -0,0 +1,18 @@
module struct_alignment @test;
struct Test @align(16) { void* foo; }
struct Test2
{
Test test;
uint a;
}
fn void nested_struct()
{
Test2* array;
assert((uptr)&array[1] - (uptr)array == 32);
assert((uptr)&array[1] == Test2.sizeof);
assert(Test2.sizeof == 32);
assert(Test.sizeof == 16);
}