2011-08-12 02:09:20 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
|
|
|
// xfail-stage3
|
|
|
|
|
2011-06-27 13:41:16 -05:00
|
|
|
use std;
|
2011-08-15 18:38:23 -05:00
|
|
|
import std::vec;
|
2011-06-27 13:41:16 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() {
|
2011-06-24 18:23:11 -05:00
|
|
|
// Make sure we properly handle repeated self-appends.
|
2011-08-12 01:43:17 -05:00
|
|
|
let a: [int] = ~[0];
|
2011-07-27 07:19:39 -05:00
|
|
|
let i = 20;
|
|
|
|
let expected_len = 1u;
|
|
|
|
while i > 0 {
|
2011-08-15 18:38:23 -05:00
|
|
|
log_err vec::len(a);
|
|
|
|
assert (vec::len(a) == expected_len);
|
2011-06-24 18:23:11 -05:00
|
|
|
a += a;
|
|
|
|
i -= 1;
|
2011-06-27 13:41:16 -05:00
|
|
|
expected_len *= 2u;
|
2011-06-24 18:23:11 -05:00
|
|
|
}
|
2011-08-10 11:27:22 -05:00
|
|
|
}
|