mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[qfcc] Add a failing test for struct init to param
This actually took a bit to reproduce.
This commit is contained in:
parent
f7757cf894
commit
faa6eabfbe
2 changed files with 40 additions and 0 deletions
|
@ -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)
|
||||
|
|
30
tools/qfcc/test/struct-init-param.r
Normal file
30
tools/qfcc/test/struct-init-param.r
Normal file
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue