mirror of https://github.com/golang/go.git
parent
2f5a05a859
commit
cf9e46fec6
|
|
@ -0,0 +1,14 @@
|
|||
// $G $D/$F.go || echo BUG: bug115 should compile
|
||||
|
||||
// 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 isuint(i uint) { }
|
||||
|
||||
func main() {
|
||||
i := ^uint(0);
|
||||
isuint(i);
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug116
|
||||
|
||||
// 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 main() {
|
||||
bad := false;
|
||||
if (-5>>1) != -3 {
|
||||
println("-5>>1 =", -5>>1, "want -3");
|
||||
bad = true;
|
||||
}
|
||||
if (-4>>1) != -2 {
|
||||
println("-4>>1 =", -4>>1, "want -2");
|
||||
bad = true;
|
||||
}
|
||||
if (-3>>1) != -2 {
|
||||
println("-3>>1 =", -3>>1, "want -2");
|
||||
bad = true;
|
||||
}
|
||||
if (-2>>1) != -1 {
|
||||
println("-2>>1 =", -2>>1, "want -1");
|
||||
bad = true;
|
||||
}
|
||||
if (-1>>1) != -1 {
|
||||
println("-1>>1 =", -1>>1, "want -1");
|
||||
bad = true;
|
||||
}
|
||||
if bad {
|
||||
panicln("errors");
|
||||
}
|
||||
}
|
||||
|
|
@ -264,3 +264,19 @@ M
|
|||
|
||||
=========== fixedbugs/bug103.go
|
||||
fixedbugs/bug103.go:8: function requires a return type
|
||||
|
||||
=========== bugs/bug115.go
|
||||
bugs/bug115.go:8: overflow converting constant to uint
|
||||
BUG: bug115 should compile
|
||||
|
||||
=========== bugs/bug116.go
|
||||
-5>>1 = -2 want -3
|
||||
-4>>1 = -3 want -2
|
||||
-3>>1 = -1 want -2
|
||||
-2>>1 = -2 want -1
|
||||
-1>>1 = 0 want -1
|
||||
errors
|
||||
|
||||
panic on line 92 PC=xxx
|
||||
BUG: bug116
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue