2011-06-24 18:23:11 -05:00
|
|
|
// xfail-stage0
|
|
|
|
|
2011-06-27 13:41:16 -05:00
|
|
|
use std;
|
|
|
|
import std::vec;
|
|
|
|
|
2011-06-24 18:23:11 -05:00
|
|
|
fn main()
|
|
|
|
{
|
|
|
|
// Make sure we properly handle repeated self-appends.
|
|
|
|
let vec[int] a = [0];
|
|
|
|
auto i = 20;
|
2011-06-27 13:41:16 -05:00
|
|
|
auto expected_len = 1u;
|
2011-06-24 18:23:11 -05:00
|
|
|
while (i > 0) {
|
2011-06-27 13:41:16 -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
|
|
|
}
|
|
|
|
}
|