Source file test/abi/reg_not_ssa.go

     1  // run
     2  
     3  //go:build !wasm
     4  
     5  // Copyright 2023 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  package main
    10  
    11  // small enough for registers, too large for SSA
    12  type T struct {
    13  	a, b, c, d, e int
    14  }
    15  
    16  //go:noinline
    17  func F() {
    18  	a, b := g(), g()
    19  	h(b, b)
    20  	h(a, g())
    21  	if a.a == 1 {
    22  		a = g()
    23  	}
    24  	h(a, a)
    25  }
    26  
    27  //go:noinline
    28  func g() T {
    29  	return T{1, 2, 3, 4, 5}
    30  }
    31  
    32  //go:noinline
    33  func h(s, t T) {
    34  	if s != t {
    35  		println("NEQ")
    36  	}
    37  }
    38  
    39  func main() { F() }
    40  

View as plain text