Skip to content

Commit

Permalink
[VPlan] Move test strs to variables, silence spurious C4129 (NFC).
Browse files Browse the repository at this point in the history
This is a speculative fix to silence the spurious C4129 warning that
some version of MSVC generate for the raw string literals in the changed
files.

Before disabling the warning (D76428), try a potential fix suggested in
the review.
  • Loading branch information
fhahn committed Mar 31, 2020
1 parent 2539b4a commit 6120cb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
Expand Up @@ -94,7 +94,7 @@ TEST_F(VPlanHCFGTest, testBuildHCFGInnerLoop) {
Plan->addVPValue(&*F->arg_begin());
std::string FullDump;
raw_string_ostream(FullDump) << *Plan;
EXPECT_EQ(R"(digraph VPlan {
const char *ExpectedStr = R"(digraph VPlan {
graph [labelloc=t, fontsize=30; label="Vectorization Plan"]
node [shape=rect, fontname=Courier, fontsize=30]
edge [fontname=Courier, fontsize=30]
Expand Down Expand Up @@ -125,8 +125,8 @@ compound=true
]
}
}
)",
FullDump);
)";
EXPECT_EQ(ExpectedStr, FullDump);

LoopVectorizationLegality::InductionList Inductions;
SmallPtrSet<Instruction *, 1> DeadInstructions;
Expand Down
6 changes: 3 additions & 3 deletions llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
Expand Up @@ -209,7 +209,7 @@ TEST(VPBasicBlockTest, print) {
std::string FullDump;
raw_string_ostream(FullDump) << Plan;

EXPECT_EQ(R"(digraph VPlan {
const char *ExpectedStr = R"(digraph VPlan {
graph [labelloc=t, fontsize=30; label="Vectorization Plan"]
node [shape=rect, fontname=Courier, fontsize=30]
edge [fontname=Courier, fontsize=30]
Expand All @@ -227,8 +227,8 @@ compound=true
"EMIT ret vp<%2>\l"
]
}
)",
FullDump);
)";
EXPECT_EQ(ExpectedStr, FullDump);

{
std::string I3Dump;
Expand Down

0 comments on commit 6120cb4

Please sign in to comment.