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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [undef.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 2010 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
// Check line numbers in error messages.
8
 
9
package main
10
 
11
var (
12
        _ = x   // ERROR "undefined.*x"
13
        _ = x   // ERROR "undefined.*x"
14
        _ = x   // ERROR "undefined.*x"
15
)
16
 
17
type T struct {
18
        y int
19
}
20
 
21
func foo() *T { return &T{y: 99} }
22
func bar() int { return y }     // ERROR "undefined.*y"
23
 
24
type T1 struct {
25
        y1 int
26
}
27
 
28
func foo1() *T1 { return &T1{y1: 99} }
29
var y1 = 2
30
func bar1() int { return y1 }
31
 
32
func f1(val interface{}) {
33
        switch v := val.(type) {
34
        default:
35
                println(v)
36
        }
37
}
38
 
39
func f2(val interface{}) {
40
        switch val.(type) {
41
        default:
42
                println(v)      // ERROR "undefined.*v"
43
        }
44
}

powered by: WebSVN 2.1.0

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