mirror of https://github.com/golang/go.git
- added 2 bugs
- moved bug 060 back into bugs R=r OCL=15175 CL=15175
This commit is contained in:
parent
d6f15be61d
commit
94979c3177
|
|
@ -0,0 +1,31 @@
|
||||||
|
// $G $D/$F.go || echo BUG: fails incorrectly
|
||||||
|
|
||||||
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
func f0() {
|
||||||
|
const x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func f1() {
|
||||||
|
x := 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
f0();
|
||||||
|
f1();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
uetli:~/Source/go1/test/bugs gri$ 6g bug094.go && 6l bug094.6 && 6.out
|
||||||
|
bug094.go:11: left side of := must be a name
|
||||||
|
bad top
|
||||||
|
. LITERAL-I0 l(343)
|
||||||
|
bug094.go:11: fatal error: walktype: top=3 LITERAL
|
||||||
|
uetli:~/Source/go1/test/bugs gri$
|
||||||
|
*/
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var x int = 1;
|
||||||
|
if x != 1 { panic("found ", x, ", expected 1\n"); }
|
||||||
|
{
|
||||||
|
var x int = x + 1; // scope of x starts too late
|
||||||
|
if x != 1 { panic("found ", x, ", expected 1\n"); }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
x := x + 1; // scope of x starts too late
|
||||||
|
if x != 1 { panic("found ", x, ", expected 1\n"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
uetli:~/Source/go1/test/bugs gri$ 6g bug095.go && 6l bug095.6 && 6.out
|
||||||
|
found 2, expected 1
|
||||||
|
|
||||||
|
panic on line 342 PC=0x139e
|
||||||
|
0x139e?zi
|
||||||
|
main·main(1, 0, 1606416416, ...)
|
||||||
|
main·main(0x1, 0x7fff5fbff820, 0x0, ...)
|
||||||
|
Trace/BPT trap
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Example: If I write
|
||||||
|
|
||||||
|
type Tree struct {
|
||||||
|
left, right *Tree
|
||||||
|
}
|
||||||
|
|
||||||
|
I expect the correct *Tree to picked up; i.e. the scope of the identifier
|
||||||
|
Tree starts immediately after the name is declared. There is no reason why
|
||||||
|
this should be different for vars.
|
||||||
|
*/
|
||||||
|
|
@ -68,6 +68,8 @@ BUG: compilation succeeds incorrectly
|
||||||
=========== bugs/bug041.go
|
=========== bugs/bug041.go
|
||||||
BUG: compilation succeeds incorrectly
|
BUG: compilation succeeds incorrectly
|
||||||
|
|
||||||
|
=========== bugs/bug060.go
|
||||||
|
map does not increment
|
||||||
=========== bugs/bug064.go
|
=========== bugs/bug064.go
|
||||||
bugs/bug064.go:15: illegal types for operand: CALL
|
bugs/bug064.go:15: illegal types for operand: CALL
|
||||||
(<int32>INT32)
|
(<int32>INT32)
|
||||||
|
|
@ -103,10 +105,6 @@ BUG: succeeds incorrectly
|
||||||
bugs/bug085.go:8: P: undefined
|
bugs/bug085.go:8: P: undefined
|
||||||
BUG: fails incorrectly
|
BUG: fails incorrectly
|
||||||
|
|
||||||
=========== bugs/bug086.go
|
|
||||||
4882
|
|
||||||
BUG: succeeds incorrectly
|
|
||||||
|
|
||||||
=========== bugs/bug087.go
|
=========== bugs/bug087.go
|
||||||
bugs/bug087.go:8: illegal combination of literals LEN 9
|
bugs/bug087.go:8: illegal combination of literals LEN 9
|
||||||
bugs/bug087.go:8: illegal combination of literals LEN 9
|
bugs/bug087.go:8: illegal combination of literals LEN 9
|
||||||
|
|
@ -141,6 +139,23 @@ pc: 0x1b7d
|
||||||
|
|
||||||
BUG: fails incorrectly
|
BUG: fails incorrectly
|
||||||
|
|
||||||
|
=========== bugs/bug094.go
|
||||||
|
bugs/bug094.go:11: left side of := must be a name
|
||||||
|
bad top
|
||||||
|
. LITERAL-I0 l(343)
|
||||||
|
bugs/bug094.go:11: fatal error: walktype: top=3 LITERAL
|
||||||
|
BUG: fails incorrectly
|
||||||
|
|
||||||
|
=========== bugs/bug095.go
|
||||||
|
found 2, expected 1
|
||||||
|
|
||||||
|
panic on line 342 PC=0x139e
|
||||||
|
0x139e?zi
|
||||||
|
main·main(1, 0, 1606416392, ...)
|
||||||
|
main·main(0x1, 0x7fff5fbff808, 0x0, ...)
|
||||||
|
BUG wrong result
|
||||||
|
Trace/BPT trap ./$A.out
|
||||||
|
|
||||||
=========== fixedbugs/bug015.go
|
=========== fixedbugs/bug015.go
|
||||||
fixedbugs/bug015.go:7: overflow converting constant to <int64>INT64
|
fixedbugs/bug015.go:7: overflow converting constant to <int64>INT64
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue