mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Added further tests to #1219
This commit is contained in:
18
test/unit/regression/struct_alignment.c3
Normal file
18
test/unit/regression/struct_alignment.c3
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user