Source file test/fixedbugs/issue6036.go

     1  // compile
     2  
     3  //go:build !386 && !arm && !mips && !mipsle && !amd64p32
     4  
     5  // Copyright 2013 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  // Issue 6036: 6g's backend generates OINDREG with
    10  // offsets larger than 32-bit.
    11  
    12  package main
    13  
    14  type T struct {
    15  	Large [1 << 31]byte
    16  	A     int
    17  	B     int
    18  }
    19  
    20  func F(t *T) {
    21  	t.B = t.A
    22  }
    23  
    24  type T2 [1<<31 + 2]byte
    25  
    26  func F2(t *T2) {
    27  	t[1<<31+1] = 42
    28  }
    29  
    30  type T3 [1<<15 + 1][1<<15 + 1]int
    31  
    32  func F3(t *T3) {
    33  	t[1<<15][1<<15] = 42
    34  }
    35  
    36  type S struct {
    37  	A int32
    38  	B int32
    39  }
    40  
    41  type T4 [1<<29 + 1]S
    42  
    43  func F4(t *T4) {
    44  	t[1<<29].B = 42
    45  }
    46  

View as plain text