mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-14 00:19:28 +00:00
runtime: avoid heap allocs for plain errors
This commit is contained in:
@@ -168,6 +168,39 @@ func TestBuild(t *testing.T) {
|
||||
runTestWithConfig("print.go", t, opts, nil, nil)
|
||||
})
|
||||
|
||||
t.Run("gc=none-runtime-panic", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
opts := optionsFromTarget("cortex-m-qemu", sema)
|
||||
opts.GC = "none"
|
||||
opts.Scheduler = "none"
|
||||
config, err := builder.NewConfig(&opts)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = Build("testdata/trivialpanic.go", t.TempDir()+"/trivialpanic", config)
|
||||
if err != nil {
|
||||
w := &bytes.Buffer{}
|
||||
diagnostics.CreateDiagnostics(err).WriteTo(w, "")
|
||||
t.Fatal(w.String())
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("scheduler=none-uefi", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
opts := optionsFromTarget("uefi-amd64", sema)
|
||||
opts.Scheduler = "none"
|
||||
config, err := builder.NewConfig(&opts)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = Build("testdata/trivialpanic.go", t.TempDir()+"/trivialpanic", config)
|
||||
if err != nil {
|
||||
w := &bytes.Buffer{}
|
||||
diagnostics.CreateDiagnostics(err).WriteTo(w, "")
|
||||
t.Fatal(w.String())
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("ldflags", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
opts := optionsFromTarget("", sema)
|
||||
|
||||
Reference in New Issue
Block a user