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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [runtime/] [symtab_test.go] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package runtime_test
6
 
7
import (
8
        "runtime"
9
        "strings"
10
        "testing"
11
)
12
 
13
var _ = runtime.Caller
14
var _ = strings.HasSuffix
15
type _ testing.T
16
 
17
/* runtime.Caller is not fully implemented for gccgo.
18
 
19
func TestCaller(t *testing.T) {
20
        procs := runtime.GOMAXPROCS(-1)
21
        c := make(chan bool, procs)
22
        for p := 0; p < procs; p++ {
23
                go func() {
24
                        for i := 0; i < 1000; i++ {
25
                                testCallerFoo(t)
26
                        }
27
                        c <- true
28
                }()
29
                defer func() {
30
                        <-c
31
                }()
32
        }
33
}
34
 
35
func testCallerFoo(t *testing.T) {
36
        testCallerBar(t)
37
}
38
 
39
func testCallerBar(t *testing.T) {
40
        for i := 0; i < 2; i++ {
41
                pc, file, line, ok := runtime.Caller(i)
42
                f := runtime.FuncForPC(pc)
43
                if !ok ||
44
                        !strings.HasSuffix(file, "symtab_test.go") ||
45
                        (i == 0 && !strings.HasSuffix(f.Name(), "testCallerBar")) ||
46
                        (i == 1 && !strings.HasSuffix(f.Name(), "testCallerFoo")) ||
47
                        line < 5 || line > 1000 ||
48
                        f.Entry() >= pc {
49
                        t.Errorf("incorrect symbol info %d: %t %d %d %s %s %d",
50
                                i, ok, f.Entry(), pc, f.Name(), file, line)
51
                }
52
        }
53
}
54
 
55
*/

powered by: WebSVN 2.1.0

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