diff options
Diffstat (limited to 'src/runtime/gc_test.go')
| -rw-r--r-- | src/runtime/gc_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/gc_test.go b/src/runtime/gc_test.go index 4c281ce52b..c5c8a4cecf 100644 --- a/src/runtime/gc_test.go +++ b/src/runtime/gc_test.go @@ -12,6 +12,7 @@ import ( "runtime" "runtime/debug" "sort" + "strings" "sync" "sync/atomic" "testing" @@ -192,6 +193,15 @@ func TestPeriodicGC(t *testing.T) { } } +func TestGcZombieReporting(t *testing.T) { + // This test is somewhat sensitive to how the allocator works. + got := runTestProg(t, "testprog", "GCZombie") + want := "found pointer to free object" + if !strings.Contains(got, want) { + t.Fatalf("expected %q in output, but got %q", want, got) + } +} + func BenchmarkSetTypePtr(b *testing.B) { benchSetType(b, new(*byte)) } |
