transform: add allocation alias regression cases

Add allocation diagnostics coverage for pointer-returning helpers, aggregate
slice returns, and conditional pointer returns before changing the allocation
optimizer.

The golden files record the current heap-allocation behavior so later commits
show exactly which diagnostics each optimizer improvement removes.
This commit is contained in:
Jake Bailey
2026-06-12 11:21:53 -07:00
committed by Ron Evans
parent 11c2b76e29
commit 335b085fd2
3 changed files with 83 additions and 22 deletions
+14 -10
View File
@@ -1,10 +1,14 @@
testdata/allocs2.go:13.1,13.9 1 0
testdata/allocs2.go:23.1,23.22 1 0
testdata/allocs2.go:26.1,26.43 1 0
testdata/allocs2.go:28.1,28.25 1 0
testdata/allocs2.go:31.1,31.22 1 0
testdata/allocs2.go:38.1,38.23 1 0
testdata/allocs2.go:46.1,46.23 1 0
testdata/allocs2.go:48.1,48.22 1 0
testdata/allocs2.go:51.1,51.9 1 0
testdata/allocs2.go:52.1,52.9 1 0
testdata/allocs2.go:12.1,12.9 1 0
testdata/allocs2.go:21.1,21.22 1 0
testdata/allocs2.go:24.1,24.43 1 0
testdata/allocs2.go:26.1,26.25 1 0
testdata/allocs2.go:29.1,29.22 1 0
testdata/allocs2.go:36.1,36.23 1 0
testdata/allocs2.go:44.1,44.23 1 0
testdata/allocs2.go:46.1,46.22 1 0
testdata/allocs2.go:49.1,49.9 1 0
testdata/allocs2.go:50.1,50.9 1 0
testdata/allocs2.go:98.1,98.23 1 0
testdata/allocs2.go:107.1,107.21 1 0
testdata/allocs2.go:114.1,114.23 1 0
testdata/allocs2.go:128.1,128.23 1 0