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

« back to all changes in this revision

Viewing changes to test/blank.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:
8
8
 
9
9
package main
10
10
 
 
11
import (
 
12
        "os"
 
13
        "unsafe"
 
14
)
 
15
 
11
16
import _ "fmt"
12
17
 
13
18
var call string
102
107
                panic(sum)
103
108
        }
104
109
 
 
110
        // exp/ssa/interp doesn't yet skip blank fields in struct
 
111
        // equivalence.  It also cannot support unsafe.Pointer.
 
112
        if os.Getenv("GOSSAINTERP") == "" {
 
113
                type T1 struct{ x, y, z int }
 
114
                t1 := *(*T)(unsafe.Pointer(&T1{1, 2, 3}))
 
115
                t2 := *(*T)(unsafe.Pointer(&T1{4, 5, 6}))
 
116
                if t1 != t2 {
 
117
                        panic("T{} != T{}")
 
118
                }
 
119
        }
 
120
 
105
121
        h(a, b)
106
 
        
 
122
 
107
123
        m()
108
124
}
109
125
 
113
129
 
114
130
type TI struct{}
115
131
 
116
 
func (TI) M(x int, y int) {
 
132
func (_ TI) M(x int, y int) {
117
133
        if x != y {
118
134
                println("invalid M call:", x, y)
119
135
                panic("bad M")
133
149
        }
134
150
}
135
151
 
136
 
 
137
152
func m() {
138
153
        var i I
139
 
        
 
154
 
140
155
        i = TI{}
141
156
        i.M(1, 1)
142
157
        i.M(2, 2)
143
 
        
 
158
 
144
159
        fp(1, 1)
145
160
        fp(2, 2)
146
161
}
162
177
func ff() {
163
178
        var _ int = 1
164
179
}
165