Commit graph

77 commits

Author SHA1 Message Date
Bill Currie
05fd2d8cdd Start work on a unit test for defspace. 2018-09-09 22:37:09 +09:00
Bill Currie
3a4667318c Fix the qfcc test autodependencies. 2018-09-09 22:36:20 +09:00
Bill Currie
b37b0180cb Actually do a test for triangle.r.
If the kahan triangle area method breaks, I did something wrong with qfcc's
handling of parentheses (ie, floating point math is not truly associative).
2018-08-23 20:52:32 +09:00
Bill Currie
1b9149ef31 Fix an argument passing error in test-harness.
It failed to pass the last argument to the ruamoko program being run.
2018-08-23 20:22:29 +09:00
Bill Currie
f250065003 Add tests for swapping vars and triangle area.
Triangle area was meant just to check Kahan's equation, but it found a
problem with swapping vars. swap.r currently fails.
2018-08-21 16:27:22 +09:00
Bill Currie
6c0f271783 Fix some more automake warnings. 2013-11-24 13:26:12 +09:00
Bill Currie
f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie
70d18ecfa1 Add a test for functions in binary expressions.
As expected, the binary_expr() cleanup broke multiple function calls in a
single expression.
2013-09-27 23:15:57 +09:00
Bill Currie
a6cdc8735a Start implementing vec = [x,y,z].
This is a nice feature found in fteqcc (also a bit of a challenge from
Spike). Getting bison to accept the new expression required rewriting the
state expression grammar, so this is mostly for the state expression. A
test to ensure the state expression doesn't break is included.
2013-09-27 23:15:56 +09:00
Bill Currie
88c765e210 Add a test for returning @param into an array. 2012-12-26 11:49:39 +09:00
Bill Currie
a95f679283 Add a test for compiling calls to obj_msg_sendv.
It seems dag_set_live_vars still served a purpose after all, but I don't
feel like bringing it as I'd rather implement its param handing in
dagnode_set_edges. I've now got a test case for it, though the test
currently causes the VM to segfault (even with pr_boundscheck 2!).
2012-12-22 14:05:12 +09:00
Bill Currie
175935ed8b Turn on bounds checking in the test harness.
Definitely want bounds checking for the tests.
2012-12-22 14:04:14 +09:00
Bill Currie
7701393bd4 Append a new sblock for return when necessary.
If the final block ends in a conditional statement, appending return to the
block will hide the conditional statement from the flow analyzer. This may
cause the conditional statement's destination node be become unreachable
according to the analyzer and thus eliminated. The label for the branch
then loses its target sblock and thus the code generator will produce a
zero-distance jump resulting in an infinite loop.

Thus, if the final block ends in a conditional statement (or, for
completeness, a call statement), append a new empty block before adding the
return statement.
2012-12-21 20:11:27 +09:00
Bill Currie
cb39cfc9ae Turn on the runaway loop detector for the test harness.
Definitely don't want any tests hanging.
2012-12-21 20:01:53 +09:00
Bill Currie
7b1850917d Force RETURN's operand to be live.
This seems to be the final fix to get return-ivar.r working.
2012-12-20 21:18:27 +09:00
Bill Currie
47c721b32e Clear the dstring in test-harness's printf builtin.
PR_Sprintf always appends to the result dstring. I'm not sure if this is by
design or a bug, so I'll leave it be for now.
2012-12-13 14:59:42 +09:00
Bill Currie
3665a0566a Add a test for struct writes.
This tests local kills via aliases.
2012-12-13 13:44:25 +09:00
Bill Currie
aeed16109f Add vecinit.r to the test-suite.
Ugh, I really need to take time out to do compile tests properly.
2012-12-10 21:09:53 +09:00
Bill Currie
f7bf05034f Remove func-static from XFAIL_TESTS.
I realized that's not the way it's meant to be used, and it /is/ I bug I
want fixed before release, so... :)
2012-12-04 13:27:39 +09:00
Bill Currie
1eb3349510 Add a test for function local static variables.
It turns out they're not getting allocated properly (they're put in the
function's locals defspace rather than near data), but fixing it proved a
little more problematic than expected, so the test is marked as XFAIL for
now to remind me to fix it.
2012-12-03 16:27:31 +09:00
Bill Currie
b0c08bf24b Build the tests with optimization.
Egad, the whole point of the tests was to make sure the optimizations work.
2012-12-01 16:40:37 +09:00
Bill Currie
5e9d7d3567 Don't use the expr type for assignments.
Instead, the type is taken from the source operand (this means the computed
type of .return for that var). ctf now builds :)
2012-11-30 21:06:08 +09:00
Bill Currie
026a992179 Add a test case for the alias chain mangling.
I think I need to rework the tests to better handle compile-only tests.
2012-11-27 18:33:41 +09:00
Bill Currie
215ff61216 Add a test for the dead boolean expression.
This tests the zombie label problem found via ctf.
2012-11-26 21:05:24 +09:00
Bill Currie
2478b053de Add a test for writes to global vars in a loop. 2012-11-24 14:53:45 +09:00
Bill Currie
bc26cd24c8 Make structptr.r a little quieter. 2012-11-22 21:59:01 +09:00
Bill Currie
64d9bbd230 Make the failure message clearer. 2012-11-22 21:59:01 +09:00
Bill Currie
b920a4dec9 Add a new test case.
It turns out that the optimizer completely breaks (a + b) % (a - b) with v6
code.
2012-11-22 21:59:01 +09:00
Bill Currie
47decd58d0 Support testing v6 progs.
v6 progs return float rather than int (they don't have int).
2012-11-22 21:59:01 +09:00
Bill Currie
538879b451 Get automatic dependencies working for the progs files.
Including dependencies on QFCC itself :)
2012-11-22 21:59:01 +09:00
Bill Currie
92d2b4107c Make the --developer and --trace options work. 2012-11-22 21:59:01 +09:00
Bill Currie
a5a7780a21 Fix make dist for qfcc's test. 2012-11-22 21:59:01 +09:00
Bill Currie
99b34232f8 Add a test harness for qfcc.
It's only the beginning, but finally make check is useful for qfcc :)
It even has a failing test :D
2012-11-22 21:59:01 +09:00
Bill Currie
95bd4ad410 Add a test for while (count--) 2012-11-22 21:59:00 +09:00
Bill Currie
49ca09a64f Clean up qfcc's test directory.
I don't remember what half these tests were for :/
2012-11-22 21:58:52 +09:00
Bill Currie
793112de9a Add some more tests.
structptr.r is actually usable for automated testing when I get around to
it.
2012-11-20 15:39:00 +09:00
Bill Currie
3897142038 Add a couple more tests to ptrderef.r 2012-11-18 13:28:46 +09:00
Bill Currie
f307c7bebc Rework the unary_expr grammar to allow ++*foo.
This required throwing out the primary rules that snax did up to help me
with conflicts many years ago, but they were now getting in the way. Now
the productions from primary are merged in with unary_expr.
2012-11-09 12:32:38 +09:00
Bill Currie
6ff2644ab5 Fix simple pointer dereferences.
It turns out no code was being generated for x = *y. Ouch. I suspect I need
to take a better look at expr_deref at some time in the not too distant
future.

Conflicts:
	tools/qfcc/source/statements.c
2012-11-09 12:32:35 +09:00
Bill Currie
48fe9f729d Add partial support for pointer arithmetic.
Only pointer +/- integral is supported. pointer - pointer will come later.
2012-11-09 12:21:45 +09:00
Bill Currie
23a38738fc Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie
d2da3b8246 Update old test for new syntax. 2012-05-04 11:04:58 +09:00
Bill Currie
43b5edf46b Implement jump threading.
First real optimization :)
2012-05-03 17:42:58 +09:00
Bill Currie
4fe7efbed8 Add a test for end of function conditional return.
divVerent was telling Spike about such a bug in fteqcc and I though I'd
better get in an explicit test for qfcc.
2012-04-30 20:27:24 +09:00
Bill Currie
e06ee34287 Allow quat * vec in ruamoko. 2012-04-26 12:00:27 +09:00
Bill Currie
e42c5a4272 More tests and fix vector/quaternion global dumps. 2011-08-11 14:58:13 +09:00
Bill Currie
a9eb793a5e Yay, even more tests :P 2011-03-22 15:00:46 +09:00
Bill Currie
1ada2a96cf Merge branch 'master' into qfcc-codegen
Conflicts:
	tools/qfcc/source/expr.c
	tools/qfcc/source/function.c
	tools/qwaq/test.r
2011-03-20 15:58:31 +09:00
Bill Currie
8d69c5c898 More tests 2011-03-09 20:34:23 +09:00
Bill Currie
7209c61912 Fix initializing local float variables with an integer constant.
Run the assignment expression through fold_constants to handle any
necessary conversions and error checking.
2011-03-05 17:23:58 +09:00