Source file test/fixedbugs/issue26024.go

     1  // compile
     2  // Copyright 2018 The Go Authors. All rights reserved.
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package r
     7  
     8  // f compiles into code where no stores remain in the two successors
     9  // of a write barrier block; i.e., they are empty. Pre-fix, this
    10  // results in an unexpected input to markUnsafePoints, that expects to
    11  // see a pair of non-empty plain blocks.
    12  func f() {
    13  	var i int
    14  	var s string
    15  	for len(s) < len(s) {
    16  		i++
    17  		s = "a"
    18  	}
    19  	var b bool
    20  	var sa []string
    21  	for true {
    22  		sa = []string{""}
    23  		for b || i == 0 {
    24  		}
    25  		b = !b
    26  		_ = sa
    27  	}
    28  }
    29  

View as plain text