Source file test/abi/struct_lower_1.go

     1  // run
     2  
     3  //go:build !wasm
     4  // +build !wasm
     5  
     6  // Copyright 2021 The Go Authors. All rights reserved.
     7  // Use of this source code is governed by a BSD-style
     8  // license that can be found in the LICENSE file.
     9  
    10  package main
    11  
    12  import "fmt"
    13  
    14  //go:registerparams
    15  //go:noinline
    16  func passStruct6(a Struct6) Struct6 {
    17  	return a
    18  }
    19  
    20  type Struct6 struct {
    21  	Struct1
    22  }
    23  
    24  type Struct1 struct {
    25  	A, B, C uint
    26  }
    27  
    28  func main() {
    29  	fmt.Println(passStruct6(Struct6{Struct1{1, 2, 3}}))
    30  }
    31  

View as plain text