test: new codegen tests, rename hello.
This commit is contained in:
parent
53e934c2ab
commit
40f74341f3
8 changed files with 65 additions and 0 deletions
10
src/test/codegen/iterate-over-array.rs
Normal file
10
src/test/codegen/iterate-over-array.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#[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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue