diff options
author | Justin Lebar <jlebar@google.com> | 2016-07-13 18:17:46 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-07-13 18:17:46 +0000 |
commit | 73771535f3d22c7f1f469294753a8c166cc8c0b7 (patch) | |
tree | 08b42c12d68c1f94ecb6a60acdbe5913457b3360 /unittests/IR | |
parent | c45e9127fc87ff7fba8e3a2f48c96c67bb163300 (diff) | |
download | llvm-73771535f3d22c7f1f469294753a8c166cc8c0b7.tar.gz |
Fix warnings in FunctionTest.cpp.
Because of the goop involved in the EXPECT_EQ macro, we were getting the
following warning
expression with side effects has no effect in an unevaluated context
because the "I++" was being used inside of a template type:
switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(Args[I++])) == 1)>::Compare("Args[I++]", "&A", Args[I++], &A))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "../src/unittests/IR/FunctionTest.cpp", 94, gtest_ar.failure_message()) = ::testing::Message();
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/IR')
-rw-r--r-- | unittests/IR/FunctionTest.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/unittests/IR/FunctionTest.cpp b/unittests/IR/FunctionTest.cpp index 8dd1f2bb00bf..fb458597c37a 100644 --- a/unittests/IR/FunctionTest.cpp +++ b/unittests/IR/FunctionTest.cpp @@ -70,15 +70,19 @@ TEST(FunctionTest, stealArgumentListFrom) { EXPECT_TRUE(F1->hasLazyArguments()); EXPECT_FALSE(F2->hasLazyArguments()); unsigned I = 0; - for (Argument &A : F2->args()) - EXPECT_EQ(Args[I++], &A); + for (Argument &A : F2->args()) { + EXPECT_EQ(Args[I], &A); + I++; + } EXPECT_EQ(2u, I); // Check that arguments in F1 don't have pointer equality with the saved ones. // This also instantiates F1's arguments. I = 0; - for (Argument &A : F1->args()) - EXPECT_NE(Args[I++], &A); + for (Argument &A : F1->args()) { + EXPECT_NE(Args[I], &A); + I++; + } EXPECT_EQ(2u, I); EXPECT_FALSE(F1->hasLazyArguments()); EXPECT_FALSE(F2->hasLazyArguments()); @@ -90,8 +94,10 @@ TEST(FunctionTest, stealArgumentListFrom) { EXPECT_FALSE(F1->hasLazyArguments()); EXPECT_TRUE(F2->hasLazyArguments()); I = 0; - for (Argument &A : F1->args()) - EXPECT_EQ(Args[I++], &A); + for (Argument &A : F1->args()) { + EXPECT_EQ(Args[I], &A); + I++; + } EXPECT_EQ(2u, I); // Steal from F2 a second time. Now both functions should have lazy |