summaryrefslogtreecommitdiff
path: root/test/return.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2013-08-07 11:05:19 -0700
committerIan Lance Taylor <iant@golang.org>2013-08-07 11:05:19 -0700
commit6963f54ea5b07d5c7760d51c833256d21a9505f7 (patch)
treeeed4c6248ef545d5fb10bb9b7981ddc3147630da /test/return.go
parentbb4fcd5d1d87828ed5a4ad2598299461c59f986d (diff)
downloadgo-6963f54ea5b07d5c7760d51c833256d21a9505f7.tar.gz
test: fix return.go to not use fallthrough in a type switch
The gc compiler only gives an error about fallthrough in a type switch if it has not given any errors in an earlier pass. Remove all functions in this test that use fallthrough in a type switch because they don't test anything useful and they cause gccgo to give unexpected errors. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/12614043
Diffstat (limited to 'test/return.go')
-rw-r--r--test/return.go84
1 files changed, 0 insertions, 84 deletions
diff --git a/test/return.go b/test/return.go
index dcf32f86f..6e02b782d 100644
--- a/test/return.go
+++ b/test/return.go
@@ -666,17 +666,6 @@ func _() int {
}
}
-func _() int {
- print(1)
- switch x.(type) {
- case int:
- print(2)
- fallthrough
- default:
- return 4
- }
-}
-
// if no default or some case doesn't terminate, switch is no longer okay
func _() int {
@@ -713,17 +702,6 @@ func _() int {
switch x.(type) {
case int:
print(2)
- fallthrough
- case float64:
- return 4
- }
-} // ERROR "missing return"
-
-func _() int {
- print(1)
- switch x.(type) {
- case int:
- print(2)
panic(3)
}
} // ERROR "missing return"
@@ -1356,16 +1334,6 @@ func _() int {
}
}
-func _() int {
- switch x.(type) {
- case int:
- print(2)
- fallthrough
- default:
- return 4
- }
-}
-
// if no default or some case doesn't terminate, switch is no longer okay
func _() int {
@@ -1398,16 +1366,6 @@ func _() int {
switch x.(type) {
case int:
print(2)
- fallthrough
- case float64:
- return 4
- }
-} // ERROR "missing return"
-
-func _() int {
- switch x.(type) {
- case int:
- print(2)
panic(3)
}
} // ERROR "missing return"
@@ -2102,17 +2060,6 @@ var _ = func() int {
}
}
-var _ = func() int {
- print(1)
- switch x.(type) {
- case int:
- print(2)
- fallthrough
- default:
- return 4
- }
-}
-
// if no default or some case doesn't terminate, switch is no longer okay
var _ = func() int {
@@ -2149,17 +2096,6 @@ var _ = func() int {
switch x.(type) {
case int:
print(2)
- fallthrough
- case float64:
- return 4
- }
-} // ERROR "missing return"
-
-var _ = func() int {
- print(1)
- switch x.(type) {
- case int:
- print(2)
panic(3)
}
} // ERROR "missing return"
@@ -2792,16 +2728,6 @@ var _ = func() int {
}
}
-var _ = func() int {
- switch x.(type) {
- case int:
- print(2)
- fallthrough
- default:
- return 4
- }
-}
-
// if no default or some case doesn't terminate, switch is no longer okay
var _ = func() int {
@@ -2834,16 +2760,6 @@ var _ = func() int {
switch x.(type) {
case int:
print(2)
- fallthrough
- case float64:
- return 4
- }
-} // ERROR "missing return"
-
-var _ = func() int {
- switch x.(type) {
- case int:
- print(2)
panic(3)
}
} // ERROR "missing return"