[llvm-branch-commits] [llvm] eb83b55 - Fix mysterious failure of SupportTests FileCheckTest.Binop

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 28 06:37:40 PDT 2020


Author: Hans Wennborg
Date: 2020-09-28T15:35:06+02:00
New Revision: eb83b551d3eb08cf472fe6307fe3809a8005b2cc

URL: https://github.com/llvm/llvm-project/commit/eb83b551d3eb08cf472fe6307fe3809a8005b2cc
DIFF: https://github.com/llvm/llvm-project/commit/eb83b551d3eb08cf472fe6307fe3809a8005b2cc.diff

LOG: Fix mysterious failure of SupportTests FileCheckTest.Binop

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 998709b7d, so let's
just hack around it here for the branch.

Added: 
    

Modified: 
    llvm/unittests/Support/FileCheckTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/FileCheckTest.cpp b/llvm/unittests/Support/FileCheckTest.cpp
index 92975dcd76b7..a4591bc319bb 100644
--- a/llvm/unittests/Support/FileCheckTest.cpp
+++ b/llvm/unittests/Support/FileCheckTest.cpp
@@ -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);
@@ -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 
diff erent implicit format conflict.
   ExprStr = bufferize(SM, "FOO+BAZ");


        


More information about the llvm-branch-commits mailing list