]> git.lizzy.rs Git - rust.git/blob - src/test/ui/complex.rs
Merge branch 'master' into rusty-hermit
[rust.git] / src / test / ui / complex.rs
1 // run-pass
2
3 #![allow(unconditional_recursion)]
4 #![allow(non_camel_case_types)]
5 #![allow(dead_code)]
6 #![allow(unused_mut)]
7
8
9
10 type t = isize;
11
12 fn nothing() { }
13
14 fn putstr(_s: String) { }
15
16 fn putint(_i: isize) {
17     let mut i: isize = 33;
18     while i < 36 { putstr("hi".to_string()); i = i + 1; }
19 }
20
21 fn zerg(i: isize) -> isize { return i; }
22
23 fn foo(x: isize) -> isize {
24     let mut y: t = x + 2;
25     putstr("hello".to_string());
26     while y < 10 { putint(y); if y * 3 == 4 { y = y + 2; nothing(); } }
27     let mut z: t;
28     z = 0x55;
29     foo(z);
30     return 0;
31 }
32
33 pub fn main() {
34     let x: isize = 2 + 2;
35     println!("{}", x);
36     println!("hello, world");
37     println!("{}", 10);
38 }