Delta Between Two Patch Sets: test/fixedbugs/issue4396a.go
Issue 6854063 :
code review 6854063: cmd/5g: use MOVB for fixed array nil check (Closed)
Left Patch Set: diff -r 11094b97d92a https://go.googlecode.com/hg/
Right Patch Set: diff -r 6e0e4077f488 https://go.googlecode.com/hg/
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
src/cmd/5g/cgen.c
test/fixedbugs/issue4396a.go
test/fixedbugs/issue4396b.go
LEFT RIGHT
(no file at all) 1 // 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
16 package main
17
18 var s = struct {
19 // based on lzw.decoder
20 a, b, c, d, e uint16
21 f [4096]uint8
22 g [4096]uint8
23 }{}
24
25 func main() {
26 s.g[0] = 1
27 }
LEFT RIGHT