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