mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
parent
b88ffc50d7
commit
3f90de47c1
4 changed files with 58 additions and 4 deletions
28
compiler/test/compilable/aligndefault.d
Normal file
28
compiler/test/compilable/aligndefault.d
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
struct S
|
||||
{
|
||||
align(1)
|
||||
{
|
||||
short x1;
|
||||
int y1;
|
||||
long z1;
|
||||
|
||||
align(default)
|
||||
{
|
||||
short x;
|
||||
int y;
|
||||
long z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fun()
|
||||
{
|
||||
static assert(S.x1.alignof == 1);
|
||||
static assert(S.y1.alignof == 1);
|
||||
static assert(S.z1.alignof == 1);
|
||||
|
||||
static assert(S.x.alignof == short.alignof);
|
||||
static assert(S.y.alignof == int.alignof);
|
||||
static assert(S.z.alignof == long.alignof);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue