mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 08:27:39 +00:00
Add a test for accessing an array in a struct
That's accessed via a pointer. Whee. However, at this stage, the problem is really a promotion issue for short -> integer.
This commit is contained in:
parent
e46a44d9c6
commit
f70801fa52
2 changed files with 30 additions and 0 deletions
|
@ -43,6 +43,7 @@ test_progs_dat=\
|
||||||
return-ivar.dat \
|
return-ivar.dat \
|
||||||
sendv.dat \
|
sendv.dat \
|
||||||
state.dat \
|
state.dat \
|
||||||
|
structarray.dat \
|
||||||
structlive.dat \
|
structlive.dat \
|
||||||
structptr.dat \
|
structptr.dat \
|
||||||
swap.dat \
|
swap.dat \
|
||||||
|
@ -198,6 +199,15 @@ state.run: Makefile build-run
|
||||||
include ./$(DEPDIR)/state.Qo # am--include-marker
|
include ./$(DEPDIR)/state.Qo # am--include-marker
|
||||||
r_depfiles_remade += ./$(DEPDIR)/state.Qo
|
r_depfiles_remade += ./$(DEPDIR)/state.Qo
|
||||||
|
|
||||||
|
structarray_dat_SOURCES=structarray.r
|
||||||
|
structarray_obj=$(structarray_dat_SOURCES:.r=.qfo)
|
||||||
|
structarray.dat$(EXEEXT): $(structarray_obj) $(QFCC_DEP)
|
||||||
|
$(QFCC) $(QCFLAGS) -o $@ $(structarray_obj)
|
||||||
|
structarray.run: Makefile build-run
|
||||||
|
$(srcdir)/build-run $@
|
||||||
|
include ./$(DEPDIR)/structarray.Qo # am--include-marker
|
||||||
|
r_depfiles_remade += ./$(DEPDIR)/structarray.Qo
|
||||||
|
|
||||||
structlive_dat_SOURCES=structlive.r
|
structlive_dat_SOURCES=structlive.r
|
||||||
structlive_obj=$(structlive_dat_SOURCES:.r=.qfo)
|
structlive_obj=$(structlive_dat_SOURCES:.r=.qfo)
|
||||||
structlive.dat$(EXEEXT): $(structlive_obj) $(QFCC_DEP)
|
structlive.dat$(EXEEXT): $(structlive_obj) $(QFCC_DEP)
|
||||||
|
|
20
tools/qfcc/test/structarray.r
Normal file
20
tools/qfcc/test/structarray.r
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
void printf (string fmt, ...) = #0;
|
||||||
|
void *obj_malloc (int size) = #0;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int val;
|
||||||
|
int cap;
|
||||||
|
int ofs[];
|
||||||
|
} valstruct_t;
|
||||||
|
|
||||||
|
valstruct_t *vs;
|
||||||
|
int dst;
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
dst = vs.ofs[i];
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
Loading…
Reference in a new issue