]> Cypherpunks repositories - gostls13.git/commitdiff
test: fix return.go to not use fallthrough in a type switch
authorIan Lance Taylor <iant@golang.org>
Wed, 7 Aug 2013 18:05:19 +0000 (11:05 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 7 Aug 2013 18:05:19 +0000 (11:05 -0700)
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

test/return.go

index dcf32f86ff8ef7c79615c565021102f9228af719..6e02b782d42f88c577cd9d77cc2c5af8aa7c9096 100644 (file)
@@ -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: