Add a test for struct writes.

This tests local kills via aliases.
This commit is contained in:
Bill Currie 2012-12-13 13:44:25 +09:00
parent 0ff6e8a471
commit 3665a0566a
2 changed files with 28 additions and 0 deletions

View file

@ -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)

View 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;
}