~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to test/fixedbugs/bug440_64.go

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// run
 
2
 
 
3
// Test for 6g register move bug.  The optimizer gets confused
 
4
// about 32- vs 64-bit moves during splitContractIndex.
 
5
 
 
6
// Issue 3918.
 
7
 
 
8
package main
 
9
 
 
10
func main() {
 
11
        const c = 0x123400005678
 
12
        index, offset := splitContractIndex(c)
 
13
        if index != (c&0xffffffff)>>5 || offset != c+1 {
 
14
                println("BUG", index, offset)
 
15
        }
 
16
}
 
17
 
 
18
func splitContractIndex(ce uint64) (index uint32, offset uint64) {
 
19
        h := uint32(ce)
 
20
        return h >> 5, ce + 1
 
21
}