summaryrefslogtreecommitdiff
path: root/test/return.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2013-08-07 11:31:01 -0700
committerIan Lance Taylor <iant@golang.org>2013-08-07 11:31:01 -0700
commit1ee0426ee44a2bf7f7ec5b4e137b179e58387ec3 (patch)
treea61fa12e3547e582ba42906e68b2884e44d98582 /test/return.go
parent141229e53f0a02ce4206190eaa50a6a4b62476a4 (diff)
downloadgo-1ee0426ee44a2bf7f7ec5b4e137b179e58387ec3.tar.gz
test: add cases to return.go that gccgo got wrong
R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/12620043
Diffstat (limited to 'test/return.go')
-rw-r--r--test/return.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/return.go b/test/return.go
index c1fe84382..482f22bd5 100644
--- a/test/return.go
+++ b/test/return.go
@@ -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)
+ }
+}
+
/**/