From 73b704dd9c694d3c4641befa20fa00a7fee06065 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 13 Jul 2009 02:49:08 +0000 Subject: Fix a bug summing two full sets. The overflow checking doesn't handle sets as large as the full set, only those one size smaller. Thanks to Daniel Dunbar who found this bug using Klee! llvm-svn: 75443 --- llvm/unittests/Support/ConstantRangeTest.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/unittests/Support') diff --git a/llvm/unittests/Support/ConstantRangeTest.cpp b/llvm/unittests/Support/ConstantRangeTest.cpp index 891c209f11c..cd91a9e103c 100644 --- a/llvm/unittests/Support/ConstantRangeTest.cpp +++ b/llvm/unittests/Support/ConstantRangeTest.cpp @@ -239,6 +239,7 @@ TEST_F(ConstantRangeTest, SubtractAPInt) { TEST_F(ConstantRangeTest, Add) { EXPECT_TRUE(Full.add(APInt(16, 4)).isFullSet()); + EXPECT_EQ(Full.add(Full), Full); EXPECT_EQ(Full.add(Empty), Empty); EXPECT_EQ(Full.add(One), Full); EXPECT_EQ(Full.add(Some), Full); -- cgit v1.2.3