aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/basic.rs
blob: 832eae2fd5d7240cf02cf84ec26e8f06977f0cd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-

fn a(chan[int] c) {
  if (true) {
    log "task a";
    log "task a";
    log "task a";
    log "task a";
    log "task a";
  }
  c <| 10;
}

fn k(int x) -> int {
  ret 15;
}

fn g(int x, str y) -> int {
  log x;
  log y;
  let int z = k(1);
  ret z;
}

fn main() {
    let int n = 2 + 3 * 7;
    let str s = "hello there";
    let port[int] p = port();
    spawn a(chan(p));
    spawn b(chan(p));
    let int x = 10;
    x = g(n,s);
    log x;
    n <- p;
    n <- p;
    // FIXME: use signal-channel for this.
    log "children finished, root finishing";
}

fn b(chan[int] c) {
  if (true) {
    log "task b";
    log "task b";
    log "task b";
    log "task b";
    log "task b";
    log "task b";
  }
  c <| 10;
}