github.com/euank/go@v0.0.0-20160829210321-495514729181/src/cmd/compile/internal/gc/testdata/deferNoReturn_ssa.go (about)

     1  // compile
     2  
     3  // Copyright 2015 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.
     6  
     7  // Test that a defer in a function with no return
     8  // statement will compile correctly.
     9  
    10  package foo
    11  
    12  func deferNoReturn_ssa() {
    13  	defer func() { println("returned") }()
    14  	for {
    15  		println("loop")
    16  	}
    17  }