OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [label1.go] - Blame information for rev 700

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// errchk $G -e $D/$F.go
2
 
3
// Copyright 2011 The Go Authors.  All rights reserved.
4
// Use of this source code is governed by a BSD-style
5
// license that can be found in the LICENSE file.
6
 
7
// Pass 2 label errors.
8
 
9
package main
10
 
11
var x int
12
 
13
func f() {
14
L1:
15
        for {
16
                if x == 0 {
17
                        break L1
18
                }
19
                if x == 1 {
20
                        continue L1
21
                }
22
                goto L1
23
        }
24
 
25
L2:
26
        select {
27
        default:
28
                if x == 0 {
29
                        break L2
30
                }
31
                if x == 1 {
32
                        continue L2 // ERROR "invalid continue label .*L2"
33
                }
34
                goto L2
35
        }
36
 
37
L3:
38
        switch {
39
        case x > 10:
40
                if x == 11 {
41
                        break L3
42
                }
43
                if x == 12 {
44
                        continue L3 // ERROR "invalid continue label .*L3"
45
                }
46
                goto L3
47
        }
48
 
49
L4:
50
        if true {
51
                if x == 13 {
52
                        break L4 // ERROR "invalid break label .*L4"
53
                }
54
                if x == 14 {
55
                        continue L4 // ERROR "invalid continue label .*L4"
56
                }
57
                if x == 15 {
58
                        goto L4
59
                }
60
        }
61
 
62
L5:
63
        f()
64
        if x == 16 {
65
                break L5 // ERROR "invalid break label .*L5"
66
        }
67
        if x == 17 {
68
                continue L5 // ERROR "invalid continue label .*L5"
69
        }
70
        if x == 18 {
71
                goto L5
72
        }
73
 
74
        for {
75
                if x == 19 {
76
                        break L1 // ERROR "invalid break label .*L1"
77
                }
78
                if x == 20 {
79
                        continue L1 // ERROR "invalid continue label .*L1"
80
                }
81
                if x == 21 {
82
                        goto L1
83
                }
84
        }
85
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.