Commit Graph

427 Commits

Author SHA1 Message Date
Brian Anderson
99a697b56a Add support for upper-case hex and binary output to #fmt.
Only works for uints at present. Necessitated the addition of _str.to_upper.
2011-04-13 22:14:54 -04:00
Brian Anderson
4844e1c08a Add support for printing uints as lower-case hex to ExtFmt.
Begin passing an ExtFmt.RT.conv parsed format description to each of the
ExtFmt.RT.conv* functions.
2011-04-13 22:14:24 -04:00
Brian Anderson
44aed626bf Add ExtFmt test for unsigned type 2011-04-13 22:13:04 -04:00
Brian Anderson
330fdd2b04 Fix a typo in test expr-alt-generic-box1.rs 2011-04-13 21:46:20 -04:00
Graydon Hoare
eb33a5307b Remove gc() call from end of lib-map.rs, works on stage0 otherwise (stage0 produces no gc info) 2011-04-13 15:47:05 -07:00
Graydon Hoare
afeb3a417c Fix temporary-spilling logic in trans_args, uncomment most of lib-deque.rs (which now passes on stage0). 2011-04-13 15:21:54 -07:00
Graydon Hoare
0910a7323c Add generic-temporary.rs minimal test showing cause of lib-deque.rs failure on stage0. 2011-04-13 13:21:06 -07:00
Graydon Hoare
2c65e10a9f Fix lib-deque.rs to pass typarams by alias. 2011-04-13 12:29:34 -07:00
Graydon Hoare
80a4b1ba53 Slight updates to match API drift in io, lib-io.rs passes. 2011-04-13 12:05:15 -07:00
Graydon Hoare
5f6abdc0e8 Un-XFAIL generic-tag-corruption.rs. 2011-04-12 12:58:43 -07:00
Brian Anderson
bba245f3e6 Add support for bool, char to extfmt.
XFAIL syntax-extension-fmt in rustboot.
2011-04-11 21:54:03 -04:00
Graydon Hoare
d218df02bf Add new minimal testcase showing generic tag memory corruption. 2011-04-11 15:00:18 -07:00
Rafael Ávila de Espíndola
cca6335c26 Implement the "attempted dynamic environment-capture" error in rustc. 2011-04-11 15:35:01 -04:00
Brian Anderson
1f04c3dcef Un-XFAIL expr-block-fn.rs
It mysteriously works now.
2011-04-10 16:25:09 -04:00
Marijn Haverbeke
6109dba305 Disable effect checking in rustboot 2011-04-08 18:44:58 +02:00
Brian Anderson
0abccc6370 Add a test case for calling generic functions taking alias args with box types 2011-04-07 22:23:07 -04:00
Brian Anderson
a4f8de382a Add an XFAILed test for blocks that result in functions 2011-04-07 22:13:39 -04:00
Brian Anderson
d2d42fd4c7 Make block results work for generic types
I think just about every type can be used as a block result now. There's quite
a proliferation of tests here, but they all test slightly different things and
some are split out to remain XFAILed. The tests of generic vectors are still
XFAILed because generic aliased boxes still don't work in general.
2011-04-07 21:58:36 -04:00
Lindsey Kuper
21b31a350a Updated test to use 'check' rather than just logging results. 2011-04-07 15:22:34 -07:00
Lindsey Kuper
1092bbfff0 Support for self-calls that take arguments.
Nicer parsing of self-calls (expr_self_method nodes inside expr_call
nodes, rather than a separate expr_call_self) makes typechecking
tractable.  We can now write self-calls that take arguments and return
values (see: test/run-pass/obj-self-*.rs).
2011-04-07 14:26:34 -07:00
Patrick Walton
08bf4d1f19 "xfail-stage0", not "XFAIL-stage0" 2011-04-07 13:53:11 -07:00
Patrick Walton
3236e6008c XFAIL lib-option.rs in stage0 due to crash on Darwin on tinderbox 2011-04-07 13:44:20 -07:00
Patrick Walton
a97a200413 Fix effect on deref-lval 2011-04-07 13:30:50 -07:00
Patrick Walton
015c0d0d59 rustc: Allow dereference expressions to be used as lvalues. Add a test case. 2011-04-07 12:51:27 -07:00
Patrick Walton
cd6962f29d rustc: Link to external tag discriminants. Un-XFAIL test/run-pass/lib-option.rs. 2011-04-07 11:42:40 -07:00
Graydon Hoare
36d75d6391 Minimal testcase for next bootstrap blocker. 2011-04-06 08:33:24 -07:00
Graydon Hoare
52abd912c0 Brute force and ignorance workaround for tag-and-generic-obj; un-XFAIL it. 2011-04-05 21:08:13 -07:00
Graydon Hoare
8382990627 Add new minimal test for current blocker on bootstrapping. 2011-04-05 17:27:55 -07:00
Brian Anderson
1326d424c9 Add more tests for alt expressions 2011-04-02 20:35:51 -04:00
Brian Anderson
21fb49ad95 Join the results of alt arms so alt can be used as an expression.
Un-XFAIL expr-alt.rs.
2011-04-02 20:35:50 -04:00
Brian Anderson
1bc06bc59b Cleanup typos and newlines 2011-04-01 00:05:13 -04:00
Brian Anderson
efb738153c Add an XFAILed test for treating alts as expressions 2011-03-31 23:23:27 -04:00
Brian Anderson
dcf04ffbad Un-XFAIL expr-if-box.rs 2011-03-31 23:15:11 -04:00
Brian Anderson
cf16f4f7e5 Add a test for block expressions of generic types. XFAILed 2011-03-31 23:15:11 -04:00
Brian Anderson
c27b72e323 Add another test for blocks as expressions 2011-03-31 23:15:11 -04:00
Brian Anderson
19a949c15e Un-XFAIL expr-block-box.rs 2011-03-31 23:15:11 -04:00
Brian Anderson
bd1c61548e Move str test from expr-if.rs to expr-if-box.rs in preperation for breaking that code path. 2011-03-31 23:15:11 -04:00
Brian Anderson
2490cd3275 Add a test for block expressions that have results. XFAILed. 2011-03-31 23:15:11 -04:00
Graydon Hoare
b5a4336487 Re-XFAIL lib-int.rs and lib-uint.rs. 2011-03-29 23:10:28 -07:00
Graydon Hoare
61e5587eab Re-XFAIL lib-bitv.rs harder 2011-03-29 22:58:50 -07:00
Graydon Hoare
51807ad628 Re-XFAIL lib-bitv.rs 2011-03-29 22:08:35 -07:00
Patrick Walton
b09e09c673 rustc: Un-XFAIL lib-uint.rs 2011-03-29 18:16:53 -07:00
Patrick Walton
601cf8c97f rustc: Un-XFAIL lib-int.rs. 2011-03-29 17:31:48 -07:00
Patrick Walton
626bdaaa1f rustc: Parse parameter IDs in external crate metadata. Un-XFAIL lib-bitv.rs. 2011-03-29 17:25:55 -07:00
Lindsey Kuper
55fbed3d8d Beginnings of support for magical self prefix; nothing profound happening yet. 2011-03-29 15:59:15 -07:00
Brian Anderson
8f2a97a562 Add partial support for if expressions resulting in generic types 2011-03-28 21:14:08 -07:00
Brian Anderson
38d5453584 Add an XFAILed test for if expressions resulting in boxes 2011-03-28 21:14:06 -07:00
Brian Anderson
aced4ce145 Handle structural types as the result of if expressions 2011-03-28 21:14:04 -07:00
Brian Anderson
a5a319fa04 Teach rustc to use the result of if expressions 2011-03-28 21:14:03 -07:00
Graydon Hoare
268b2140dc Add long-while.rs to check on frame growth. 2011-03-28 18:07:29 -07:00
Graydon Hoare
540d29f641 Move all allocas to dedicated basic block at top of function, to keep frames finite. Un-comment next size in nbody.rs. 2011-03-28 18:07:29 -07:00
Patrick Walton
1cb3ce89dd shootout: Hoist out the movement too; switch square root to an LLVM intrinsic 2011-03-28 08:24:58 -07:00
Marijn Haverbeke
6ecdc04788 Add support for break and cont to rustc
Testing proper cleanup is hampered by
https://github.com/graydon/rust/issues/293
2011-03-27 14:11:23 +02:00
Patrick Walton
9c5affda1a shootout: Hoist out the vector indexing on nbody; don't rely on LICM, which isn't working for some reason (insufficient alias info?) Speeds up nbody a bit. 2011-03-26 23:10:28 -07:00
Lindsey Kuper
2650487120 Got the nbody demo working, and hopefully faster, too! 2011-03-26 17:51:54 -07:00
Lindsey Kuper
1c1c67229a Updates to the nbody demo. 2011-03-26 17:51:42 -07:00
Graydon Hoare
49d9d5688e Switch xfail system to use comments embedded in source files. 2011-03-25 12:19:20 -07:00
Tim Chevalier
a47cd50dfb Parse FP literals without coercing to int. This allows parsing 64-bit
floats. However, if someone writes a literal that can't be represented
precisely in 64 bits, the front-end will accept it while the back-end
will (presumably) complain.
2011-03-25 11:20:30 -07:00
Brian Anderson
ef1bcdea70 Add test for local declarations with receive. XFAIL in rustc. 2011-03-25 11:01:52 -07:00
Marijn Haverbeke
a045514477 Start making the standard-lib utf-8 aware
Finally implements _str.is_utf8, adds from_chars, from_char, to_chars,
char_at, char_len, (push|pop|shift|unshift)_char. Also, proper
character I/O for streams.
2011-03-25 08:22:52 -07:00
Lindsey Kuper
bcc104ce79 A first stab at the 'nbody' demo, with support for calling C sqrt(). 2011-03-25 00:15:56 -07:00
Lindsey Kuper
0b63512f4c Support for 'float' in type signatures. 2011-03-23 16:01:29 -07:00
Tim Chevalier
23e23bd762 Further support for floating-point. Literals with exponents work
and literals with the 'f32' or 'f64' suffixes work as well. In
addition, logging things with the f32 or f64 type works. (float is
still assumed to be a synonym for f64).
2011-03-22 17:31:27 -07:00
Patrick Walton
804771510e Add a test case for empty mutable vector literals, XFAIL'd in rustboot 2011-03-22 16:48:00 -07:00
Tim Chevalier
8556b2c1ad Added test case for floats 2011-03-22 09:42:31 -07:00
Brian Anderson
1689d99965 Add some nesting to the else-if test case 2011-03-22 08:11:38 -07:00
Brian Anderson
0bcf49305c Add test for sending strings over channels 2011-03-22 08:04:51 -07:00
Brian Anderson
3dcb79dac9 Add a regression test for channels of nil, which happens to work in rustc, but not in rustboot 2011-03-22 08:04:47 -07:00
Brian Anderson
c02cdc32a8 Generalize send/recv to work for more types 2011-03-22 08:04:45 -07:00
Patrick Walton
082e5a5e5d rustc: Fix inference for auto slots. Add a test case. 2011-03-18 17:43:56 -07:00
Patrick Walton
2ef9c01ffc rustc: Implement "mutable?". Add a test case and XFAIL it in rustboot for now. 2011-03-18 11:49:47 -07:00
Patrick Walton
ea7197e2cf rustc: Add str_from_cstr() and str_from_buf() functions to the standard library, as well as a test case 2011-03-16 18:42:08 -07:00
Graydon Hoare
54587bdccb Switch all vases of vec += elt to vec += vec. Prohibit former in rustboot. Tweak std lib vec fns in process. 2011-03-16 14:58:02 -07:00
Brian Anderson
c5721759bb Add fannkuchredux shootout benchmark 2011-03-14 15:52:48 -07:00
Brian Anderson
cba00ac2a1 Rename binary trees benchmark to match the original shootout source 2011-03-14 15:52:48 -07:00
Brian Anderson
467b9f3908 Implement the rest of the binary trees shootout benchmark 2011-03-14 15:52:48 -07:00
Brian Anderson
922f69387d Add _int.pow 2011-03-14 15:52:48 -07:00
Brian Anderson
595c4862ab Remove broken 99-bottles makefile and run script 2011-03-14 15:52:48 -07:00
Brian Anderson
8438eca45c Integrate shootout benchmarks into testsuite 2011-03-14 15:52:48 -07:00
Rafael Ávila de Espíndola
3436979b17 Split trans' collection in two passes. This allows us to handle tags
that are defined after use in a block.

This is really inefficient, but for now it lets us compile the included test.
2011-03-14 16:56:03 -04:00
Graydon Hoare
5f29988a2c Add failing test for tag-leaking case. 2011-03-10 14:15:02 -08:00
Graydon Hoare
8e8c336f93 Implement deep structural comparison through boxes and sequences. 2011-03-09 20:14:19 -08:00
Patrick Walton
ff15a93d95 rustc: Make test/run-pass/generic-tag-alt.rs valid Rust; it was passing a dynamically-sized value by value instead of by alias 2011-03-09 14:12:08 -08:00
Patrick Walton
603d820b85 rustc: Have demand_pat() extract type parameters from tags. Add a test case. 2011-03-09 14:09:02 -08:00
Patrick Walton
2986ed43e9 rustc: Substitute type parameters in type_of_variant(). Add a test case. 2011-03-09 13:31:25 -08:00
Patrick Walton
fcd195bb4c rustc: Don't try to load dynamically-sized types when translating tag variants. Add a test case for this. 2011-03-09 12:53:12 -08:00
Graydon Hoare
01bfc3ae8b Fix generic-bind support for bound aliases and generics. 2011-03-08 16:32:39 -08:00
Graydon Hoare
0d60918855 Most of the way through genericizing bind properly with new malloc path. Still getting the thunk call wrong. 2011-03-07 18:13:56 -08:00
Patrick Walton
3869b3bfe4 Modernize test/run-pass/generic-recursive-tag.rs. Un-XFAIL it in rustboot. 2011-03-07 15:12:41 -08:00
Graydon Hoare
abbcc0385d Poison ty_param values in trans; fix buggy parametric obj and box malloc paths. Add generic-box test. 2011-03-07 14:05:16 -08:00
Brian Anderson
bed457d3a7 Change io.fileflag to a tag type. Remove FIXME 2011-03-06 15:13:30 -08:00
Graydon Hoare
5c7db0cde1 Rewrite rustboot's flow-graph wiring passes to be less awful. Add test for nested control-flow constructs. 2011-03-03 15:19:26 -08:00
Brian Anderson
7350b7ff23 Add more #fmt tests 2011-03-02 10:28:14 -08:00
Brian Anderson
fe5de6bfff Parse parameter types for fmt extension 2011-03-02 10:28:14 -08:00
Brian Anderson
f1500e5872 Add fold, typecheck and trans for expr_ext 2011-03-02 10:28:14 -08:00
Brian Anderson
1c60399257 Begin work on #fmt parsing 2011-03-02 10:28:14 -08:00
Brian Anderson
9528c34774 Begin implementing #fmt in rustc 2011-03-02 10:28:14 -08:00
Patrick Walton
6c24d0403b Revert "rustc: Push type parameters down through alt tag patterns; add a test" due to valgrind failures
This reverts commit 7a1d01effc.
2011-02-25 15:49:35 -08:00
Patrick Walton
7a1d01effc rustc: Push type parameters down through alt tag patterns; add a test 2011-02-25 13:44:08 -08:00
Patrick Walton
dcd65fac19 Cast more aggressively to the callee type when calling generic functions. Add a test-case for this, and XFAIL it in rustboot. 2011-02-24 14:24:32 -08:00
Patrick Walton
5332250d3b Revert "Cast more aggressively to the callee type when calling generic functions. Add a test-case for this, and XFAIL it in rustboot." due to test failures
This reverts commit 0a65283c5e.
2011-02-24 13:51:18 -08:00
Patrick Walton
0a65283c5e Cast more aggressively to the callee type when calling generic functions. Add a test-case for this, and XFAIL it in rustboot. 2011-02-24 12:33:08 -08:00
Rafael Ávila de Espíndola
ffcb461370 Parse the abi in native modules. 2011-02-23 14:06:37 -05:00
Brian Anderson
eac75b7648 Teach rustc about reserved keywords 2011-02-22 21:52:23 -05:00
Brian Anderson
c4df39609c Rename std._io to std.io since 'io' is no longer a keyword 2011-02-22 21:52:23 -05:00
Brian Anderson
cbe8d222a8 Implement sha-1 in standard library. Closes #228 2011-02-21 01:00:43 -05:00
Patrick Walton
10befcd9a4 Add type parameters to tag types 2011-02-17 16:23:31 -08:00
Brian Anderson
0ebfb8227c Add support for unsigned binops. Closes #57 2011-02-14 08:31:52 -08:00
Graydon Hoare
277334890d Add alt-pattern-lit.rs test. 2011-02-10 19:13:39 -08:00
Brian Anderson
f17a3421e0 Cleanup for 'be' statement and comments about future typestate 2011-02-10 12:12:10 -08:00
Brian Anderson
6461cf30de Add compile-fail tests for tail calls 2011-02-10 12:12:10 -08:00
Graydon Hoare
b7dfbc9db0 Fix bug in test and un-XFAIL 4 tests now passing on rustc. 2011-02-09 13:19:20 -08:00
Rafael Avila de Espindola
ff6864aa5c Fix expressions with paths with more than one element. 2011-02-07 14:57:34 -05:00
Rafael Avila de Espindola
8122e0c542 Add support for
native mod foo = "bar" ...
2011-02-07 12:50:04 -05:00
Rafael Ávila de Espíndola
57bb9d809b Parse function declarations. 2011-02-04 11:10:04 -05:00
Rafael Ávila de Espíndola
dd3ed6139a Add most of the plumbing for native items and add support for parsing native type declarations. 2011-02-02 10:43:57 -05:00
Rafael Ávila de Espíndola
4b06dc574b Add very minimal support for native modules. For now they must be empty. 2011-02-01 16:57:33 -08:00
Brian Anderson
a2789363e1 Reenable xfailed tests for rustboot that pass with trivial or no modifications 2011-01-30 15:55:27 -05:00
Rafael Ávila de Espíndola
3cac20dae3 Correctly handle "import foo = bar.zed;". 2011-01-28 11:54:59 -05:00
Graydon Hoare
99106e4029 Fix bug in box-unbox.rs test. 2011-01-27 13:52:02 -08:00
Rafael Ávila de Espíndola
c170e7edfd Resolve type paths. 2011-01-27 16:39:31 -05:00
Rafael Ávila de Espíndola
21208f2343 Handle paths correctly. This lets us handle one more test :-) 2011-01-27 15:56:10 -05:00
Graydon Hoare
11da656402 Fix bug in generic-obj.rs testcase. 2011-01-26 11:39:48 -08:00
Rafael Ávila de Espíndola
70c129f79b Fix test now that we look at the full error-pattern. Also enable it for rustc. 2011-01-26 12:06:19 -05:00
Rafael Ávila de Espíndola
1b82060c5e Print an error if we try to refer to a module in an expr_path. 2011-01-25 18:16:52 -05:00
Rafael Ávila de Espíndola
9e2324ad1e Small first step in expr_path. Call find_final_def just to detect
unresolved names. find_final_def is going to be extended to return the
final expr.
2011-01-25 17:54:38 -05:00
Graydon Hoare
b361b1ee8c Un-XFAIL 7 tests that have begun working on rustc lately. Fix one bug in mlist.rs. 2011-01-21 15:56:42 -08:00
Graydon Hoare
9d3ebd6a57 Implement dynamic GEP enough to permit expr_field to work on tup(T,T,T). 2011-01-19 16:29:14 -08:00
Rafael Ávila de Espíndola
35d53b7eb1 Look at the type params of an item_ty when resolving. 2011-01-19 16:13:33 -05:00
Graydon Hoare
e8d266c614 Change generic-drop-glue.rs to be meaningful again, and un-XFAIL on rustc. 2011-01-18 17:20:13 -08:00
Graydon Hoare
156e1b363f Make legal and un-XFAIL generic-fn-infer.rs (on both compilers). 2011-01-17 16:03:38 -08:00
Rafael Ávila de Espíndola
9f3caed8a0 Enable more tests. 2011-01-17 18:13:55 -05:00
Rafael Ávila de Espíndola
58490d7fa0 Fix the last known (to me) bug in import resolution. We were not properly
dropping the inner part of the environment when an intermediate item resolved
in an outer scope.
2011-01-17 13:33:13 -08:00
Rafael Ávila de Espíndola
5b9eda4a41 Fix the import handling in "complex" cases. When looking a.b.c and 'a' is a
module, we should look for 'b' *just* in the module 'a' and then continue
resolving b.c in the environment created by updating *with* a.

Still not 100% correct, but getting there.
2011-01-14 17:34:00 -05:00
Rafael Ávila de Espíndola
3722326cd7 Add or enable some tests. 2011-01-13 18:52:06 -05:00
Rafael Ávila de Espíndola
c1f2e29596 Produce better errors for invalid imports. 2011-01-12 12:27:31 -08:00
Rafael Ávila de Espíndola
34643eeac8 Fix another import case we got wrong: The local environment should not
interfere with the import statements.
2011-01-11 13:59:52 -08:00
Rafael Ávila de Espíndola
c5a766f133 Fix two invalid import cases we were not detecting:
* If an import was unused we would never print any errors for it.
* We would keep the existing environment in scope when descending 'foo.bar'
  and would find 'bar' in the global environment if there was no 'bar' in
  'foo'.
2011-01-11 13:58:39 -08:00
Graydon Hoare
a8eeec1dbd Sketch support for reading multi-file crates in rustc. Add test, not yet working. 2011-01-10 18:18:16 -08:00
Graydon Hoare
e96414a6f0 Further corrections to the Makefile rules covering failing tests. 2011-01-10 14:53:20 -08:00
Brian Anderson
295c54e10f Remove the assumption that circular_buffer's buffer has a power of two size
It was not obvious how to make this implementation work when the unit size
was not also a power of two, so for now just make the buffer size a multiple
of the unit size so it can pass all the tests.
2011-01-10 11:31:33 -08:00
Brian Anderson
a077400d4c Remove unused variable in circular_buffer tests 2011-01-10 11:31:33 -08:00
Brian Anderson
6c6c9acd96 Rename test to reflect that the circular_buffer runtime class is what's being tested 2011-01-10 11:31:33 -08:00
Brian Anderson
97aa599b0d Fix circular_buffer growth when _next != 0 2011-01-10 11:31:33 -08:00
Brian Anderson
f1df1d1a51 Don't allow circular_buffer to shrink below its original size when unit_sz is not a power of two 2011-01-10 11:31:33 -08:00
Brian Anderson
5f05ae68e5 Don't allow circular_buffer to shrink below it's initial size 2011-01-10 11:31:32 -08:00
Brian Anderson
04056d89c8 Fix the check for growing the circular_buffer 2011-01-10 11:31:32 -08:00
Brian Anderson
32c1c9f55c Simplify the test for circular_buffer initialization 2011-01-10 11:31:32 -08:00
Rafael Ávila de Espíndola
2fb09eb585 Add sufficient import support to compile some simple single-crate programs.
This is likely not the final solution. It does repetitive work and doesn't produce
errors for invalid but unused imports. In any case, I think it is a useful step.
2011-01-07 15:17:18 -08:00
Brian Anderson
a9994a2963 Correctly initialize circular_buffer to a power-of-two bytes 2011-01-07 11:34:14 -08:00