summaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/bug001.go11
-rw-r--r--test/fixedbugs/bug140.go4
-rw-r--r--test/fixedbugs/bug1515.go20
-rw-r--r--test/fixedbugs/bug219.go12
-rw-r--r--test/fixedbugs/bug323.go (renamed from test/fixedbugs/bug322.go)0
-rw-r--r--test/fixedbugs/bug325.go14
6 files changed, 42 insertions, 19 deletions
diff --git a/test/fixedbugs/bug001.go b/test/fixedbugs/bug001.go
deleted file mode 100644
index 2df8791ff..000000000
--- a/test/fixedbugs/bug001.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// 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() {
- if {} // compiles; should be an error (must be an expression)
-}
diff --git a/test/fixedbugs/bug140.go b/test/fixedbugs/bug140.go
index 33d1deb8a..298081663 100644
--- a/test/fixedbugs/bug140.go
+++ b/test/fixedbugs/bug140.go
@@ -7,8 +7,8 @@
package main
func main() {
- if {} else L1: ;
- if {} else L2: main() ;
+ if true {} else L1: ;
+ if true {} else L2: main() ;
}
/*
diff --git a/test/fixedbugs/bug1515.go b/test/fixedbugs/bug1515.go
new file mode 100644
index 000000000..740252516
--- /dev/null
+++ b/test/fixedbugs/bug1515.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.
+
+package main
+
+const (
+ joao = "João"
+ jose = "José"
+)
+
+func main() {
+ s1 := joao
+ s2 := jose
+ if (s1 < s2) != (joao < jose) {
+ panic("unequal")
+ }
+}
diff --git a/test/fixedbugs/bug219.go b/test/fixedbugs/bug219.go
index 21361a2aa..966d3fcf3 100644
--- a/test/fixedbugs/bug219.go
+++ b/test/fixedbugs/bug219.go
@@ -12,8 +12,8 @@ func f(func()) int { return 0 }
// bug219.go:16: syntax error near if
func g1() {
if x := f(func() {
- if {}
- }); {
+ if true {}
+ }); true {
_ = x;
}
}
@@ -21,8 +21,8 @@ func g1() {
// this works
func g2() {
if x := f(func() {
- //if {}
- }); {
+ //if true {}
+ }); true {
_ = x;
}
}
@@ -30,9 +30,9 @@ func g2() {
// this works
func g3() {
x := f(func() {
- if {}
+ if true {}
});
- if {
+ if true {
_ = x;
}
}
diff --git a/test/fixedbugs/bug322.go b/test/fixedbugs/bug323.go
index bfb528318..bfb528318 100644
--- a/test/fixedbugs/bug322.go
+++ b/test/fixedbugs/bug323.go
diff --git a/test/fixedbugs/bug325.go b/test/fixedbugs/bug325.go
new file mode 100644
index 000000000..23dbc8b3c
--- /dev/null
+++ b/test/fixedbugs/bug325.go
@@ -0,0 +1,14 @@
+// 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.
+
+package main
+
+import "unsafe"
+
+func main() {
+ var x unsafe.Pointer
+ println(*x) // ERROR "invalid indirect.*unsafe.Pointer"
+}