diff --git a/tools/qfcc/test/Makefile.am b/tools/qfcc/test/Makefile.am index dae61f2ab..4e213e66e 100644 --- a/tools/qfcc/test/Makefile.am +++ b/tools/qfcc/test/Makefile.am @@ -53,6 +53,7 @@ test_progs_dat=\ ivar-struct-return.dat \ methodparams.dat \ modulo.dat \ + nilparamret.dat \ paramret.dat \ quaternion.dat \ return-ivar.dat \ @@ -322,6 +323,15 @@ modulo.run: Makefile build-run include ./$(DEPDIR)/modulo.Qo # am--include-marker r_depfiles_remade += ./$(DEPDIR)/modulo.Qo +nilparamret_dat_SOURCES=nilparamret.r +nilparamret_obj=$(nilparamret_dat_SOURCES:.r=.qfo) +nilparamret.dat$(EXEEXT): $(nilparamret_obj) $(QFCC_DEP) + $(QFCC) $(QCFLAGS) -o $@ $(nilparamret_obj) +nilparamret.run: Makefile build-run + @$(srcdir)/build-run $@ +include ./$(DEPDIR)/nilparamret.Qo # am--include-marker +r_depfiles_remade += ./$(DEPDIR)/nilparamret.Qo + paramret_dat_SOURCES=paramret.r paramret_obj=$(paramret_dat_SOURCES:.r=.qfo) paramret.dat$(EXEEXT): $(paramret_obj) $(QFCC_DEP) diff --git a/tools/qfcc/test/nilparamret.r b/tools/qfcc/test/nilparamret.r new file mode 100644 index 000000000..fbe0b7dc5 --- /dev/null +++ b/tools/qfcc/test/nilparamret.r @@ -0,0 +1,26 @@ +typedef struct bar { + float x, y, z, w; +} bar; + +bar set_return(); + +@param foo() +{ + set_return(); + return nil; +} + +bar set_return() +{ + return {1, 2, 3, 4}; +} +void printf (string fmt, ...) = #0; +int main() +{ + @param r = foo(); + printf("%q\n", r); + return !(r.quaternion_val.x == 0 + && r.quaternion_val.y == 0 + && r.quaternion_val.z == 0 + && r.quaternion_val.w == 0); +}