Skip to content

Commit

Permalink
Fix mysterious failure of SupportTests FileCheckTest.Binop
Browse files Browse the repository at this point in the history
The test would fail in no-asserts release builds using MSVC
for 64-bit Windows:

Unexpected error message:
TestBuffer:1:1: error: implicit format conflict between 'FOO' (%u) and '18\0' (%x), need an explicit format specifier

Error message(s) not found:
{implicit format conflict between 'FOO' (%u) and 'BAZ' (%x), need an explicit format specifier}

It seems a string from a previous test case is finding its way
into the latter one.

This doesn't reproduce on master anymore after 998709b, so let's
just hack around it here for the branch.
  • Loading branch information
zmodem committed Sep 28, 2020
1 parent 2939249 commit eb83b55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/unittests/Support/FileCheckTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ TEST_F(FileCheckTest, Binop) {
Value = Binop.eval();
expectUndefErrors({"FOO", "BAR"}, Value.takeError());

{
// Literal + Variable has format of variable.
ExprStr = bufferize(SM, "FOO+18");
FooStr = ExprStr.take_front(3);
Expand All @@ -736,6 +737,7 @@ TEST_F(FileCheckTest, Binop) {
ImplicitFormat = Binop.getImplicitFormat(SM);
ASSERT_THAT_EXPECTED(ImplicitFormat, Succeeded());
EXPECT_EQ(*ImplicitFormat, ExpressionFormat::Kind::Unsigned);
}

// Variables with different implicit format conflict.
ExprStr = bufferize(SM, "FOO+BAZ");
Expand Down

0 comments on commit eb83b55

Please sign in to comment.