[llvm] 6ccacb4 - [NFC][ValueTracking] Cleanup a test
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 03:25:22 PDT 2020
Author: Vitaly Buka
Date: 2020-08-27T03:25:10-07:00
New Revision: 6ccacb4680e989b9ef2e9ae9e2a39dafca8d3014
URL: https://github.com/llvm/llvm-project/commit/6ccacb4680e989b9ef2e9ae9e2a39dafca8d3014
DIFF: https://github.com/llvm/llvm-project/commit/6ccacb4680e989b9ef2e9ae9e2a39dafca8d3014.diff
LOG: [NFC][ValueTracking] Cleanup a test
Added:
Modified:
llvm/unittests/Analysis/ValueTrackingTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp
index 44689172eaa4..198415711048 100644
--- a/llvm/unittests/Analysis/ValueTrackingTest.cpp
+++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp
@@ -1431,13 +1431,18 @@ TEST_F(ValueTrackingTest, ComputeConstantRange) {
}
}
+struct FindAllocaForValueTestParams {
+ const char *IR;
+ bool Result;
+};
+
class FindAllocaForValueTest
: public ValueTrackingTest,
- public ::testing::WithParamInterface<std::pair<const char *, bool>> {
+ public ::testing::WithParamInterface<FindAllocaForValueTestParams> {
protected:
};
-const std::pair<const char *, bool> FindAllocaForValueTests[] = {
+const FindAllocaForValueTestParams FindAllocaForValueTests[] = {
{R"(
define void @test() {
%a = alloca i64
@@ -1546,11 +1551,11 @@ const std::pair<const char *, bool> FindAllocaForValueTests[] = {
};
TEST_P(FindAllocaForValueTest, findAllocaForValue) {
- auto M = parseModule(GetParam().first);
+ auto M = parseModule(GetParam().IR);
Function *F = M->getFunction("test");
Instruction *I = &findInstructionByName(F, "r");
const AllocaInst *AI = findAllocaForValue(I);
- EXPECT_EQ(!!AI, GetParam().second);
+ EXPECT_EQ(!!AI, GetParam().Result);
}
INSTANTIATE_TEST_CASE_P(FindAllocaForValueTest, FindAllocaForValueTest,
More information about the llvm-commits
mailing list