2019-06-16 07:56:39 +00:00
|
|
|
#include "test-harness.h"
|
2018-10-13 14:32:53 +00:00
|
|
|
vector
|
|
|
|
t1()
|
|
|
|
{
|
|
|
|
return [1, 2, 3];
|
|
|
|
}
|
|
|
|
|
|
|
|
vector
|
|
|
|
t2(float x)
|
|
|
|
{
|
|
|
|
return [x, x, x];
|
|
|
|
}
|
|
|
|
|
|
|
|
vector
|
|
|
|
t3(float x)
|
|
|
|
{
|
2019-06-10 06:50:35 +00:00
|
|
|
return [x, t2(9).z, x] * 2;
|
2018-10-13 14:32:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
2019-06-16 07:56:39 +00:00
|
|
|
int ret = 0;
|
2019-06-18 01:38:19 +00:00
|
|
|
float x = 4;
|
|
|
|
float y = 5;
|
2019-06-16 07:56:39 +00:00
|
|
|
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;
|
|
|
|
}
|
2019-06-18 01:38:19 +00:00
|
|
|
v = [x, y, 0] / 2;
|
|
|
|
if (v != [2, 2.5, 0]) {
|
|
|
|
printf("v = %v\n", v);
|
|
|
|
ret |= 1;
|
|
|
|
}
|
|
|
|
|
2019-06-16 07:56:39 +00:00
|
|
|
return ret;
|
2018-10-13 14:32:53 +00:00
|
|
|
}
|