From: Ian Lance Taylor Date: Wed, 7 Aug 2013 18:05:19 +0000 (-0700) Subject: test: fix return.go to not use fallthrough in a type switch X-Git-Tag: go1.2rc2~744 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5e0278b7a06bbf904349570238fbbdd08c504693;p=gostls13.git 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://golang.org/cl/12614043 --- diff --git a/test/return.go b/test/return.go index dcf32f86ff..6e02b782d4 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 { @@ -708,17 +697,6 @@ func _() int { } } // ERROR "missing return" -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - case float64: - return 4 - } -} // ERROR "missing return" - func _() int { print(1) switch x.(type) { @@ -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 { @@ -1394,16 +1362,6 @@ func _() int { } } // ERROR "missing return" -func _() int { - switch x.(type) { - case int: - print(2) - fallthrough - case float64: - return 4 - } -} // ERROR "missing return" - func _() int { switch x.(type) { case int: @@ -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 { @@ -2144,17 +2091,6 @@ var _ = func() int { } } // ERROR "missing return" -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - case float64: - return 4 - } -} // ERROR "missing return" - var _ = func() int { print(1) switch x.(type) { @@ -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 { @@ -2830,16 +2756,6 @@ var _ = func() int { } } // ERROR "missing return" -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: