Add failing global init test too

This commit is contained in:
Bill Currie 2020-02-15 10:12:33 +09:00
parent 4caa875442
commit 3257e7145b
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
int a; int a;
double b; double b;
int c; int c = (int) &b;
double d; double d;
void printf (string fmt, ...) = #0; void printf (string fmt, ...) = #0;
@ -9,8 +9,12 @@ int main()
int di = (int) &d; int di = (int) &d;
int fail = 0; int fail = 0;
if (!c) {
printf ("global init address cast fail: %d\n", c);
fail |= 1;
}
if (!di) { if (!di) {
printf ("address cast fail: %d\n", di); printf ("local init address cast fail: %d\n", di);
fail |= 1; fail |= 1;
} }
return fail; return fail;