3 // Copyright 2021 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test that when a function recovers from a panic, it
8 // returns the correct results to the caller (in particular,
9 // setting the result registers correctly).
20 var a0, b0, c0, d0 = 10, "hello", S{1, 2, 3, 4}, [2]int{111, 222}
24 func F() (a int, b string, _ int, c S, d [2]int) {
25 a, b, c, d = a0, b0, c0, d0
26 defer func() { recover() }()
32 a1, b1, zero, c1, d1 := F()
33 if a1 != a0 || b1 != b0 || c1 != c0 || d1 != d0 || zero != 0 { // unnamed result gets zero value