]> Cypherpunks repositories - gostls13.git/commitdiff
test: add cases to return.go that gccgo got wrong
authorIan Lance Taylor <iant@golang.org>
Wed, 7 Aug 2013 18:31:01 +0000 (11:31 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 7 Aug 2013 18:31:01 +0000 (11:31 -0700)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12620043

test/return.go

index c1fe843827db90191c1f7a2819a9f2fb4a29d18a..482f22bd5f4d28c91bd2acca72011a813be1a697 100644 (file)
@@ -1406,6 +1406,16 @@ L:
        }
 } // ERROR "missing return"
 
+func _() int {
+       switch x.(type) {
+       default:
+               return 4
+       case int, float64:
+               print(2)
+               panic(3)
+       }
+}
+
 // again, with func literals
 
 var _ = func() int {
@@ -2798,4 +2808,14 @@ L:
        }
 } // ERROR "missing return"
 
+var _ = func() int {
+       switch x.(type) {
+       default:
+               return 4
+       case int, float64:
+               print(2)
+               panic(3)
+       }
+}
+
 /**/