2018-01-24 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / go.test / test / gc.go
blob6688f9fbddb9148c60ff0719e45cfc367cff35dc
1 // run
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Simple test of the garbage collector.
9 package main
11 import "runtime"
13 func mk2() {
14 b := new([10000]byte)
15 _ = b
16 // println(b, "stored at", &b)
19 func mk1() { mk2() }
21 func main() {
22 for i := 0; i < 10; i++ {
23 mk1()
24 runtime.GC()