llvm.org GIT mirror llvm / 7377153
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 Justin Lebar 3 years ago
1 changed file(s) with 12 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
6969 EXPECT_TRUE(F1->hasLazyArguments());
7070 EXPECT_FALSE(F2->hasLazyArguments());
7171 unsigned I = 0;
72 for (Argument &A : F2->args())
73 EXPECT_EQ(Args[I++], &A);
72 for (Argument &A : F2->args()) {
73 EXPECT_EQ(Args[I], &A);
74 I++;
75 }
7476 EXPECT_EQ(2u, I);
7577
7678 // Check that arguments in F1 don't have pointer equality with the saved ones.
7779 // This also instantiates F1's arguments.
7880 I = 0;
79 for (Argument &A : F1->args())
80 EXPECT_NE(Args[I++], &A);
81 for (Argument &A : F1->args()) {
82 EXPECT_NE(Args[I], &A);
83 I++;
84 }
8185 EXPECT_EQ(2u, I);
8286 EXPECT_FALSE(F1->hasLazyArguments());
8387 EXPECT_FALSE(F2->hasLazyArguments());
8993 EXPECT_FALSE(F1->hasLazyArguments());
9094 EXPECT_TRUE(F2->hasLazyArguments());
9195 I = 0;
92 for (Argument &A : F1->args())
93 EXPECT_EQ(Args[I++], &A);
96 for (Argument &A : F1->args()) {
97 EXPECT_EQ(Args[I], &A);
98 I++;
99 }
94100 EXPECT_EQ(2u, I);
95101
96102 // Steal from F2 a second time. Now both functions should have lazy