mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 15:30:50 +00:00
[qfcc] Add failing vector element address test
It's an evil thing to do, but it should at least work.
This commit is contained in:
parent
de01cff70e
commit
57b2751732
2 changed files with 26 additions and 0 deletions
|
@ -55,6 +55,7 @@ test_progs_dat=\
|
|||
structstruct.dat \
|
||||
swap.dat \
|
||||
triangle.dat \
|
||||
vecaddr.dat \
|
||||
vecexpr.dat \
|
||||
vecinit.dat \
|
||||
voidfor.dat \
|
||||
|
@ -373,6 +374,15 @@ r_depfiles_remade += ./$(DEPDIR)/triangle.Qo
|
|||
#include ./$(DEPDIR)/typedef.Qo # am--include-marker
|
||||
#r_depfiles_remade += ./$(DEPDIR)/typedef.Qo
|
||||
|
||||
vecaddr_dat_SOURCES=vecaddr.r
|
||||
vecaddr_obj=$(vecaddr_dat_SOURCES:.r=.qfo)
|
||||
vecaddr.dat$(EXEEXT): $(vecaddr_obj) $(QFCC_DEP)
|
||||
$(QFCC) $(QCFLAGS) -o $@ $(vecaddr_obj)
|
||||
vecaddr.run: Makefile build-run
|
||||
@$(srcdir)/build-run $@
|
||||
include ./$(DEPDIR)/vecaddr.Qo # am--include-marker
|
||||
r_depfiles_remade += ./$(DEPDIR)/vecaddr.Qo
|
||||
|
||||
vecexpr_dat_SOURCES=vecexpr.r
|
||||
vecexpr_obj=$(vecexpr_dat_SOURCES:.r=.qfo)
|
||||
vecexpr.dat$(EXEEXT): $(vecexpr_obj) $(QFCC_DEP)
|
||||
|
|
16
tools/qfcc/test/vecaddr.r
Normal file
16
tools/qfcc/test/vecaddr.r
Normal file
|
@ -0,0 +1,16 @@
|
|||
void printf (string fmt, ...) = #0;
|
||||
|
||||
float foo (vector v, float z)
|
||||
{
|
||||
return v * *(vector*)(&v.y);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, string *argv)
|
||||
{
|
||||
vector v = [1, 2, 3];
|
||||
vector w = [2, 3, 4];
|
||||
float f;
|
||||
printf ("%v %g %g %g\n", v, v*v, v*w, f=foo (v, 4));
|
||||
return f != v*w;
|
||||
}
|
Loading…
Reference in a new issue