
This simplifies future changes. While the move itself is very simple, it required some other changes to a few transforms that create new functions to add the optsize attribute manually. It also required abstracting away the optimization level flags (based on the -opt flag) so that it can easily be retrieved from the config object. This commit does not impact binary size on baremetal and WebAssembly. I've seen a few tests on linux/amd64 grow slightly in size, but I'm not too worried about those.
24 строки
445 Б
Go
24 строки
445 Б
Go
package transform
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"tinygo.org/x/go-llvm"
|
|
)
|
|
|
|
func TestInterruptLowering(t *testing.T) {
|
|
t.Parallel()
|
|
for _, subtest := range []string{"avr", "cortexm"} {
|
|
t.Run(subtest, func(t *testing.T) {
|
|
testTransform(t, "testdata/interrupt-"+subtest, func(mod llvm.Module) {
|
|
errs := LowerInterrupts(mod, 0)
|
|
if len(errs) != 0 {
|
|
t.Fail()
|
|
for _, err := range errs {
|
|
t.Error(err)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|