Cherry Zhang | b53f0f8 | 2017-02-03 20:54:52 -0500 | [diff] [blame] | 1 | // +build !386,!arm,!mips,!mipsle,!amd64p32 |
Rémy Oudompheng | 9c21ce5 | 2013-09-09 20:36:19 +0200 | [diff] [blame] | 2 | // compile |
| 3 | |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 4 | // Copyright 2013 The Go Authors. All rights reserved. |
Rémy Oudompheng | 9c21ce5 | 2013-09-09 20:36:19 +0200 | [diff] [blame] | 5 | // 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 | |
| 11 | package main |
| 12 | |
| 13 | type T struct { |
| 14 | Large [1 << 31]byte |
| 15 | A int |
| 16 | B int |
| 17 | } |
| 18 | |
| 19 | func F(t *T) { |
| 20 | t.B = t.A |
| 21 | } |
| 22 | |
| 23 | type T2 [1<<31 + 2]byte |
| 24 | |
| 25 | func F2(t *T2) { |
| 26 | t[1<<31+1] = 42 |
| 27 | } |
| 28 | |
| 29 | type T3 [1<<15 + 1][1<<15 + 1]int |
| 30 | |
| 31 | func F3(t *T3) { |
| 32 | t[1<<15][1<<15] = 42 |
| 33 | } |
| 34 | |
| 35 | type S struct { |
| 36 | A int32 |
| 37 | B int32 |
| 38 | } |
| 39 | |
| 40 | type T4 [1<<29 + 1]S |
| 41 | |
| 42 | func F4(t *T4) { |
| 43 | t[1<<29].B = 42 |
| 44 | } |