diff --git a/transform/allocs_test.go b/transform/allocs_test.go index 42c5292d..9176b2ff 100644 --- a/transform/allocs_test.go +++ b/transform/allocs_test.go @@ -1,10 +1,12 @@ -package transform +package transform_test import ( "testing" + + "github.com/tinygo-org/tinygo/transform" ) func TestAllocs(t *testing.T) { t.Parallel() - testTransform(t, "testdata/allocs", OptimizeAllocs) + testTransform(t, "testdata/allocs", transform.OptimizeAllocs) } diff --git a/transform/func-lowering_test.go b/transform/func-lowering_test.go index ee3d019d..e8821245 100644 --- a/transform/func-lowering_test.go +++ b/transform/func-lowering_test.go @@ -1,10 +1,12 @@ -package transform +package transform_test import ( "testing" + + "github.com/tinygo-org/tinygo/transform" ) func TestFuncLowering(t *testing.T) { t.Parallel() - testTransform(t, "testdata/func-lowering", LowerFuncValues) + testTransform(t, "testdata/func-lowering", transform.LowerFuncValues) } diff --git a/transform/gc_test.go b/transform/gc_test.go index 64962f0a..70412d6b 100644 --- a/transform/gc_test.go +++ b/transform/gc_test.go @@ -1,21 +1,22 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) func TestAddGlobalsBitmap(t *testing.T) { t.Parallel() testTransform(t, "testdata/gc-globals", func(mod llvm.Module) { - AddGlobalsBitmap(mod) + transform.AddGlobalsBitmap(mod) }) } func TestMakeGCStackSlots(t *testing.T) { t.Parallel() testTransform(t, "testdata/gc-stackslots", func(mod llvm.Module) { - MakeGCStackSlots(mod) + transform.MakeGCStackSlots(mod) }) } diff --git a/transform/globals_test.go b/transform/globals_test.go index 0dcb0608..1b6f243b 100644 --- a/transform/globals_test.go +++ b/transform/globals_test.go @@ -1,14 +1,15 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) func TestApplyFunctionSections(t *testing.T) { t.Parallel() testTransform(t, "testdata/globals-function-sections", func(mod llvm.Module) { - ApplyFunctionSections(mod) + transform.ApplyFunctionSections(mod) }) } diff --git a/transform/goroutine_test.go b/transform/goroutine_test.go index e63b4923..4d4f0b19 100644 --- a/transform/goroutine_test.go +++ b/transform/goroutine_test.go @@ -1,14 +1,16 @@ -package transform +package transform_test import ( "testing" + + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) func TestGoroutineLowering(t *testing.T) { t.Parallel() testTransform(t, "testdata/coroutines", func(mod llvm.Module) { - err := LowerCoroutines(mod, false) + err := transform.LowerCoroutines(mod, false) if err != nil { panic(err) } diff --git a/transform/interface-lowering_test.go b/transform/interface-lowering_test.go index e1c3c2dc..e1d56e48 100644 --- a/transform/interface-lowering_test.go +++ b/transform/interface-lowering_test.go @@ -1,15 +1,16 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) func TestInterfaceLowering(t *testing.T) { t.Parallel() testTransform(t, "testdata/interface", func(mod llvm.Module) { - err := LowerInterfaces(mod, 0) + err := transform.LowerInterfaces(mod, 0) if err != nil { t.Error(err) } diff --git a/transform/interrupt_test.go b/transform/interrupt_test.go index 60d83da1..1740f485 100644 --- a/transform/interrupt_test.go +++ b/transform/interrupt_test.go @@ -1,8 +1,9 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) @@ -11,7 +12,7 @@ func TestInterruptLowering(t *testing.T) { 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) + errs := transform.LowerInterrupts(mod, 0) if len(errs) != 0 { t.Fail() for _, err := range errs { diff --git a/transform/maps_test.go b/transform/maps_test.go index 2bfc7fef..1f821d4b 100644 --- a/transform/maps_test.go +++ b/transform/maps_test.go @@ -1,8 +1,9 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) @@ -10,7 +11,7 @@ func TestOptimizeMaps(t *testing.T) { t.Parallel() testTransform(t, "testdata/maps", func(mod llvm.Module) { // Run optimization pass. - OptimizeMaps(mod) + transform.OptimizeMaps(mod) // Run an optimization pass, to clean up the result. // This shows that all code related to the map is really eliminated. diff --git a/transform/panic_test.go b/transform/panic_test.go index df078261..ea4efd0e 100644 --- a/transform/panic_test.go +++ b/transform/panic_test.go @@ -1,10 +1,12 @@ -package transform +package transform_test import ( "testing" + + "github.com/tinygo-org/tinygo/transform" ) func TestReplacePanicsWithTrap(t *testing.T) { t.Parallel() - testTransform(t, "testdata/panic", ReplacePanicsWithTrap) + testTransform(t, "testdata/panic", transform.ReplacePanicsWithTrap) } diff --git a/transform/rtcalls_test.go b/transform/rtcalls_test.go index 819dc5ac..9073b0ea 100644 --- a/transform/rtcalls_test.go +++ b/transform/rtcalls_test.go @@ -1,8 +1,9 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) @@ -10,7 +11,7 @@ func TestOptimizeStringToBytes(t *testing.T) { t.Parallel() testTransform(t, "testdata/stringtobytes", func(mod llvm.Module) { // Run optimization pass. - OptimizeStringToBytes(mod) + transform.OptimizeStringToBytes(mod) }) } @@ -18,7 +19,7 @@ func TestOptimizeStringEqual(t *testing.T) { t.Parallel() testTransform(t, "testdata/stringequal", func(mod llvm.Module) { // Run optimization pass. - OptimizeStringEqual(mod) + transform.OptimizeStringEqual(mod) }) } @@ -26,6 +27,6 @@ func TestOptimizeReflectImplements(t *testing.T) { t.Parallel() testTransform(t, "testdata/reflect-implements", func(mod llvm.Module) { // Run optimization pass. - OptimizeReflectImplements(mod) + transform.OptimizeReflectImplements(mod) }) } diff --git a/transform/stacksize_test.go b/transform/stacksize_test.go index c7c6cdec..c38a7b2f 100644 --- a/transform/stacksize_test.go +++ b/transform/stacksize_test.go @@ -1,9 +1,10 @@ -package transform +package transform_test import ( "testing" "github.com/tinygo-org/tinygo/compileopts" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) @@ -11,7 +12,7 @@ func TestCreateStackSizeLoads(t *testing.T) { t.Parallel() testTransform(t, "testdata/stacksize", func(mod llvm.Module) { // Run optimization pass. - CreateStackSizeLoads(mod, &compileopts.Config{ + transform.CreateStackSizeLoads(mod, &compileopts.Config{ Target: &compileopts.TargetSpec{ DefaultStackSize: 1024, }, diff --git a/transform/transform_test.go b/transform/transform_test.go index 28faf868..584ad435 100644 --- a/transform/transform_test.go +++ b/transform/transform_test.go @@ -1,4 +1,4 @@ -package transform +package transform_test // This file defines some helper functions for testing transforms. diff --git a/transform/wasm-abi_test.go b/transform/wasm-abi_test.go index abe5b30d..a0912928 100644 --- a/transform/wasm-abi_test.go +++ b/transform/wasm-abi_test.go @@ -1,8 +1,9 @@ -package transform +package transform_test import ( "testing" + "github.com/tinygo-org/tinygo/transform" "tinygo.org/x/go-llvm" ) @@ -10,7 +11,7 @@ func TestWasmABI(t *testing.T) { t.Parallel() testTransform(t, "testdata/wasm-abi", func(mod llvm.Module) { // Run ABI change pass. - err := ExternalInt64AsPtr(mod) + err := transform.ExternalInt64AsPtr(mod) if err != nil { t.Errorf("failed to change wasm ABI: %v", err) }