Commit graph

79 commits

Author SHA1 Message Date
Tim Chevalier
d9bc3cb10c Change "pred" to "pure fn" in all libraries and test cases 2011-08-25 18:24:45 -07:00
Eric Holk
2f7c583bc1 Cleaning up task and comm exports, updating all the test cases. 2011-08-25 11:21:25 -07:00
Brian Anderson
518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00
Brian Anderson
664b0ad3fc Add some tests for expression corner cases, mostly involving ret and fail
Some of these don't actually work.
2011-08-19 10:16:38 -07:00
Eric Holk
3ab21e5ee0 Better type inference for chans and ports. 2011-08-17 17:16:23 -07:00
Eric Holk
94260fb91d Using move-mode for spawn thunks to avoid race conditions. 2011-08-17 11:44:50 -07:00
Erick Tryzelaar
b3eba15271 Port the tests to the expr foo::<T> syntax. 2011-08-16 15:05:57 -07:00
Erick Tryzelaar
3520499544 Port the tests to the decl foo<T> syntax. 2011-08-16 15:05:56 -07:00
Erick Tryzelaar
21f46a1655 Port the tests to the typaram foo<T> syntax. 2011-08-16 15:05:56 -07:00
Eric Holk
cf2def46c1 Removed trans_comm.rs from the compiler. Updating aio/sio to work with the new chan and port system, started on a networking module for the standard library. 2011-08-16 09:36:29 -07:00
Lindsey Kuper
f91351aaf6 The wonky for...in... whitespace was bothering me. Sorry! 2011-08-15 22:19:50 -07:00
Eric Holk
be7325073a Removed spawn and task from the parser. Updated all the tests except for the benchmarks. 2011-08-15 09:26:52 -07:00
Tim Chevalier
c01e487485 Un-XFAIL do-while-body-fails
Made it work both with optimization enabled, and with optimization
disabled. Huzzah!
2011-08-12 16:26:10 -07:00
Brian Anderson
ee7d03f7d7 Convert most working tests to ivecs
I tried to pay attention to what was actually being tested so, e.g. when I
test was just using a vec as a boxed thing, I converted to boxed ints, etc.

Haven't converted the macro tests yet. Not sure what to do there.
2011-08-12 16:13:13 -07:00
Brian Anderson
5e840182e6 XFAIL do-while-body-fails
Doesn't work w/out optimizations
2011-08-11 18:05:39 -07:00
Tim Chevalier
051b401051 Handle _|_ - typed things in the bodies of do-while loops
The resulting code is strange, but perhaps someone else can
fix it. The obvious things, like returning body_res, all resulted
in completely incomprehensible LLVM errors.

Closes #814
2011-08-11 17:23:47 -07:00
Tim Chevalier
a8a4d4ec05 Use actual type, not declared type, when zeroing move arguments
trans was failing with a bounds check error because the caller
was using the declared type (an out-of-scope ty param) and not
the actual type in a list of argument types to zero.

Closes #811
2011-08-10 17:22:57 -07:00
Brian Anderson
40ae704ff2 Begin valgrinding run-fail tests
Introduce a temporary no-valgrind directive for the few that aren't clean
2011-08-10 13:36:57 -07:00
Tim Chevalier
001df3f0ca Revert "Revert "Handle conditionals on _|_ - typed values correctly""
This reverts commit ea81c03960.

Changed the case in trans_if where the conditional is _|_ - typed
but the block is terminated to return the result of the cond,
instead of nil.

This passes "make check" with optimization disabled as well as
enabled.
2011-08-03 13:07:41 -07:00
Brian Anderson
c53402846e Remove all xfail-stage0 directives
While it is still technically possible to test stage 0, it is not part of any
of the main testing rules and maintaining xfail-stage0 is a chore. Nobody
should worry about how tests fare in stage0.
2011-08-03 10:55:59 -07:00
Brian Anderson
63600828cd Un-xfail more pretty-printing tests 2011-08-03 10:55:59 -07:00
Brian Anderson
ea81c03960 Revert "Handle conditionals on _|_ - typed values correctly"
This reverts commit 13f8b3f2a6.

run-pass/if-ret.rs does not translate correctly when unoptimized. Issue #797
2011-08-03 10:48:52 -07:00
Tim Chevalier
948f8090ae Handle _|_ - typed discriminants in alts correctly
Stop me, won't you, if you've heard this one before?

Closes #794
2011-08-02 19:02:38 -07:00
Tim Chevalier
13f8b3f2a6 Handle conditionals on _|_ - typed values correctly
Closes #776
2011-08-02 18:34:44 -07:00
Brian Anderson
2911156820 Pretty-print fn constraints more correctish 2011-08-02 17:49:11 -07:00
Brian Anderson
25b16ba9a2 Un-xfail run-fail/fn-constraint-claim
Seems to work
2011-08-02 17:49:11 -07:00
Tim Chevalier
731797d075 In trans, don't assume both sides of a binop have the same type
This was at least partially responsible for Issue 777.

    The only solution I can think of is for trans to just not generate
    code for a comparison if one or both sides has type _|_. Since
    that means evaluating that subexpression diverges, it should be ok
    to never do the comparison. Actually generating code for the
    comparison would trip an LLVM assertion failure.
2011-08-02 17:36:41 -07:00
Brian Anderson
e13390a199 Pretty-print test the rfail tests. Issue #789 2011-08-02 10:39:13 -07:00
Marijn Haverbeke
6e2a7bff7f Fix damage done by the pretty-printer 2011-07-27 15:54:33 +02:00
Marijn Haverbeke
df7f21db09 Reformat for new syntax 2011-07-27 15:54:33 +02:00
Brian Anderson
07732545d2 Add xfail-stage3 directives to tests
The new test runners run stage 3
2011-07-22 10:18:28 -07:00
Graydon Hoare
39151f2ad8 Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases. 2011-07-13 15:44:09 -07:00
Tim Chevalier
1870e97559 Visit the type argument in a port expression
This closes #664.
2011-07-11 18:12:00 -07:00
Tim Chevalier
a793b85fbd Handle fail inside a for-each loop properly 2011-07-05 16:05:38 -07:00
Tim Chevalier
b110bbf886 Un-XFAIL fail-arg 2011-07-03 11:56:23 -07:00
Tim Chevalier
046c25dbc0 Handle fail as an argument; parse fail expressions unambiguously
An expression like:

foo(1, fail, 2)

was failing to parse, because the parser was interpreting the comma
as the start of an expression that was an argument to fail, rather
than recognizing that the fail here has no arguments

Fixed this by using can_begin_expr to determine whether the next
token after a fail token suggests that this is a nullary fail or a
unary fail.

In addition, when translating calls, check before translating each
argument that the block still isn't terminated. This has the effect
that if an argument list includes fail, the back-end won't keep trying
to generate code for successive arguments and trip the !*terminated
assertion.
2011-07-03 11:51:47 -07:00
Tim Chevalier
c425a422ed Manipulate contexts correctly in trans_fail_expr
This fixes Issue #617
2011-07-03 02:38:11 -07:00
Tim Chevalier
9349826909 XFAILing the new test case...
...because the parsing of fail got changed out from under me.
Will fix shortly.
2011-07-03 01:15:41 -07:00
Tim Chevalier
7426252549 Generate code properly for calls with _|_ - typed arguments
The code for translating a fail (for example) would call
Unreachable(), which terminates the block; if a fail appeared as an
argument, this would cause an LLVM assertion failure. Changed
trans_call to handle this situation correctly.
2011-07-02 22:02:59 -07:00
Josh Matthews
d485e0d15a Allow any string expression to be used with fail. 2011-07-02 00:06:58 -07:00
Tim Chevalier
1ba85932b1 Add a runtime flag to enable/disable claims en masse
Now, if the environment variable CHECK_CLAIMS is set, then all
claims turn into checks. Otherwise, claims are no-ops.
2011-06-29 14:28:02 -07:00
Tim Chevalier
9f1444c701 Implement "claim"
Implement "claim" (issue #14), which is a version of "check" that
doesn't really do the check at runtime. It's an unsafe feature.

The new flag --check-claims turns claims into checks automatically --
but it's off by default, so by default, the assertion in a claim
doesn't execute at runtime.
2011-06-28 16:41:06 -07:00
Marijn Haverbeke
781a265b88 Remove variable name 'res' from test suite 2011-06-25 21:15:04 +02:00
Brian Anderson
cc2a514cdc test: Enable more tests 2011-06-22 08:35:02 -07:00
Tim Chevalier
7fb35ecf84 Serialize constraints in types (literal arguments still not supported)
This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.

It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
2011-06-21 14:37:33 -07:00
Brian Anderson
2a69db5b76 test: Fix mismatched types in prep for typechecker fixes
Issue #500
2011-06-17 11:35:00 -07:00
Tim Chevalier
219924e669 Bring back if-check
Add "if check" (expr_if_check), a variation on check that executes
an "else" clause rather than failing if the check doesn't hold.
2011-06-16 12:13:20 -07:00
Graydon Hoare
ce72993488 Reformat source tree (minus a couple tests that are still grumpy). 2011-06-15 11:19:50 -07:00
Tim Chevalier
1cc7165e62 Un-xfail test/run-fail/pred.rs 2011-06-14 14:17:28 -07:00
Tim Chevalier
206429e075 Un-xfail working test cases 2011-06-14 13:58:10 -07:00