mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
Add a test for struct writes.
This tests local kills via aliases.
This commit is contained in:
parent
0ff6e8a471
commit
3665a0566a
2 changed files with 28 additions and 0 deletions
|
@ -25,6 +25,7 @@ test_progs_dat=\
|
|||
deadbool.dat \
|
||||
infloop.dat \
|
||||
modulo.dat \
|
||||
structlive.dat \
|
||||
structptr.dat \
|
||||
vecinit.dat \
|
||||
while.dat
|
||||
|
@ -83,6 +84,13 @@ modulo.dat: $(modulo_obj) $(QFCC_DEP)
|
|||
modulo.run: Makefile build-run
|
||||
TEST_HARNESS_OPTS=--float $(srcdir)/build-run $@
|
||||
|
||||
structlive_dat_SOURCES=structlive.r
|
||||
structlive_obj=$(structlive_dat_SOURCES:.r=.qfo)
|
||||
structlive.dat: $(structlive_obj) $(QFCC_DEP)
|
||||
$(QFCC) $(QCFLAGS) -o $@ $(structlive_obj)
|
||||
structlive.run: Makefile build-run
|
||||
$(srcdir)/build-run $@
|
||||
|
||||
structptr_dat_SOURCES=structptr.r
|
||||
structptr_obj=$(structptr_dat_SOURCES:.r=.qfo)
|
||||
structptr.dat: $(structptr_obj) $(QFCC_DEP)
|
||||
|
|
20
tools/qfcc/test/structlive.r
Normal file
20
tools/qfcc/test/structlive.r
Normal file
|
@ -0,0 +1,20 @@
|
|||
@param foo (int r)
|
||||
{
|
||||
@param ret;
|
||||
ret = nil;
|
||||
ret.int_val = r;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
@param ret;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
ret = foo (i);
|
||||
if (ret.int_val != i)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue