]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/complex.rs
auto merge of #9634 : blake2-ppc/rust/by-ref-iter, r=thestinger
[rust.git] / src / test / run-pass / complex.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11
12
13
14 // -*- rust -*-
15 type t = int;
16
17 fn nothing() { }
18
19 fn putstr(_s: ~str) { }
20
21 fn putint(_i: int) {
22     let mut i: int = 33;
23     while i < 36 { putstr(~"hi"); i = i + 1; }
24 }
25
26 fn zerg(i: int) -> int { return i; }
27
28 fn foo(x: int) -> int {
29     let mut y: t = x + 2;
30     putstr(~"hello");
31     while y < 10 { putint(y); if y * 3 == 4 { y = y + 2; nothing(); } }
32     let mut z: t;
33     z = 0x55;
34     foo(z);
35     return 0;
36 }
37
38 pub fn main() {
39     let x: int = 2 + 2;
40     info2!("{}", x);
41     info2!("hello, world");
42     info2!("{}", 10);
43 }