Test array initializer double demotions

Turns out array inits are very strict about types (bug?).
This commit is contained in:
Bill Currie 2020-02-15 17:49:26 +09:00
parent 6ce99afa5b
commit 344d429134
3 changed files with 20 additions and 0 deletions

View file

@ -62,9 +62,11 @@ fail_progs_dat=
test_build_errors=\
double-demote-float.r \
double-demote-float-ainit.r \
double-demote-float-ginit.r \
double-demote-float-linit.r \
double-demote-int.r \
double-demote-int-ainit.r \
double-demote-int-ginit.r \
double-demote-int-linit.r \
double-int-compare.r \
@ -165,6 +167,12 @@ double-demote-int.run$(EXEEXT): double-demote-int.r Makefile build-compile-fail-
double-demote-float.run$(EXEEXT): double-demote-float.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<
double-demote-int-ainit.run$(EXEEXT): double-demote-int-ainit.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<
double-demote-float-ainit.run$(EXEEXT): double-demote-float-ainit.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<
double-demote-int-ginit.run$(EXEEXT): double-demote-int-ginit.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<

View file

@ -0,0 +1,6 @@
double a;
int b[] = {1.0d};
int main ()
{
return 1; // test fails if compile succeeds
}

View file

@ -0,0 +1,6 @@
double a;
int b[] = {1.0d};
int main ()
{
return 1; // test fails if compile succeeds
}