blob: 11ae1f7c6c6dcdbbf8cf4633664751a46b07bef0 [file] [log] [blame]
Dave Cheney54e8d502012-12-06 08:01:33 +11001// run
2
3// Copyright 2012 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Issue 4396. Arrays of bytes are not required to be
8// word aligned. 5g should use MOVB to load the address
9// of s.g[0] for its nil check.
10//
11// This test _may_ fail on arm, but requires the host to
12// trap unaligned loads. This is generally done with
13//
14// echo "4" > /proc/cpu/alignment
15
16package main
17
18var s = struct {
19 // based on lzw.decoder
20 a, b, c, d, e uint16
21 f [4096]uint8
22 g [4096]uint8
23}{}
24
25func main() {
26 s.g[0] = 1
27}