Add tests for double demotion

This commit is contained in:
Bill Currie 2020-02-15 17:00:14 +09:00
parent 4bf37b274b
commit 08ca59d0df
3 changed files with 22 additions and 0 deletions

View file

@ -61,6 +61,8 @@ test_progs_dat=\
fail_progs_dat=
test_build_errors=\
double-demote-int.r \
double-demote-float.r \
double-int-compare.r \
double-float-compare.r
@ -153,6 +155,12 @@ double.run: Makefile build-run
include ./$(DEPDIR)/double.Qo # am--include-marker
r_depfiles_remade += ./$(DEPDIR)/double.Qo
double-demote-int.run$(EXEEXT): double-demote-int.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<
double-demote-float.run$(EXEEXT): double-demote-float.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<
double-int-compare.run$(EXEEXT): double-int-compare.r Makefile build-compile-fail-run
$(srcdir)/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $<

View file

@ -0,0 +1,7 @@
double a;
float b;
int main ()
{
b = a;
return 1; // test fails if compile succeeds
}

View file

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