aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/iter-range.rs
blob: ade7c51c6ab02b510147ad8ff0b2cf070940a09b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
iter range(int a, int b) -> int {
  check (a < b);

  let int i = a;
  while (i < b) {
    put i;
    i += 1;
  }
}

fn main() {
  let int sum = 0;
  for each (int x in range(0, 100)) {
    sum += x;
  }

  log sum;
}