modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue18994.go (about)

     1  // run
     2  
     3  // Copyright 2017 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  // Issue 18994: SSA didn't handle DOT STRUCTLIT for zero-valued
     8  // STRUCTLIT.
     9  
    10  package main
    11  
    12  // large struct - not SSA-able
    13  type T struct {
    14  	a, b, c, d, e, f, g, h int
    15  }
    16  
    17  func main() {
    18  	x := T{}.a
    19  	if x != 0 {
    20  		panic("FAIL")
    21  	}
    22  }