Source file
test/fixedbugs/issue21655.go
1
2
3
4
5
6
7
8
9
10
11
12
13 package main
14
15 func f1(a []int64, i int64) int64 {
16 return a[i+1<<30]
17 }
18 func f2(a []int32, i int64) int32 {
19 return a[i+1<<30]
20 }
21 func f3(a []int16, i int64) int16 {
22 return a[i+1<<30]
23 }
24 func f4(a []int8, i int64) int8 {
25 return a[i+1<<31]
26 }
27 func f5(a []float64, i int64) float64 {
28 return a[i+1<<30]
29 }
30 func f6(a []float32, i int64) float32 {
31 return a[i+1<<30]
32 }
33
34
35
36
37
38
39
40
41
42 func f7(ss []*string, i int) string {
43 const offset = 3 << 29
44 if i > offset {
45 return *ss[i-offset]
46 }
47 return ""
48 }
49 func f8(ss []*string, i int) string {
50 const offset = 3<<29 + 10
51 if i > offset {
52 return *ss[i-offset]
53 }
54 return ""
55 }
56 func f9(ss []*string, i int) string {
57 const offset = 3<<29 - 10
58 if i > offset {
59 return *ss[i-offset]
60 }
61 return ""
62 }
63
View as plain text