quakeforge/tools/qfcc/test/vecaddr.r
Bill Currie 57b2751732 [qfcc] Add failing vector element address test
It's an evil thing to do, but it should at least work.
2020-03-04 00:37:10 +09:00

16 lines
268 B
R

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