Source file test/fixedbugs/issue30566a.go

     1  // run
     2  
     3  // Copyright 2019 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  package main
     8  
     9  import "fmt"
    10  
    11  //go:noinline
    12  func ident(s string) string { return s }
    13  
    14  func returnSecond(x bool, s string) string { return s }
    15  
    16  func identWrapper(s string) string { return ident(s) }
    17  
    18  func main() {
    19  	got := returnSecond((false || identWrapper("bad") != ""), ident("good"))
    20  	if got != "good" {
    21  		panic(fmt.Sprintf("wanted \"good\", got \"%s\"", got))
    22  	}
    23  }
    24  

View as plain text