2020-02-14 17:19:55 +00:00
|
|
|
int a;
|
|
|
|
double b;
|
|
|
|
int c;
|
|
|
|
double d;
|
2020-02-15 01:10:01 +00:00
|
|
|
void printf (string fmt, ...) = #0;
|
2020-02-14 17:19:55 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2020-02-15 01:10:01 +00:00
|
|
|
int fail = 0;
|
|
|
|
void *ap = &a;
|
|
|
|
void *bp = &b;
|
|
|
|
void *cp = &c;
|
|
|
|
void *dp = &d;
|
|
|
|
int aa = (int) ap;
|
|
|
|
int ba = (int) bp;
|
|
|
|
int ca = (int) cp;
|
|
|
|
int da = (int) dp;
|
|
|
|
|
|
|
|
if (ba & 1) {
|
|
|
|
printf ("double b is not aligned: %d\n", ba);
|
|
|
|
fail |= 1;
|
|
|
|
}
|
|
|
|
if (da & 1) {
|
|
|
|
printf ("double d is not aligned: %d\n", da);
|
|
|
|
fail |= 1;
|
|
|
|
}
|
|
|
|
if (ca - aa != 1) {
|
|
|
|
printf ("int c (%d) is not adjacant to int a (%d)\n", ca, aa);
|
|
|
|
fail |= 1;
|
|
|
|
}
|
|
|
|
if (ba <= ca) {
|
|
|
|
printf ("double b does not come after int c: %d %d\n", ba, ca);
|
|
|
|
fail |= 1;
|
|
|
|
}
|
|
|
|
return fail;
|
2020-02-14 17:19:55 +00:00
|
|
|
}
|