diff --git a/tools/qfcc/test/Makefile.am b/tools/qfcc/test/Makefile.am index 7ea8e5c21..99c24142c 100644 --- a/tools/qfcc/test/Makefile.am +++ b/tools/qfcc/test/Makefile.am @@ -50,6 +50,7 @@ test_progs_dat=\ return-ivar.dat \ sendv.dat \ state.dat \ + struct-init-param.dat \ struct-nil-init.dat \ structarray.dat \ structlive.dat \ @@ -322,6 +323,15 @@ state.run: Makefile build-run include ./$(DEPDIR)/state.Qo # am--include-marker r_depfiles_remade += ./$(DEPDIR)/state.Qo +struct_init_param_dat_SOURCES=struct-init-param.r +struct_init_param_obj=$(struct_init_param_dat_SOURCES:.r=.qfo) +struct-init-param.dat$(EXEEXT): $(struct_init_param_obj) $(QFCC_DEP) + $(QFCC) $(QCFLAGS) -o $@ $(struct_init_param_obj) +struct-init-param.run: Makefile build-run + @$(srcdir)/build-run $@ +include ./$(DEPDIR)/struct-init-param.Qo # am--include-marker +r_depfiles_remade += ./$(DEPDIR)/struct-init-param.Qo + struct_nil_init_dat_SOURCES=struct-nil-init.r struct_nil_init_obj=$(struct_nil_init_dat_SOURCES:.r=.qfo) struct-nil-init.dat$(EXEEXT): $(struct_nil_init_obj) $(QFCC_DEP) diff --git a/tools/qfcc/test/struct-init-param.r b/tools/qfcc/test/struct-init-param.r new file mode 100644 index 000000000..8b166099e --- /dev/null +++ b/tools/qfcc/test/struct-init-param.r @@ -0,0 +1,30 @@ +typedef struct { + int x; + int y; +} Point; + +typedef struct { + int width; + int height; +} Extent; + +typedef struct Rect_s { + Point offset; + Extent extent; +} Rect; + +void *foo (void *obj, void *cmd, void *o, Point pos, Rect r) +{ + return obj; +} + +void *bar (Rect *obj, void *cmd, void *o, Point pos) +{ + Rect rect = { {}, obj.extent }; + return foo (obj, cmd, o, pos, rect); +} + +int main (void) +{ + return 1;// don't want this to pass until I've checked the generated code +}