Home | History | Annotate | Download | only in test

Lines Matching refs:unsafe

9 import "unsafe"
33 // Test unsafe.Sizeof, unsafe.Alignof, and unsafe.Offsetof all return uintptr.
34 isUintptr(unsafe.Sizeof(t))
35 isUintptr(unsafe.Alignof(t))
36 isUintptr(unsafe.Offsetof(t.X))
39 if unsafe.Offsetof(t2.C) != 8 {
40 println(unsafe.Offsetof(t2.C), "!= 8")
41 panic("unsafe.Offsetof(t2.C) != 8")
43 if unsafe.Offsetof(p2.C) != 8 {
44 println(unsafe.Offsetof(p2.C), "!= 8")
45 panic("unsafe.Offsetof(p2.C) != 8")
47 if unsafe.Offsetof(t2.U2.C) != 4 {
48 println(unsafe.Offsetof(t2.U2.C), "!= 4")
49 panic("unsafe.Offsetof(t2.U2.C) != 4")
51 if unsafe.Offsetof(p2.U2.C) != 4 {
52 println(unsafe.Offsetof(p2.U2.C), "!= 4")
53 panic("unsafe.Offsetof(p2.U2.C) != 4")
97 case unsafe.Offsetof(s1.A) != 0:
98 panic("unsafe.Offsetof(s1.A) != 0")
99 case unsafe.Offsetof(s1.B) != 8:
100 panic("unsafe.Offsetof(s1.B) != 8")
101 case unsafe.Offsetof(s1.C) != 16:
102 panic("unsafe.Offsetof(s1.C) != 16")
103 case unsafe.Offsetof(s1.D) != 24:
104 panic("unsafe.Offsetof(s1.D) != 24")
105 case unsafe.Offsetof(s1.E) != 32:
106 panic("unsafe.Offsetof(s1.E) != 32")
107 case unsafe.Offsetof(s1.F) != 40:
108 panic("unsafe.Offsetof(s1.F) != 40")
109 case unsafe.Offsetof(s1.G) != 48:
110 panic("unsafe.Offsetof(s1.G) != 48")
111 case unsafe.Offsetof(s1.H) != 56:
112 panic("unsafe.Offsetof(s1.H) != 56")
113 case unsafe.Offsetof(s1.S1) != 64:
114 panic("unsafe.Offsetof(s1.S1) != 64")
115 case unsafe.Offsetof(s1.S1.S2.S3.S4.S5.S6.S7.S8.S1.S2) != 8:
116 panic("unsafe.Offsetof(s1.S1.S2.S3.S4.S5.S6.S7.S8.S1.S2) != 8")
138 case unsafe.Offsetof(t.F.B) != 4:
139 panic("unsafe.Offsetof(t.F.B) != 4")
140 case unsafe.Offsetof(t.F.C) != 8:
141 panic("unsafe.Offsetof(t.F.C) != 8")
143 case unsafe.Offsetof(t.P.B) != 4:
144 panic("unsafe.Offsetof(t.P.B) != 4")
145 case unsafe.Offsetof(t.P.C) != 8:
146 panic("unsafe.Offsetof(t.P.C) != 8")
148 case unsafe.Offsetof(p.F.B) != 4:
149 panic("unsafe.Offsetof(p.F.B) != 4")
150 case unsafe.Offsetof(p.F.C) != 8:
151 panic("unsafe.Offsetof(p.F.C) != 8")
153 case unsafe.Offsetof(p.P.B) != 4:
154 panic("unsafe.Offsetof(p.P.B) != 4")
155 case unsafe.Offsetof(p.P.C) != 8:
156 panic("unsafe.Offsetof(p.P.C) != 8")