(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestOptimizeMaps(t *testing.T) { |
| 11 | t.Parallel() |
| 12 | testTransform(t, "testdata/maps", func(mod llvm.Module) { |
| 13 | // Run optimization pass. |
| 14 | transform.OptimizeMaps(mod) |
| 15 | |
| 16 | // Run an optimization pass, to clean up the result. |
| 17 | // This shows that all code related to the map is really eliminated. |
| 18 | po := llvm.NewPassBuilderOptions() |
| 19 | defer po.Dispose() |
| 20 | err := mod.RunPasses("dse,adce", llvm.TargetMachine{}, po) |
| 21 | if err != nil { |
| 22 | t.Error("failed to run passes:", err) |
| 23 | } |
| 24 | }) |
| 25 | } |
nothing calls this directly
no test coverage detected