diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-15 18:08:06 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-15 18:08:06 +0000 |
commit | 8d92b8e905e310dc2088bdff787262d2d983a6a5 (patch) | |
tree | d00332e70c9f64e42d82671159fe560584343ff4 /llvm/unittests/IR/ConstantRangeTest.cpp | |
parent | 6867b1f7de1e56c3aadfe8c6fe4d08818e2cb809 (diff) | |
download | bcm5719-llvm-8d92b8e905e310dc2088bdff787262d2d983a6a5.tar.gz bcm5719-llvm-8d92b8e905e310dc2088bdff787262d2d983a6a5.zip |
[ConstantRange] Try to fix compiler warnings; NFC
Try to fix "ignoring return value" and "default label" errors on
clang-with-thin-lto-ubuntu buildbot.
llvm-svn: 356286
Diffstat (limited to 'llvm/unittests/IR/ConstantRangeTest.cpp')
-rw-r--r-- | llvm/unittests/IR/ConstantRangeTest.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp index b3e83c97422..393a810db7f 100644 --- a/llvm/unittests/IR/ConstantRangeTest.cpp +++ b/llvm/unittests/IR/ConstantRangeTest.cpp @@ -1318,9 +1318,9 @@ static void TestOverflowExhaustive(Fn1 OverflowFn, Fn2 MayOverflowFn) { bool RangeHasOverflow = false; bool RangeHasNoOverflow = false; APInt N1(Bits, Lo1); - for (unsigned I1 = 0; I1 < Size1; I1++, N1++) { + for (unsigned I1 = 0; I1 < Size1; ++I1, ++N1) { APInt N2(Bits, Lo2); - for (unsigned I2 = 0; I2 < Size2; I2++, N2++) { + for (unsigned I2 = 0; I2 < Size2; ++I2, ++N2) { assert(CR1.contains(N1)); assert(CR2.contains(N2)); @@ -1351,8 +1351,6 @@ static void TestOverflowExhaustive(Fn1 OverflowFn, Fn2 MayOverflowFn) { EXPECT_TRUE(RangeHasOverflow); EXPECT_TRUE(RangeHasNoOverflow); break; - default: - llvm_unreachable("Invalid enum return value"); } } } @@ -1364,7 +1362,7 @@ TEST_F(ConstantRangeTest, UnsignedAddOverflowExhautive) { TestOverflowExhaustive( [](const APInt &N1, const APInt &N2) { bool Overflow; - N1.uadd_ov(N2, Overflow); + (void) N1.uadd_ov(N2, Overflow); return Overflow; }, [](const ConstantRange &CR1, const ConstantRange &CR2) { @@ -1376,7 +1374,7 @@ TEST_F(ConstantRangeTest, UnsignedSubOverflowExhautive) { TestOverflowExhaustive( [](const APInt &N1, const APInt &N2) { bool Overflow; - N1.usub_ov(N2, Overflow); + (void) N1.usub_ov(N2, Overflow); return Overflow; }, [](const ConstantRange &CR1, const ConstantRange &CR2) { @@ -1388,7 +1386,7 @@ TEST_F(ConstantRangeTest, SignedAddOverflowExhautive) { TestOverflowExhaustive( [](const APInt &N1, const APInt &N2) { bool Overflow; - N1.sadd_ov(N2, Overflow); + (void) N1.sadd_ov(N2, Overflow); return Overflow; }, [](const ConstantRange &CR1, const ConstantRange &CR2) { @@ -1400,7 +1398,7 @@ TEST_F(ConstantRangeTest, SignedSubOverflowExhautive) { TestOverflowExhaustive( [](const APInt &N1, const APInt &N2) { bool Overflow; - N1.ssub_ov(N2, Overflow); + (void) N1.ssub_ov(N2, Overflow); return Overflow; }, [](const ConstantRange &CR1, const ConstantRange &CR2) { |