summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bench/timing.log8
-rw-r--r--test/fixedbugs/bug337.go19
-rw-r--r--test/fixedbugs/bug338.go22
-rw-r--r--test/fixedbugs/bug339.go20
-rw-r--r--test/fixedbugs/bug340.go17
-rw-r--r--test/fixedbugs/bug341.go22
6 files changed, 108 insertions, 0 deletions
diff --git a/test/bench/timing.log b/test/bench/timing.log
index c658fa098..e66797982 100644
--- a/test/bench/timing.log
+++ b/test/bench/timing.log
@@ -844,3 +844,11 @@ NEW:
gcc -O2 chameneosredux.c -lpthread 8.05u 63.43s 11.16r
gccgo -O2 chameneosredux.go 82.95u 304.37s 207.64r
gc chameneosredux 9.42u 0.00s 9.43r
+
+# May 13, 2011
+# after gc update to inline append when possible - 35% faster
+
+regex-dna 100000
+ gc regex-dna 3.94u 0.00s 3.95r
+ gc regex-dna-parallel 4.15u 0.01s 1.63r
+ gc_B regex-dna 4.01u 0.01s 4.02r
diff --git a/test/fixedbugs/bug337.go b/test/fixedbugs/bug337.go
new file mode 100644
index 000000000..62e310e72
--- /dev/null
+++ b/test/fixedbugs/bug337.go
@@ -0,0 +1,19 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 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.
+
+// Issue 1722.
+
+// Check that the error messages says
+// bug337.go:16: len("foo") not used
+// and not
+// bug337.go:16: 3 not used
+
+package main
+
+func main() {
+ len("foo") // ERROR "len"
+}
+
diff --git a/test/fixedbugs/bug338.go b/test/fixedbugs/bug338.go
new file mode 100644
index 000000000..c368a7fad
--- /dev/null
+++ b/test/fixedbugs/bug338.go
@@ -0,0 +1,22 @@
+// $G $D/$F.go
+
+// Copyright 2011 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.
+
+// Issue 1787.
+
+package main
+
+import "unsafe"
+
+const x = unsafe.Sizeof([8]byte{})
+
+func main() {
+ var b [x]int
+ _ = b
+}
+
+/*
+bug338.go:14: array bound must be non-negative
+*/
diff --git a/test/fixedbugs/bug339.go b/test/fixedbugs/bug339.go
new file mode 100644
index 000000000..eac7c5ee6
--- /dev/null
+++ b/test/fixedbugs/bug339.go
@@ -0,0 +1,20 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 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.
+
+// Issue 1608.
+// Size used to be -1000000000.
+
+package main
+
+import "unsafe"
+
+func main() {
+ var a interface{} = 0
+ size := unsafe.Sizeof(a)
+ if size != 2*unsafe.Sizeof((*int)(nil)) {
+ println("wrong size: ", size)
+ }
+}
diff --git a/test/fixedbugs/bug340.go b/test/fixedbugs/bug340.go
new file mode 100644
index 000000000..461cc6cd4
--- /dev/null
+++ b/test/fixedbugs/bug340.go
@@ -0,0 +1,17 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 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.
+
+// Issue 1606.
+
+package main
+
+func main() {
+ var x interface{}
+ switch t := x.(type) { // ERROR "0 is not a type"
+ case 0:
+ t.x = 1 // ERROR "type interface \{ \}"
+ }
+}
diff --git a/test/fixedbugs/bug341.go b/test/fixedbugs/bug341.go
new file mode 100644
index 000000000..8ee52e1ef
--- /dev/null
+++ b/test/fixedbugs/bug341.go
@@ -0,0 +1,22 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug341
+
+// Copyright 2011 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.
+
+// Used to panic because 8g was generating incorrect
+// code for converting a negative float to a uint64.
+
+package main
+
+func main() {
+ var x float32 = -2.5
+
+ _ = uint64(x)
+ _ = float32(0)
+}
+/*
+panic: runtime error: floating point error
+
+[signal 0x8 code=0x6 addr=0x8048c64 pc=0x8048c64]
+*/