[llvm] r304695 - [ConstantRange] Add another truncate unittest for wrapped set staying a wrapped set.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 4 16:07:54 PDT 2017


Author: ctopper
Date: Sun Jun  4 18:07:53 2017
New Revision: 304695

URL: http://llvm.org/viewvc/llvm-project?rev=304695&view=rev
Log:
[ConstantRange] Add another truncate unittest for wrapped set staying a wrapped set.

Modified:
    llvm/trunk/unittests/IR/ConstantRangeTest.cpp

Modified: llvm/trunk/unittests/IR/ConstantRangeTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ConstantRangeTest.cpp?rev=304695&r1=304694&r2=304695&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/ConstantRangeTest.cpp (original)
+++ llvm/trunk/unittests/IR/ConstantRangeTest.cpp Sun Jun  4 18:07:53 2017
@@ -200,6 +200,10 @@ TEST_F(ConstantRangeTest, Trunc) {
   // trunc([5, 7), 3->2) = [1, 3)
   ConstantRange FiveSeven(APInt(3, 5), APInt(3, 7));
   EXPECT_EQ(FiveSeven.truncate(2), ConstantRange(APInt(2, 1), APInt(2, 3)));
+
+  // trunc([7, 1), 3->2) = [3, 1)
+  ConstantRange SevenOne(APInt(3, 7), APInt(3, 1));
+  EXPECT_EQ(SevenOne.truncate(2), ConstantRange(APInt(2, 3), APInt(2, 1)));
 }
 
 TEST_F(ConstantRangeTest, ZExt) {




More information about the llvm-commits mailing list