Source file
test/fixedbugs/issue23305.go
1
2
3
4
5
6
7 package main
8
9 func mask1(a, b uint64) uint64 {
10 op1 := int32(a)
11 op2 := int32(b)
12 return uint64(uint32(op1 / op2))
13 }
14
15 var mask2 = mask1
16
17 func main() {
18 res1 := mask1(0x1, 0xfffffffeffffffff)
19 res2 := mask2(0x1, 0xfffffffeffffffff)
20 if res1 != 0xffffffff {
21 println("got", res1, "want", 0xffffffff)
22 panic("FAIL")
23 }
24 if res2 != 0xffffffff {
25 println("got", res2, "want", 0xffffffff)
26 panic("FAIL")
27 }
28 }
29
View as plain text