mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-30 16:48:40 +00:00
65beddafe8
Unfortunately, while doing this I found that it doesn't actually apply in any real-world programs (tested with `make smoketest`), apparently because nil pointer checking messes with the functionattrs pass. I hope to fix that after moving to LLVM 9, which has an optimization that makes nil pointer checking easier to implement.
16 lines
259 B
Go
16 lines
259 B
Go
package transform
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"tinygo.org/x/go-llvm"
|
|
)
|
|
|
|
func TestOptimizeStringToBytes(t *testing.T) {
|
|
t.Parallel()
|
|
testTransform(t, "testdata/stringtobytes", func(mod llvm.Module) {
|
|
// Run optimization pass.
|
|
OptimizeStringToBytes(mod)
|
|
})
|
|
}
|