mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +00:00
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:
parent
4bc40b3917
commit
70d18ecfa1
2 changed files with 26 additions and 0 deletions
tools/qfcc/test
|
@ -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)
|
||||
|
|
18
tools/qfcc/test/func-expr.r
Normal file
18
tools/qfcc/test/func-expr.r
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue