Lines Matching defs:Wrap
25 static ConstantRange Wrap;
32 ConstantRange ConstantRangeTest::Wrap(APInt(16, 0xaaa), APInt(16, 0xa));
74 EXPECT_FALSE(Wrap.isFullSet());
75 EXPECT_FALSE(Wrap.isEmptySet());
76 EXPECT_TRUE(Wrap.isWrappedSet());
77 EXPECT_TRUE(Wrap.contains(APInt(16, 0x0)));
78 EXPECT_TRUE(Wrap.contains(APInt(16, 0x9)));
79 EXPECT_FALSE(Wrap.contains(APInt(16, 0xa)));
80 EXPECT_FALSE(Wrap.contains(APInt(16, 0xaa9)));
81 EXPECT_TRUE(Wrap.contains(APInt(16, 0xaaa)));
89 EXPECT_EQ(Wrap, Wrap);
93 EXPECT_NE(Full, Wrap);
96 EXPECT_NE(Empty, Wrap);
98 EXPECT_NE(One, Wrap);
99 EXPECT_NE(Some, Wrap);
107 EXPECT_EQ(Wrap.getSingleElement(), static_cast<APInt *>(NULL));
113 EXPECT_FALSE(Wrap.isSingleElement());
121 EXPECT_EQ(Wrap.getSetSize(), APInt(16, 0x10000 - 0xaa0));
128 EXPECT_EQ(Wrap.getUnsignedMax(), APInt(16, UINT16_MAX));
133 EXPECT_EQ(Wrap.getUnsignedMin(), APInt(16, 0));
138 EXPECT_EQ(Wrap.getSignedMax(), APInt(16, INT16_MAX));
143 EXPECT_EQ(Wrap.getSignedMin(), APInt(16, (uint64_t)INT16_MIN));
155 EXPECT_TRUE(Wrap.isSignWrappedSet());
171 ConstantRange TWrap = Wrap.truncate(10);
184 ConstantRange ZWrap = Wrap.zeroExtend(20);
199 ConstantRange SWrap = Wrap.signExtend(20);
219 EXPECT_EQ(Empty.intersectWith(Wrap), Empty);
225 EXPECT_EQ(Some.intersectWith(Wrap), Empty);
226 EXPECT_EQ(One.intersectWith(Wrap), Empty);
227 EXPECT_EQ(One.intersectWith(Wrap), Wrap.intersectWith(One));
238 EXPECT_EQ(Wrap.unionWith(One),
240 EXPECT_EQ(One.unionWith(Wrap), Wrap.unionWith(One));
243 EXPECT_EQ(Some.unionWith(Wrap), Full);
262 EXPECT_EQ(Wrap.subtract(APInt(16, 4)),
274 EXPECT_EQ(Full.add(Wrap), Full);
278 EXPECT_EQ(Empty.add(Wrap), Empty);
282 EXPECT_EQ(Wrap.add(APInt(16, 4)),
294 EXPECT_EQ(Full.sub(Wrap), Full);
298 EXPECT_EQ(Empty.sub(Wrap), Empty);
304 EXPECT_EQ(Wrap.sub(APInt(16, 4)),
315 EXPECT_EQ(Full.multiply(Wrap), Full);
319 EXPECT_EQ(Empty.multiply(Wrap), Empty);
324 EXPECT_EQ(One.multiply(Wrap), Full);
326 EXPECT_EQ(Some.multiply(Wrap), Full);
327 EXPECT_EQ(Wrap.multiply(Wrap), Full);
339 EXPECT_EQ(Full.umax(Wrap), Full);
343 EXPECT_EQ(Empty.umax(Wrap), Empty);
346 EXPECT_EQ(Some.umax(Wrap), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
349 EXPECT_EQ(Wrap.umax(Wrap), Full);
350 EXPECT_EQ(Wrap.umax(One), ConstantRange(APInt(16, 0xa), APInt(16, 0)));
359 EXPECT_EQ(Full.smax(Wrap), Full);
364 EXPECT_EQ(Empty.smax(Wrap), Empty);
367 EXPECT_EQ(Some.smax(Wrap), ConstantRange(APInt(16, 0xa),
370 EXPECT_EQ(Wrap.smax(One), ConstantRange(APInt(16, 0xa),
382 EXPECT_EQ(Full.udiv(Wrap), Full);
386 EXPECT_EQ(Empty.udiv(Wrap), Empty);
389 EXPECT_EQ(One.udiv(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xb)));
391 EXPECT_EQ(Some.udiv(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xaaa)));
392 EXPECT_EQ(Wrap.udiv(Wrap), Full);
400 EXPECT_EQ(Full.shl(Wrap), Full);
404 EXPECT_EQ(Empty.shl(Wrap), Empty);
408 EXPECT_EQ(One.shl(Wrap), Full); // TODO: [0xa, 0xa << 14 + 1)
410 EXPECT_EQ(Some.shl(Wrap), Full); // TODO: [0xa, 0x7ff << 0x5 + 1)
411 EXPECT_EQ(Wrap.shl(Wrap), Full);
421 EXPECT_EQ(Full.lshr(Wrap), Full);
425 EXPECT_EQ(Empty.lshr(Wrap), Empty);
428 EXPECT_EQ(One.lshr(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xb)));
431 EXPECT_EQ(Some.lshr(Wrap), ConstantRange(APInt(16, 0), APInt(16, 0xaaa)));
432 EXPECT_EQ(Wrap.lshr(Wrap), Full);