~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to test/fixedbugs/bug465.dir/a.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2012 The Go Authors.  All rights reserved.
 
2
// Use of this source code is governed by a BSD-style
 
3
// license that can be found in the LICENSE file.
 
4
 
 
5
package a
 
6
 
 
7
type T struct{ A, B int }
 
8
 
 
9
type A []int
 
10
 
 
11
type M map[int]int
 
12
 
 
13
func F1() int {
 
14
        if (T{1, 2}) == (T{3, 4}) {
 
15
                return 1
 
16
        }
 
17
        return 0
 
18
}
 
19
 
 
20
func F2() int {
 
21
        if (M{1: 2}) == nil {
 
22
                return 1
 
23
        }
 
24
        return 0
 
25
}
 
26
 
 
27
func F3() int {
 
28
        if nil == (A{}) {
 
29
                return 1
 
30
        }
 
31
        return 0
 
32
}
 
33
 
 
34
func F4() int {
 
35
        if a := (A{}); a == nil {
 
36
                return 1
 
37
        }
 
38
        return 0
 
39
}
 
40
 
 
41
func F5() int {
 
42
        for k, v := range (M{1: 2}) {
 
43
                return v - k
 
44
        }
 
45
        return 0
 
46
}
 
47
 
 
48
func F6() int {
 
49
        switch a := (T{1, 1}); a == (T{1, 2}) {
 
50
        default:
 
51
                return 1
 
52
        }
 
53
        return 0
 
54
}
 
55
 
 
56
func F7() int {
 
57
        for m := (M{}); len(m) < (T{1, 2}).A; m[1] = (A{1})[0] {
 
58
                return 1
 
59
        }
 
60
        return 0
 
61
}
 
62
 
 
63
func F8() int {
 
64
        if a := (&T{1, 1}); a != nil {
 
65
                return 1
 
66
        }
 
67
        return 0
 
68
}
 
69
 
 
70
func F9() int {
 
71
        var a *T
 
72
        if a = (&T{1, 1}); a != nil {
 
73
                return 1
 
74
        }
 
75
        return 0
 
76
}