diff options
Diffstat (limited to 'test/codegen/stack.go')
| -rw-r--r-- | test/codegen/stack.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/codegen/stack.go b/test/codegen/stack.go index ed2c1ed959..ca37622286 100644 --- a/test/codegen/stack.go +++ b/test/codegen/stack.go @@ -98,3 +98,14 @@ func check_asmout(a, b int) int { // arm:`.*b\+4\(FP\)` return b } + +// Check that simple functions get promoted to nosplit, even when +// they might panic in various ways. See issue 31219. +// amd64:"TEXT\t.*NOSPLIT.*" +func MightPanic(a []int, i, j, k, s int) { + _ = a[i] // panicIndex + _ = a[i:j] // panicSlice + _ = a[i:j:k] // also panicSlice + _ = i << s // panicShift + _ = i / j // panicDivide +} |
