llvm.org GIT mirror llvm / 8211bec
Now that googletest can print ConstantRange, use EXPECT_EQ when testing for equality. Prefer EXPECT_EQ(foo, Full) over EXPECT_TRUE(foo.isFullSet()) because the former will print out the contents of the constant range that failed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81094 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 11 years ago
1 changed file(s) with 149 addition(s) and 149 deletion(s). Raw diff Collapse all Expand all
7878 }
7979
8080 TEST_F(ConstantRangeTest, Equality) {
81 EXPECT_TRUE(Full == Full);
82 EXPECT_TRUE(Empty == Empty);
83 EXPECT_TRUE(One == One);
84 EXPECT_TRUE(Some == Some);
85 EXPECT_TRUE(Wrap == Wrap);
86 EXPECT_TRUE(Full != Empty);
87 EXPECT_TRUE(Full != One);
88 EXPECT_TRUE(Full != Some);
89 EXPECT_TRUE(Full != Wrap);
90 EXPECT_TRUE(Empty != One);
91 EXPECT_TRUE(Empty != Some);
92 EXPECT_TRUE(Empty != Wrap);
93 EXPECT_TRUE(One != Some);
94 EXPECT_TRUE(One != Wrap);
95 EXPECT_TRUE(Some != Wrap);
81 EXPECT_EQ(Full, Full);
82 EXPECT_EQ(Empty, Empty);
83 EXPECT_EQ(One, One);
84 EXPECT_EQ(Some, Some);
85 EXPECT_EQ(Wrap, Wrap);
86 EXPECT_NE(Full, Empty);
87 EXPECT_NE(Full, One);
88 EXPECT_NE(Full, Some);
89 EXPECT_NE(Full, Wrap);
90 EXPECT_NE(Empty, One);
91 EXPECT_NE(Empty, Some);
92 EXPECT_NE(Empty, Wrap);
93 EXPECT_NE(One, Some);
94 EXPECT_NE(One, Wrap);
95 EXPECT_NE(Some, Wrap);
9696 }
9797
9898 TEST_F(ConstantRangeTest, SingleElement) {
151151 ConstantRange TWrap = Wrap.truncate(10);
152152 EXPECT_TRUE(TFull.isFullSet());
153153 EXPECT_TRUE(TEmpty.isEmptySet());
154 EXPECT_TRUE(TOne == ConstantRange(APInt(One.getLower()).trunc(10),
154 EXPECT_EQ(TOne, ConstantRange(APInt(One.getLower()).trunc(10),
155155 APInt(One.getUpper()).trunc(10)));
156156 EXPECT_TRUE(TSome.isFullSet());
157157 }
162162 ConstantRange ZOne = One.zeroExtend(20);
163163 ConstantRange ZSome = Some.zeroExtend(20);
164164 ConstantRange ZWrap = Wrap.zeroExtend(20);
165 EXPECT_TRUE(ZFull == ConstantRange(APInt(20, 0), APInt(20, 0x10000)));
165 EXPECT_EQ(ZFull, ConstantRange(APInt(20, 0), APInt(20, 0x10000)));
166166 EXPECT_TRUE(ZEmpty.isEmptySet());
167 EXPECT_TRUE(ZOne == ConstantRange(APInt(One.getLower()).zext(20),
168 APInt(One.getUpper()).zext(20)));
169 EXPECT_TRUE(ZSome == ConstantRange(APInt(Some.getLower()).zext(20),
170 APInt(Some.getUpper()).zext(20)));
171 EXPECT_TRUE(ZWrap == ConstantRange(APInt(Wrap.getLower()).zext(20),
172 APInt(Wrap.getUpper()).zext(20)));
167 EXPECT_EQ(ZOne, ConstantRange(APInt(One.getLower()).zext(20),
168 APInt(One.getUpper()).zext(20)));
169 EXPECT_EQ(ZSome, ConstantRange(APInt(Some.getLower()).zext(20),
170 APInt(Some.getUpper()).zext(20)));
171 EXPECT_EQ(ZWrap, ConstantRange(APInt(Wrap.getLower()).zext(20),
172 APInt(Wrap.getUpper()).zext(20)));
173173 }
174174
175175 TEST_F(ConstantRangeTest, SExt) {
178178 ConstantRange SOne = One.signExtend(20);
179179 ConstantRange SSome = Some.signExtend(20);
180180 ConstantRange SWrap = Wrap.signExtend(20);
181 EXPECT_TRUE(SFull == ConstantRange(APInt(20, (uint64_t)INT16_MIN, true),
182 APInt(20, INT16_MAX + 1, true)));
181 EXPECT_EQ(SFull, ConstantRange(APInt(20, (uint64_t)INT16_MIN, true),
182 APInt(20, INT16_MAX + 1, true)));
183183 EXPECT_TRUE(SEmpty.isEmptySet());
184 EXPECT_TRUE(SOne == ConstantRange(APInt(One.getLower()).sext(20),
185 APInt(One.getUpper()).sext(20)));
186 EXPECT_TRUE(SSome == ConstantRange(APInt(Some.getLower()).sext(20),
187 APInt(Some.getUpper()).sext(20)));
188 EXPECT_TRUE(SWrap == ConstantRange(APInt(Wrap.getLower()).sext(20),
189 APInt(Wrap.getUpper()).sext(20)));
184 EXPECT_EQ(SOne, ConstantRange(APInt(One.getLower()).sext(20),
185 APInt(One.getUpper()).sext(20)));
186 EXPECT_EQ(SSome, ConstantRange(APInt(Some.getLower()).sext(20),
187 APInt(Some.getUpper()).sext(20)));
188 EXPECT_EQ(SWrap, ConstantRange(APInt(Wrap.getLower()).sext(20),
189 APInt(Wrap.getUpper()).sext(20)));
190190 }
191191
192192 TEST_F(ConstantRangeTest, IntersectWith) {
193 EXPECT_TRUE(Empty.intersectWith(Full).isEmptySet());
194 EXPECT_TRUE(Empty.intersectWith(Empty).isEmptySet());
195 EXPECT_TRUE(Empty.intersectWith(One).isEmptySet());
196 EXPECT_TRUE(Empty.intersectWith(Some).isEmptySet());
197 EXPECT_TRUE(Empty.intersectWith(Wrap).isEmptySet());
198 EXPECT_TRUE(Full.intersectWith(Full).isFullSet());
199 EXPECT_TRUE(Some.intersectWith(Some) == Some);
200 EXPECT_TRUE(Some.intersectWith(One) == One);
201 EXPECT_TRUE(Full.intersectWith(One) == One);
202 EXPECT_TRUE(Full.intersectWith(Some) == Some);
203 EXPECT_TRUE(Some.intersectWith(Wrap).isEmptySet());
204 EXPECT_TRUE(One.intersectWith(Wrap).isEmptySet());
205 EXPECT_TRUE(One.intersectWith(Wrap) == Wrap.intersectWith(One));
193 EXPECT_EQ(Empty.intersectWith(Full), Empty);
194 EXPECT_EQ(Empty.intersectWith(Empty), Empty);
195 EXPECT_EQ(Empty.intersectWith(One), Empty);
196 EXPECT_EQ(Empty.intersectWith(Some), Empty);
197 EXPECT_EQ(Empty.intersectWith(Wrap), Empty);
198 EXPECT_EQ(Full.intersectWith(Full), Full);
199 EXPECT_EQ(Some.intersectWith(Some), Some);
200 EXPECT_EQ(Some.intersectWith(One), One);
201 EXPECT_EQ(Full.intersectWith(One), One);
202 EXPECT_EQ(Full.intersectWith(Some), Some);
203 EXPECT_EQ(Some.intersectWith(Wrap), Empty);
204 EXPECT_EQ(One.intersectWith(Wrap), Empty);
205 EXPECT_EQ(One.intersectWith(Wrap), Wrap.intersectWith(One));
206206
207207 // Klee generated testcase from PR4545.
208208 // The intersection of i16 [4, 2) and [6, 5) is disjoint, looking like
213213 }
214214
215215 TEST_F(ConstantRangeTest, UnionWith) {
216 EXPECT_TRUE(Wrap.unionWith(One) ==
217 ConstantRange(APInt(16, 0xaaa), APInt(16, 0xb)));
218 EXPECT_TRUE(One.unionWith(Wrap) == Wrap.unionWith(One));
219 EXPECT_TRUE(Empty.unionWith(Empty).isEmptySet());
220 EXPECT_TRUE(Full.unionWith(Full).isFullSet());
221 EXPECT_TRUE(Some.unionWith(Wrap).isFullSet());
216 EXPECT_EQ(Wrap.unionWith(One),
217 ConstantRange(APInt(16, 0xaaa), APInt(16, 0xb)));
218 EXPECT_EQ(One.unionWith(Wrap), Wrap.unionWith(One));
219 EXPECT_EQ(Empty.unionWith(Empty), Empty);
220 EXPECT_EQ(Full.unionWith(Full), Full);
221 EXPECT_EQ(Some.unionWith(Wrap), Full);
222222
223223 // PR4545
224 EXPECT_TRUE(ConstantRange(APInt(16, 14), APInt(16, 1)).unionWith(
225 ConstantRange(APInt(16, 0), APInt(16, 8))) ==
226 ConstantRange(APInt(16, 14), APInt(16, 8)));
227 EXPECT_TRUE(ConstantRange(APInt(16, 6), APInt(16, 4)).unionWith(
228 ConstantRange(APInt(16, 4), APInt(16, 0))) ==
224 EXPECT_EQ(ConstantRange(APInt(16, 14), APInt(16, 1)).unionWith(
225 ConstantRange(APInt(16, 0), APInt(16, 8))),
226 ConstantRange(APInt(16, 14), APInt(16, 8)));
227 EXPECT_EQ(ConstantRange(APInt(16, 6), APInt(16, 4)).unionWith(
228 ConstantRange(APInt(16, 4), APInt(16, 0))),
229229 ConstantRange(16));
230 EXPECT_TRUE(ConstantRange(APInt(16, 1), APInt(16, 0)).unionWith(
231 ConstantRange(APInt(16, 2), APInt(16, 1))) ==
230 EXPECT_EQ(ConstantRange(APInt(16, 1), APInt(16, 0)).unionWith(
231 ConstantRange(APInt(16, 2), APInt(16, 1))),
232232 ConstantRange(16));
233233 }
234234
235235 TEST_F(ConstantRangeTest, SubtractAPInt) {
236 EXPECT_TRUE(Full.subtract(APInt(16, 4)).isFullSet());
237 EXPECT_TRUE(Empty.subtract(APInt(16, 4)).isEmptySet());
238 EXPECT_TRUE(Some.subtract(APInt(16, 4)) ==
239 ConstantRange(APInt(16, 0x6), APInt(16, 0xaa6)));
240 EXPECT_TRUE(Wrap.subtract(APInt(16, 4)) ==
241 ConstantRange(APInt(16, 0xaa6), APInt(16, 0x6)));
242 EXPECT_TRUE(One.subtract(APInt(16, 4)) ==
243 ConstantRange(APInt(16, 0x6)));
236 EXPECT_EQ(Full.subtract(APInt(16, 4)), Full);
237 EXPECT_EQ(Empty.subtract(APInt(16, 4)), Empty);
238 EXPECT_EQ(Some.subtract(APInt(16, 4)),
239 ConstantRange(APInt(16, 0x6), APInt(16, 0xaa6)));
240 EXPECT_EQ(Wrap.subtract(APInt(16, 4)),
241 ConstantRange(APInt(16, 0xaa6), APInt(16, 0x6)));
242 EXPECT_EQ(One.subtract(APInt(16, 4)),
243 ConstantRange(APInt(16, 0x6)));
244244 }
245245
246246 TEST_F(ConstantRangeTest, Add) {
247 EXPECT_TRUE(Full.add(APInt(16, 4)).isFullSet());
248 EXPECT_TRUE(Full.add(Full) == Full);
249 EXPECT_TRUE(Full.add(Empty) == Empty);
250 EXPECT_TRUE(Full.add(One) == Full);
251 EXPECT_TRUE(Full.add(Some) == Full);
252 EXPECT_TRUE(Full.add(Wrap) == Full);
253 EXPECT_TRUE(Empty.add(Empty) == Empty);
254 EXPECT_TRUE(Empty.add(One) == Empty);
255 EXPECT_TRUE(Empty.add(Some) == Empty);
256 EXPECT_TRUE(Empty.add(Wrap) == Empty);
257 EXPECT_TRUE(Empty.add(APInt(16, 4)).isEmptySet());
258 EXPECT_TRUE(Some.add(APInt(16, 4)) ==
247 EXPECT_EQ(Full.add(APInt(16, 4)), Full);
248 EXPECT_EQ(Full.add(Full), Full);
249 EXPECT_EQ(Full.add(Empty), Empty);
250 EXPECT_EQ(Full.add(One), Full);
251 EXPECT_EQ(Full.add(Some), Full);
252 EXPECT_EQ(Full.add(Wrap), Full);
253 EXPECT_EQ(Empty.add(Empty), Empty);
254 EXPECT_EQ(Empty.add(One), Empty);
255 EXPECT_EQ(Empty.add(Some), Empty);
256 EXPECT_EQ(Empty.add(Wrap), Empty);
257 EXPECT_EQ(Empty.add(APInt(16, 4)), Empty);
258 EXPECT_EQ(Some.add(APInt(16, 4)),
259259 ConstantRange(APInt(16, 0xe), APInt(16, 0xaae)));
260 EXPECT_TRUE(Wrap.add(APInt(16, 4)) ==
260 EXPECT_EQ(Wrap.add(APInt(16, 4)),
261261 ConstantRange(APInt(16, 0xaae), APInt(16, 0xe)));
262 EXPECT_TRUE(One.add(APInt(16, 4)) ==
262 EXPECT_EQ(One.add(APInt(16, 4)),
263263 ConstantRange(APInt(16, 0xe)));
264264 }
265265
266266 TEST_F(ConstantRangeTest, Multiply) {
267 EXPECT_TRUE(Full.multiply(Full) == Full);
268 EXPECT_TRUE(Full.multiply(Empty) == Empty);
269 EXPECT_TRUE(Full.multiply(One) == Full);
270 EXPECT_TRUE(Full.multiply(Some) == Full);
271 EXPECT_TRUE(Full.multiply(Wrap) == Full);
272 EXPECT_TRUE(Empty.multiply(Empty) == Empty);
273 EXPECT_TRUE(Empty.multiply(One) == Empty);
274 EXPECT_TRUE(Empty.multiply(Some) == Empty);
275 EXPECT_TRUE(Empty.multiply(Wrap) == Empty);
276 EXPECT_TRUE(One.multiply(One) == ConstantRange(APInt(16, 0xa*0xa),
277 APInt(16, 0xa*0xa + 1)));
278 EXPECT_TRUE(One.multiply(Some) == ConstantRange(APInt(16, 0xa*0xa),
279 APInt(16, 0xa*0xaa9 + 1)));
280 EXPECT_TRUE(One.multiply(Wrap).isFullSet());
281 EXPECT_TRUE(Some.multiply(Some).isFullSet());
282 EXPECT_TRUE(Some.multiply(Wrap) == Full);
283 EXPECT_TRUE(Wrap.multiply(Wrap) == Full);
267 EXPECT_EQ(Full.multiply(Full), Full);
268 EXPECT_EQ(Full.multiply(Empty), Empty);
269 EXPECT_EQ(Full.multiply(One), Full);
270 EXPECT_EQ(Full.multiply(Some), Full);
271 EXPECT_EQ(Full.multiply(Wrap), Full);
272 EXPECT_EQ(Empty.multiply(Empty), Empty);
273 EXPECT_EQ(Empty.multiply(One), Empty);
274 EXPECT_EQ(Empty.multiply(Some), Empty);
275 EXPECT_EQ(Empty.multiply(Wrap), Empty);
276 EXPECT_EQ(One.multiply(One), ConstantRange(APInt(16, 0xa*0xa),
277 APInt(16, 0xa*0xa + 1)));
278 EXPECT_EQ(One.multiply(Some), ConstantRange(APInt(16, 0xa*0xa),
279 APInt(16, 0xa*0xaa9 + 1)));
280 EXPECT_EQ(One.multiply(Wrap), Full);
281 EXPECT_EQ(Some.multiply(Some), Full);
282 EXPECT_EQ(Some.multiply(Wrap), Full);
283 EXPECT_EQ(Wrap.multiply(Wrap), Full);
284284
285285 // http://llvm.org/PR4545
286 EXPECT_TRUE(ConstantRange(APInt(4, 1), APInt(4, 6)).multiply(
287 ConstantRange(APInt(4, 6), APInt(4, 2))) ==
288 ConstantRange(4, /*isFullSet=*/true));
286 EXPECT_EQ(ConstantRange(APInt(4, 1), APInt(4, 6)).multiply(
287 ConstantRange(APInt(4, 6), APInt(4, 2))),
288 ConstantRange(4, /*isFullSet=*/true));
289289 }
290290
291291 TEST_F(ConstantRangeTest, UMax) {
292 EXPECT_TRUE(Full.umax(Full).isFullSet());
293 EXPECT_TRUE(Full.umax(Empty).isEmptySet());
294 EXPECT_TRUE(Full.umax(Some) == ConstantRange(APInt(16, 0xa), APInt(16, 0)));
295 EXPECT_TRUE(Full.umax(Wrap).isFullSet());
296 EXPECT_TRUE(Full.umax(Some) == ConstantRange(APInt(16, 0xa), APInt(16, 0)));
297 EXPECT_TRUE(Empty.umax(Empty) == Empty);
298 EXPECT_TRUE(Empty.umax(Some) == Empty);
299 EXPECT_TRUE(Empty.umax(Wrap) == Empty);
300 EXPECT_TRUE(Empty.umax(One) == Empty);
301 EXPECT_TRUE(Some.umax(Some) == Some);
302 EXPECT_TRUE(Some.umax(Wrap) == ConstantRange(APInt(16, 0xa), APInt(16, 0)));
303 EXPECT_TRUE(Some.umax(One) == Some);
292 EXPECT_EQ(Full.umax(Full), Full);
293 EXPECT_EQ(Full.umax(Empty), Empty);
294 EXPECT_EQ(Full.umax(Some), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
295 EXPECT_EQ(Full.umax(Wrap), Full);
296 EXPECT_EQ(Full.umax(Some), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
297 EXPECT_EQ(Empty.umax(Empty), Empty);
298 EXPECT_EQ(Empty.umax(Some), Empty);
299 EXPECT_EQ(Empty.umax(Wrap), Empty);
300 EXPECT_EQ(Empty.umax(One), Empty);
301 EXPECT_EQ(Some.umax(Some), Some);
302 EXPECT_EQ(Some.umax(Wrap), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
303 EXPECT_EQ(Some.umax(One), Some);
304304 // TODO: ConstantRange is currently over-conservative here.
305 EXPECT_TRUE(Wrap.umax(Wrap) == Full);
306 EXPECT_TRUE(Wrap.umax(One) == ConstantRange(APInt(16, 0xa), APInt(16, 0)));
307 EXPECT_TRUE(One.umax(One) == One);
305 EXPECT_EQ(Wrap.umax(Wrap), Full);
306 EXPECT_EQ(Wrap.umax(One), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
307 EXPECT_EQ(One.umax(One), One);
308308 }
309309
310310 TEST_F(ConstantRangeTest, SMax) {
311 EXPECT_TRUE(Full.smax(Full).isFullSet());
312 EXPECT_TRUE(Full.smax(Empty).isEmptySet());
313 EXPECT_TRUE(Full.smax(Some) == ConstantRange(APInt(16, 0xa),
314 APInt::getSignedMinValue(16)));
315 EXPECT_TRUE(Full.smax(Wrap).isFullSet());
316 EXPECT_TRUE(Full.smax(One) == ConstantRange(APInt(16, 0xa),
317 APInt::getSignedMinValue(16)));
318 EXPECT_TRUE(Empty.smax(Empty) == Empty);
319 EXPECT_TRUE(Empty.smax(Some) == Empty);
320 EXPECT_TRUE(Empty.smax(Wrap) == Empty);
321 EXPECT_TRUE(Empty.smax(One) == Empty);
322 EXPECT_TRUE(Some.smax(Some) == Some);
323 EXPECT_TRUE(Some.smax(Wrap) == ConstantRange(APInt(16, 0xa),
324 APInt(16, (uint64_t)INT16_MIN)));
325 EXPECT_TRUE(Some.smax(One) == Some);
326 EXPECT_TRUE(Wrap.smax(One) == ConstantRange(APInt(16, 0xa),
327 APInt(16, (uint64_t)INT16_MIN)));
328 EXPECT_TRUE(One.smax(One) == One);
311 EXPECT_EQ(Full.smax(Full), Full);
312 EXPECT_EQ(Full.smax(Empty), Empty);
313 EXPECT_EQ(Full.smax(Some), ConstantRange(APInt(16, 0xa),
314 APInt::getSignedMinValue(16)));
315 EXPECT_EQ(Full.smax(Wrap), Full);
316 EXPECT_EQ(Full.smax(One), ConstantRange(APInt(16, 0xa),
317 APInt::getSignedMinValue(16)));
318 EXPECT_EQ(Empty.smax(Empty), Empty);
319 EXPECT_EQ(Empty.smax(Some), Empty);
320 EXPECT_EQ(Empty.smax(Wrap), Empty);
321 EXPECT_EQ(Empty.smax(One), Empty);
322 EXPECT_EQ(Some.smax(Some), Some);
323 EXPECT_EQ(Some.smax(Wrap), ConstantRange(APInt(16, 0xa),
324 APInt(16, (uint64_t)INT16_MIN)));
325 EXPECT_EQ(Some.smax(One), Some);
326 EXPECT_EQ(Wrap.smax(One), ConstantRange(APInt(16, 0xa),
327 APInt(16, (uint64_t)INT16_MIN)));
328 EXPECT_EQ(One.smax(One), One);
329329 }
330330
331331 TEST_F(ConstantRangeTest, UDiv) {
332 EXPECT_TRUE(Full.udiv(Full) == Full);
333 EXPECT_TRUE(Full.udiv(Empty) == Empty);
334 EXPECT_TRUE(Full.udiv(One) == ConstantRange(APInt(16, 0),
335 APInt(16, 0xffff / 0xa + 1)));
336 EXPECT_TRUE(Full.udiv(Some) == ConstantRange(APInt(16, 0),
337 APInt(16, 0xffff / 0xa + 1)));
338 EXPECT_TRUE(Full.udiv(Wrap) == Full);
339 EXPECT_TRUE(Empty.udiv(Empty) == Empty);
340 EXPECT_TRUE(Empty.udiv(One) == Empty);
341 EXPECT_TRUE(Empty.udiv(Some) == Empty);
342 EXPECT_TRUE(Empty.udiv(Wrap) == Empty);
343 EXPECT_TRUE(One.udiv(One) == ConstantRange(APInt(16, 1)));
344 EXPECT_TRUE(One.udiv(Some) == ConstantRange(APInt(16, 0), APInt(16, 2)));
345 EXPECT_TRUE(One.udiv(Wrap) == ConstantRange(APInt(16, 0), APInt(16, 0xb)));
346 EXPECT_TRUE(Some.udiv(Some) == ConstantRange(APInt(16, 0), APInt(16, 0x111)));
347 EXPECT_TRUE(Some.udiv(Wrap) == ConstantRange(APInt(16, 0), APInt(16, 0xaaa)));
348 EXPECT_TRUE(Wrap.udiv(Wrap) == Full);
332 EXPECT_EQ(Full.udiv(Full), Full);
333 EXPECT_EQ(Full.udiv(Empty), Empty);
334 EXPECT_EQ(Full.udiv(One), ConstantRange(APInt(16, 0),
335 APInt(16, 0xffff / 0xa + 1)));
336 EXPECT_EQ(Full.udiv(Some), ConstantRange(APInt(16, 0),
337 APInt(16, 0xffff / 0xa + 1)));
338 EXPECT_EQ(Full.udiv(Wrap), Full);
339 EXPECT_EQ(Empty.udiv(Empty), Empty);
340 EXPECT_EQ(Empty.udiv(One), Empty);
341 EXPECT_EQ(Empty.udiv(Some), Empty);
342 EXPECT_EQ(Empty.udiv(Wrap), Empty);
343 EXPECT_EQ(One.udiv(One), ConstantRange(APInt(16, 1)));
344 EXPECT_EQ(One.udiv(Some), ConstantRange(APInt(16, 0), APInt(16, 2)));
345 EXPECT_EQ(One.udiv(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xb)));
346 EXPECT_EQ(Some.udiv(Some), ConstantRange(APInt(16, 0), APInt(16, 0x111)));
347 EXPECT_EQ(Some.udiv(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xaaa)));
348 EXPECT_EQ(Wrap.udiv(Wrap), Full);
349349 }
350350
351351 } // anonymous namespace