mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
bf53edf5e3
Vector expressions no longer auto-widen due to the new vector types (I might add such later, but for now this lets the tests try to build (minus actual fixes in qfcc)).
49 lines
524 B
R
49 lines
524 B
R
#include "test-harness.h"
|
|
|
|
vector t1();
|
|
vector t2(float x);
|
|
|
|
vector
|
|
t3(float x)
|
|
{
|
|
return [x, t2(9).z, x] * 2;
|
|
}
|
|
|
|
vector
|
|
t1()
|
|
{
|
|
return [1, 2, 3];
|
|
}
|
|
|
|
vector
|
|
t2(float x)
|
|
{
|
|
return [x, x, x];
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int ret = 0;
|
|
float x = 4;
|
|
float y = 5;
|
|
vector v;
|
|
|
|
v = t2(5);
|
|
if (v != [5, 5, 5]) {
|
|
printf("t2(5) = %v\n", v);
|
|
ret |= 1;
|
|
}
|
|
v = t3 (5);
|
|
if (v != [10, 18, 10]) {
|
|
printf("t3(5) = %v\n", v);
|
|
ret |= 1;
|
|
}
|
|
v = [x, y, 0] / 2;
|
|
if (v != [2, 2.5, 0]) {
|
|
printf("v = %v\n", v);
|
|
ret |= 1;
|
|
}
|
|
|
|
return ret;
|
|
}
|