blob: 8ebef5a447cde593de85e51d26e0271faf3deeeb [file] [log] [blame]
Cherry Zhangb53f0f82017-02-03 20:54:52 -05001// +build !386,!arm,!mips,!mipsle,!amd64p32
Rémy Oudompheng9c21ce52013-09-09 20:36:19 +02002// compile
3
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07004// Copyright 2013 The Go Authors. All rights reserved.
Rémy Oudompheng9c21ce52013-09-09 20:36:19 +02005// Use of this source code is governed by a BSD-style
6// license that can be found in the LICENSE file.
7
8// Issue 6036: 6g's backend generates OINDREG with
9// offsets larger than 32-bit.
10
11package main
12
13type T struct {
14 Large [1 << 31]byte
15 A int
16 B int
17}
18
19func F(t *T) {
20 t.B = t.A
21}
22
23type T2 [1<<31 + 2]byte
24
25func F2(t *T2) {
26 t[1<<31+1] = 42
27}
28
29type T3 [1<<15 + 1][1<<15 + 1]int
30
31func F3(t *T3) {
32 t[1<<15][1<<15] = 42
33}
34
35type S struct {
36 A int32
37 B int32
38}
39
40type T4 [1<<29 + 1]S
41
42func F4(t *T4) {
43 t[1<<29].B = 42
44}