mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
18 lines
311 B
Plaintext
18 lines
311 B
Plaintext
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] - (uptr)array == Test2.sizeof);
|
|
assert(Test2.sizeof == 32);
|
|
assert(Test.sizeof == 16);
|
|
} |