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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug364.go] - Blame information for rev 858

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

Line No. Rev Author Line
1 700 jeremybenn
// $G $D/$F.go && $L $F.$A && ./$A.out
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
package main
8
 
9
import "fmt"
10
 
11
var s string
12
 
13
func accum(args ...interface{}) {
14
        s += fmt.Sprintln(args...)
15
}
16
 
17
func f(){
18
        v := 0.0
19
        for i := 0; i < 3; i++ {
20
                v += 0.1
21
                defer accum(v)
22
        }
23
}
24
 
25
func main() {
26
        f()
27
        if s != "0.30000000000000004\n0.2\n0.1\n" {
28
                println("BUG: defer")
29
                print(s)
30
        }
31
}

powered by: WebSVN 2.1.0

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