Source file test/decomposeaddr64.go

     1  // errorcheck -0 -d=ssa/decompose_addr/debug=1
     2  
     3  //go:build !386 && !arm && !mips && !mipsle
     4  
     5  // Copyright 2026 The Go Authors. All rights reserved.
     6  // Use of this source code is governed by a BSD-style
     7  // license that can be found in the LICENSE file.
     8  
     9  // decomposeAddr cases whose word leaves are 8 bytes wide: on 32-bit
    10  // platforms such a leaf does not fit a register and the variable is
    11  // left alone, so these expectations only hold on 64-bit platforms.
    12  
    13  package main
    14  
    15  func bareComplexField(p *complex128) int {
    16  	// A bare multi-word value (no enclosing struct) also decomposes.
    17  	x := *p // ERROR "promoted x"
    18  	q := &x
    19  	return int(real(*q)) + int(imag(*q))
    20  }
    21  
    22  func main() {}
    23  

View as plain text