Source file
test/fixedbugs/issue39505b.go
1
2
3
4
5
6
7 package main
8
9 func main() {
10 ff := []func(){lt_f1, lt_f2, lt_f3, lt_f4, lt_f5, lt_f6, lt_f7, lt_f8, lt_f9,
11 gt_f1, gt_f2, gt_f3, le_f1, le_f2, le_f3, ge_f1, ge_f2, ge_f3}
12
13 for _, f := range ff {
14 f()
15 }
16 }
17
18 func lt_f1() {
19 const c = 1
20 var a = 0
21 var v *int = &a
22 if *v-c < len([]int{}) {
23 } else {
24 panic("bad")
25 }
26 }
27
28 func lt_f2() {
29 const c = 10
30 var a = 0
31 var v *int = &a
32 if *v+c < len([]int{}) {
33 panic("bad")
34 }
35 }
36
37 func lt_f3() {
38 const c = -10
39 var a = 0
40 var v *int = &a
41 if *v|0xff+c < len([]int{}) {
42 panic("bad")
43 }
44 }
45
46 func lt_f4() {
47 const c = 10
48 var a = 0
49 var v *int = &a
50 if *v|0x0f+c < len([]int{}) {
51 panic("bad")
52 }
53 }
54
55 func lt_f5() {
56 const c int32 = 1
57 var a int32 = 0
58 var v *int32 = &a
59 if *v-c < int32(len([]int32{})) {
60 } else {
61 panic("bad")
62 }
63 }
64
65 func lt_f6() {
66 const c int32 = 10
67 var a int32 = 0
68 var v *int32 = &a
69 if *v+c < int32(len([]int32{})) {
70 panic("bad")
71 }
72 }
73
74 func lt_f7() {
75 const c int32 = -10
76 var a int32 = 0
77 var v *int32 = &a
78 if *v|0xff+c < int32(len([]int{})) {
79 panic("bad")
80 }
81 }
82
83 func lt_f8() {
84 const c int32 = 10
85 var a int32 = 0
86 var v *int32 = &a
87 if *v|0x0f+c < int32(len([]int{})) {
88 panic("bad")
89 }
90 }
91
92 func lt_f9() {
93 const c int32 = -10
94 var a int32 = 0
95 var v *int32 = &a
96 if *v|0x0a+c < int32(len([]int{})) {
97 panic("bad")
98 }
99 }
100
101 func gt_f1() {
102 const c = 1
103 var a = 0
104 var v *int = &a
105 if len([]int{}) > *v-c {
106 } else {
107 panic("bad")
108 }
109 }
110
111 func gt_f2() {
112 const c = 10
113 var a = 0
114 var v *int = &a
115 if len([]int{}) > *v|0x0f+c {
116 panic("bad")
117 }
118 }
119
120 func gt_f3() {
121 const c int32 = 10
122 var a int32 = 0
123 var v *int32 = &a
124 if int32(len([]int{})) > *v|0x0f+c {
125 panic("bad")
126 }
127 }
128
129 func le_f1() {
130 const c = -10
131 var a = 0
132 var v *int = &a
133 if *v|0xff+c <= len([]int{}) {
134 panic("bad")
135 }
136 }
137
138 func le_f2() {
139 const c = 0xf
140 var a = 0
141 var v *int = &a
142 if *v|0xf-c <= len([]int{}) {
143 } else {
144 panic("bad")
145 }
146 }
147
148 func le_f3() {
149 const c int32 = -10
150 var a int32 = 0
151 var v *int32 = &a
152 if *v|0xff+c <= int32(len([]int{})) {
153 panic("bad")
154 }
155 }
156
157 func ge_f1() {
158 const c = -10
159 var a = 0
160 var v *int = &a
161 if len([]int{}) >= *v|0xff+c {
162 panic("bad")
163 }
164 }
165
166 func ge_f2() {
167 const c int32 = 10
168 var a int32 = 0
169 var v *int32 = &a
170 if int32(len([]int{})) >= *v|0x0f+c {
171 panic("bad")
172 }
173 }
174
175 func ge_f3() {
176 const c = -10
177 var a = 0
178 var v *int = &a
179 if len([]int{}) >= *v|0x0a+c {
180 } else {
181 panic("bad")
182 }
183 }
184
View as plain text