mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
5ba8766cbc
* reflect: implement method-set based AssignableTo and Implements Based on the design from #4376 by aykevl. Fixes #4277, fixes #3580. Co-authored-by: Ayke van Laethem <aykevanlaethem@gmail.com> * builder: update expected binary sizes for reflect changes * Make interface checks similar to invoke, allowing typeImplementsMethodSet and method info to be dropped when reflect is not present * Add more tests that BigGo reflect tests * Even more pruning * Add go/token and net/url to passing tests * Prune even further, I am less happy with this, though * Update size test now that we are smaller * Skip some tests * elide method lists * format, oops * fix tests * Add a panic, pull out constant to keep in sync * Add debug info * Remove code that was leftover from a previous refactor --------- Co-authored-by: Ayke van Laethem <aykevanlaethem@gmail.com>
25 lines
513 B
Go
25 lines
513 B
Go
package transform_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tinygo-org/tinygo/transform"
|
|
"tinygo.org/x/go-llvm"
|
|
)
|
|
|
|
func TestOptimizeStringToBytes(t *testing.T) {
|
|
t.Parallel()
|
|
testTransform(t, "testdata/stringtobytes", func(mod llvm.Module) {
|
|
// Run optimization pass.
|
|
transform.OptimizeStringToBytes(mod)
|
|
})
|
|
}
|
|
|
|
func TestOptimizeStringEqual(t *testing.T) {
|
|
t.Parallel()
|
|
testTransform(t, "testdata/stringequal", func(mod llvm.Module) {
|
|
// Run optimization pass.
|
|
transform.OptimizeStringEqual(mod)
|
|
})
|
|
}
|