11 lines
154 B
Rust
11 lines
154 B
Rust
|
#[no_mangle]
|
||
|
fn test(x: &[int]) -> int {
|
||
|
let mut y = 0;
|
||
|
let mut i = 0;
|
||
|
while (i < x.len()) {
|
||
|
y += x[i];
|
||
|
i += 1;
|
||
|
}
|
||
|
y
|
||
|
}
|