mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
90 lines
1.7 KiB
C
90 lines
1.7 KiB
C
// #target: x64-darwin
|
|
module foo;
|
|
|
|
int[100] zfe;
|
|
struct Bob
|
|
{
|
|
Bob[] x;
|
|
char[100] y;
|
|
struct w {
|
|
int z;
|
|
}
|
|
}
|
|
|
|
union Ex
|
|
{
|
|
char[8] c;
|
|
int[2] y;
|
|
double z;
|
|
}
|
|
|
|
union Br
|
|
{
|
|
int y;
|
|
char x;
|
|
}
|
|
struct Ar
|
|
{
|
|
long z;
|
|
Br[10] br;
|
|
}
|
|
|
|
union Foob
|
|
{
|
|
long a;
|
|
char[8] c;
|
|
}
|
|
Ar izzy;
|
|
|
|
|
|
long x = $alignof(zfe);
|
|
short y = $alignof("Bob.y");
|
|
int z = $alignof("Bob.y");
|
|
int w = $alignof(Bob.y);
|
|
int v = $alignof(v);
|
|
int x1 = $alignof("Ex.c");
|
|
int x2 = $alignof(Ex.y);
|
|
int x3 = $alignof(char[8]);
|
|
int x4 = $alignof("Ar.br[1]");
|
|
int x5 = $alignof(Ar.br[1]);
|
|
int x6 = $alignof(Ar.br[1]);
|
|
int x7 = $alignof(Ar.br[1]);
|
|
int x8 = $alignof(Ar.br[2]);
|
|
int x9 = $alignof("izzy.br[1]");
|
|
int x10 = $alignof("izzy.br[1]");
|
|
int x11 = $alignof(izzy.br[1]);
|
|
int z0 = $alignof("Foob.c");
|
|
int z00 = $alignof("Foob.c[0]");
|
|
int z01 = $alignof("Foob.c[1]");
|
|
int z02 = $alignof("Foob.c[2]");
|
|
int z03 = $alignof("Foob.c[3]");
|
|
int z04 = $alignof("Foob.c[4]");
|
|
int z05 = $alignof("Foob.c[5]");
|
|
|
|
|
|
|
|
// #expect: foo.ll
|
|
|
|
@foo.x = global i64 16, align 8
|
|
@foo.y = global i16 8, align 2
|
|
@foo.z = global i32 8, align 4
|
|
@foo.w = global i32 8, align 4
|
|
@foo.v = global i32 4, align 4
|
|
@foo.x1 = global i32 8, align 4
|
|
@foo.x2 = global i32 8, align 4
|
|
@foo.x3 = global i32 1, align 4
|
|
@foo.x4 = global i32 4, align 4
|
|
@foo.x5 = global i32 4, align 4
|
|
@foo.x6 = global i32 4, align 4
|
|
@foo.x7 = global i32 4, align 4
|
|
@foo.x8 = global i32 8, align 4
|
|
@foo.x9 = global i32 4, align 4
|
|
@foo.x10 = global i32 4, align 4
|
|
@foo.x11 = global i32 4, align 4
|
|
@foo.z0 = global i32 8, align 4
|
|
@foo.z00 = global i32 8, align 4
|
|
@foo.z01 = global i32 1, align 4
|
|
@foo.z02 = global i32 2, align 4
|
|
@foo.z03 = global i32 1, align 4
|
|
@foo.z04 = global i32 4, align 4
|
|
@foo.z05 = global i32 1, align 4 |