mirror of
https://github.com/golang/go
synced 2024-11-22 03:34:40 -07:00
test: add cases to return.go that gccgo got wrong
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12620043
This commit is contained in:
parent
96c583b84c
commit
2b45124a59
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**/
|
||||
|
Loading…
Reference in New Issue
Block a user