mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
19e2d12517
This is a big reimplementation that simplifies the compiler a lot. Instead of storing the method set in metadata and lowering the type asserts as a whole program pass, this change just puts the list of methods in the type code (and a separate global for the interface type).
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)
|
|
})
|
|
}
|