compiler, runtime: implement recoverable divide-by-zero panic

This gets the math/bits and go/constant package tests to pass.

Unfortunately, this also has a binary size impact of around 150-200
bytes in many cases. I'm a bit on the edge on whether this is worth it,
since it's mostly used for getting package tests to work. But at the
same time, having working package tests is very valuable.
This commit is contained in:
Ayke van Laethem
2025-02-25 13:07:21 +01:00
parent adc0cae960
commit 88d273da97
5 changed files with 52 additions and 11 deletions
+5
View File
@@ -362,6 +362,7 @@ TEST_PACKAGES_FAST = \
# debug/plan9obj requires os.ReadAt, which is not yet supported on windows
# image requires recover(), which is not yet supported on wasi
# io/ioutil requires os.ReadDir, which is not yet supported on windows or wasi
# math/bits: needs panic()/recover()
# mime: fail on wasi; neds panic()/recover()
# mime/multipart: needs wasip1 syscall.FDFLAG_NONBLOCK
# mime/quotedprintable requires syscall.Faccessat
@@ -382,8 +383,10 @@ TEST_PACKAGES_LINUX := \
crypto/hmac \
debug/dwarf \
debug/plan9obj \
go/constant \
image \
io/ioutil \
math/bits \
mime \
mime/multipart \
mime/quotedprintable \
@@ -403,6 +406,8 @@ TEST_PACKAGES_WINDOWS := \
compress/flate \
crypto/des \
crypto/hmac \
go/constant \
math/bits \
strconv \
text/template/parse \
$(nil)