mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-11 13:21:10 +00:00
b8df11b2cb
Deliberately defeating an optimiser is not so easy (but I really needed that variable to be set).
34 lines
493 B
R
34 lines
493 B
R
void printf (string fmt, ...) = #0;
|
|
|
|
#if __RUAMOKO__ > 1
|
|
#define dot @dot
|
|
#define X .y
|
|
#else
|
|
#define dot *
|
|
#define X
|
|
#endif
|
|
|
|
void forcelive (float z)
|
|
{
|
|
}
|
|
|
|
float foo (vector _v, float _z)
|
|
{
|
|
vector v = _v;
|
|
float z = _z;
|
|
_v = nil;
|
|
_z = 0;
|
|
forcelive (_z);
|
|
forcelive (z);
|
|
return (v dot *(vector*)(&v.y))X;
|
|
}
|
|
|
|
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 dot v, v dot w, f=foo (v, 4));
|
|
return f != (v dot w)X;
|
|
}
|