Add a test for functions in binary expressions.

As expected, the binary_expr() cleanup broke multiple function calls in a
single expression.
This commit is contained in:
Bill Currie 2013-09-27 18:21:15 +09:00
parent 4bc40b3917
commit 70d18ecfa1
2 changed files with 26 additions and 0 deletions

View File

@ -21,6 +21,7 @@ QFCC_TEST_INCS=@QFCC_TEST_INCS@
test_progs_dat=\
chewed-alias.dat \
chewed-return.dat \
func-expr.dat \
func-static.dat \
deadbool.dat \
infloop.dat \
@ -61,6 +62,13 @@ chewed-return.dat: $(chewed_return_obj) $(QFCC_DEP)
chewed-return.run: Makefile build-run
TEST_HARNESS_OPTS=--float $(srcdir)/build-run $@
func_expr_dat_SOURCES=func-expr.r
func_expr_obj=$(func_expr_dat_SOURCES:.r=.qfo)
func-expr.dat: $(func_expr_obj) $(QFCC_DEP)
$(QFCC) $(QCFLAGS) -o $@ $(func_expr_obj)
func-expr.run: Makefile build-run
$(srcdir)/build-run $@
func_static_dat_SOURCES=func-static.r
func_static_obj=$(func_static_dat_SOURCES:.r=.qfo)
func-static.dat: $(func_static_obj) $(QFCC_DEP)

View File

@ -0,0 +1,18 @@
int foo (int i)
{
return i;
}
int func (int a, int b)
{
local int x;
x = foo (a) + foo (b);
return x;
};
int
main ()
{
return func (1,3) != 1 + 3;
}