Commit graph

219 commits

Author SHA1 Message Date
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
Bill Currie
fbea276ede Yet more tests. 2011-03-05 17:21:19 +09:00
Bill Currie
45c3dd67a8 Some test updates. 2011-03-04 08:27:26 +09:00
Bill Currie
fd24524e13 More tests.
I really need to sort out some test automation.
2011-03-03 22:32:22 +09:00
Bill Currie
87b240f469 Use special treatment for .float ()foo; functions.
The parser wants to treat .float () foo; as a function returning a float
field, but qcc treats it as a field holding a function variable.
Fortuantely, field types are always "simple" (ie, at worst, just more
field type wrappers around the non-field type), so all that's needed to
obtain qcc grammar is to reach into the field type layers and do the
function type calculation based on the non-field type found there.
2011-02-22 08:54:01 +09:00
Bill Currie
62456dc1e9 Yet another test. 2011-02-15 09:48:10 +09:00
Bill Currie
b3d5789377 More tests. 2011-02-14 23:10:46 +09:00
Bill Currie
e3325b199e More tests. 2011-02-14 23:10:45 +09:00
Bill Currie
ef32d1fb6d Save away some of my tests. 2011-02-13 19:02:39 +09:00
Bill Currie
71c05bd899 Update for the new syntax.
This one compiles to progs even :) (though it looks broken).
2011-02-08 22:39:42 +09:00
Bill Currie
b76a5c5284 Add my QuakePascal test program.
Trivial as it is...
2011-01-17 22:44:58 +09:00
Bill Currie
c4d19e6ebc Get __PRETTY_FUNCTION__ working for overloaded functions. 2011-01-13 16:22:27 +09:00
Bill Currie
a27ea057c4 Add a test for calling class methods. 2011-01-03 18:11:46 +09:00
Bill Currie
b90833d86f v6 modulo test 2010-12-19 11:19:23 +09:00
Bill Currie
4481ba9b0d Allow explicit references to classes and categories.
Use "@reference ClassName;" or "@reference ClassName(CategoryName);" to
create a refence to the class or category, forcing the defining object file
to be linked into the program when the object file is part of a library.
2010-12-12 20:27:56 +09:00
Bill Currie
2c84ae4898 Don't let casting in constfold increment users.
This fixes Deek's temp notice. No new notices have shown up, so this should
be the correct fix. The constant folding code no longer calls cast_expr
directly, but rather uses an internal wrapper that decrements users after
cast_expr increments it, resulting in a no-op.
2010-12-12 15:37:26 +09:00
Bill Currie
e28ee0378f Gracefully handle returning NIL though a bad type. 2010-11-24 17:01:18 +09:00
Bill Currie
67beaf4487 Nil is a constant, so allow it in global initializers. 2010-11-24 17:01:18 +09:00
Bill Currie
17d84613a9 found a test file lurking around 2010-08-05 02:36:51 +00:00
Bill Currie
997102fea8 audit the usage of "only"
There are still a few iffy places (notably around certain prepositions), but
the relevant sentences are now much easier to read.
2010-01-13 06:42:26 +00:00
Bill Currie
e8e2d3a6e5 make "local" optional 2007-04-28 05:20:47 +00:00
Bill Currie
cfd71b87c4 clean up some warnings that I think I wasn't testing for 2007-04-28 05:17:55 +00:00
Bill Currie
cbcd2030cf add a few more tests to break 2007-04-07 05:02:09 +00:00
Bill Currie
25bf40a71a finish the break overloading and add some more tests (really need to get these automated) 2007-04-07 04:58:27 +00:00
Bill Currie
0c974c0530 more tests 2005-06-14 11:29:42 +00:00
Bill Currie
201252c1c0 FIXME cleanup and a missed win32 compile fix
This is an imperfect revision of history.
2004-11-06 02:21:00 +00:00
Bill Currie
8220d6d3c9 for loop tests 2004-03-30 02:31:50 +00:00
Bill Currie
afdbd90bc1 some tests I've accumulated over time. don't want to lose them accidently
:)
2004-02-11 02:23:40 +00:00