Lines Matching refs:Wrap
24 static ConstantRange Wrap;
31 ConstantRange ConstantRangeTest::Wrap(APInt(16, 0xaaa), APInt(16, 0xa));
73 EXPECT_FALSE(Wrap.isFullSet());
74 EXPECT_FALSE(Wrap.isEmptySet());
75 EXPECT_TRUE(Wrap.isWrappedSet());
76 EXPECT_TRUE(Wrap.contains(APInt(16, 0x0)));
77 EXPECT_TRUE(Wrap.contains(APInt(16, 0x9)));
78 EXPECT_FALSE(Wrap.contains(APInt(16, 0xa)));
79 EXPECT_FALSE(Wrap.contains(APInt(16, 0xaa9)));
80 EXPECT_TRUE(Wrap.contains(APInt(16, 0xaaa)));
88 EXPECT_EQ(Wrap, Wrap);
92 EXPECT_NE(Full, Wrap);
95 EXPECT_NE(Empty, Wrap);
97 EXPECT_NE(One, Wrap);
98 EXPECT_NE(Some, Wrap);
106 EXPECT_EQ(Wrap.getSingleElement(), static_cast<APInt *>(NULL));
112 EXPECT_FALSE(Wrap.isSingleElement());
121 ConstantRange Wrap(APInt(4, 7), APInt(4, 3));
123 EXPECT_EQ(Wrap.getSetSize(), APInt(5, 12));
131 EXPECT_EQ(Wrap.getUnsignedMax(), APInt(16, UINT16_MAX));
136 EXPECT_EQ(Wrap.getUnsignedMin(), APInt(16, 0));
141 EXPECT_EQ(Wrap.getSignedMax(), APInt(16, INT16_MAX));
146 EXPECT_EQ(Wrap.getSignedMin(), APInt(16, (uint64_t)INT16_MIN));
158 EXPECT_TRUE(Wrap.isSignWrappedSet());
174 ConstantRange TWrap = Wrap.truncate(10);
187 ConstantRange ZWrap = Wrap.zeroExtend(20);
206 ConstantRange SWrap = Wrap.signExtend(20);
226 EXPECT_EQ(Empty.intersectWith(Wrap), Empty);
232 EXPECT_EQ(Some.intersectWith(Wrap), Empty);
233 EXPECT_EQ(One.intersectWith(Wrap), Empty);
234 EXPECT_EQ(One.intersectWith(Wrap), Wrap.intersectWith(One));
280 EXPECT_EQ(Wrap.unionWith(One),
282 EXPECT_EQ(One.unionWith(Wrap), Wrap.unionWith(One));
285 EXPECT_EQ(Some.unionWith(Wrap), Full);
321 EXPECT_EQ(Wrap.subtract(APInt(16, 4)),
333 EXPECT_EQ(Full.add(Wrap), Full);
337 EXPECT_EQ(Empty.add(Wrap), Empty);
341 EXPECT_EQ(Wrap.add(APInt(16, 4)),
353 EXPECT_EQ(Full.sub(Wrap), Full);
357 EXPECT_EQ(Empty.sub(Wrap), Empty);
363 EXPECT_EQ(Wrap.sub(APInt(16, 4)),
374 EXPECT_EQ(Full.multiply(Wrap), Full);
378 EXPECT_EQ(Empty.multiply(Wrap), Empty);
383 EXPECT_EQ(One.multiply(Wrap), Full);
385 EXPECT_EQ(Some.multiply(Wrap), Full);
386 EXPECT_EQ(Wrap.multiply(Wrap), Full);
391 EXPECT_EQ(Zero.multiply(Wrap), Zero);
394 EXPECT_EQ(Wrap.multiply(Zero), Zero);
406 EXPECT_EQ(Full.umax(Wrap), Full);
410 EXPECT_EQ(Empty.umax(Wrap), Empty);
413 EXPECT_EQ(Some.umax(Wrap), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
416 EXPECT_EQ(WrapWrap), Full);
417 EXPECT_EQ(Wrap.umax(One), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
426 EXPECT_EQ(Full.smax(Wrap), Full);
431 EXPECT_EQ(Empty.smax(Wrap), Empty);
434 EXPECT_EQ(Some.smax(Wrap), ConstantRange(APInt(16, 0xa),
437 EXPECT_EQ(Wrap.smax(One), ConstantRange(APInt(16, 0xa),
449 EXPECT_EQ(Full.udiv(Wrap), Full);
453 EXPECT_EQ(Empty.udiv(Wrap), Empty);
456 EXPECT_EQ(One.udiv(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xb)));
458 EXPECT_EQ(Some.udiv(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xaaa)));
459 EXPECT_EQ(Wrap.udiv(Wrap), Full);
467 EXPECT_EQ(Full.shl(Wrap), Full);
471 EXPECT_EQ(Empty.shl(Wrap), Empty);
475 EXPECT_EQ(One.shl(Wrap), Full); // TODO: [0xa, 0xa << 14 + 1)
477 EXPECT_EQ(Some.shl(Wrap), Full); // TODO: [0xa, 0x7ff << 0x5 + 1)
478 EXPECT_EQ(Wrap.shl(Wrap), Full);
488 EXPECT_EQ(Full.lshr(Wrap), Full);
492 EXPECT_EQ(Empty.lshr(Wrap), Empty);
495 EXPECT_EQ(One.lshr(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xb)));
498 EXPECT_EQ(Some.lshr(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xaaa)));
499 EXPECT_EQ(Wrap.lshr(Wrap), Full);