diff --git a/tools/qfcc/test/Makefile.am b/tools/qfcc/test/Makefile.am index eee7ba5be..1ca89205a 100644 --- a/tools/qfcc/test/Makefile.am +++ b/tools/qfcc/test/Makefile.am @@ -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) diff --git a/tools/qfcc/test/func-expr.r b/tools/qfcc/test/func-expr.r new file mode 100644 index 000000000..a6b43ca4b --- /dev/null +++ b/tools/qfcc/test/func-expr.r @@ -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; +}