summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.go-torture/execute/for-2.go
blob: af790edf80cc49429e4347ccd23745690fb2dc3f (plain)
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
package main

func f1() {
  j := 0;
  for i := 0; i < 10; i++ {
    if i > 2 {
      break;
    }
    j = i;
  }
  if (j != 2) {
    panic(0);
  }
}

func f2() {
  for i := 0; i < 10; i++ {
    if i >= 0 {
      continue;
    }
    panic(1);
  }
}

func f3() {
  lab1:
  for i := 0; i < 10; i++ {
    for j := 0; j < 10; j++ {
      if j > 2 {
        break lab1;
      }
    }
    panic(2);
  }
}

func f4() {
  lab1:
  for i := 0; i < 10; i++ {
    for j := 0; j < 10; j++ {
      continue lab1;
    }
    panic(3);
  }
}

func main() {
  f1();
  f2();
  f3();
  f4()
}