diff --git a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp --- a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp +++ b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp @@ -106,6 +106,10 @@ S = getAtomName(&cast(B)); break; } + case Value::Kind::TopBool: { + S = "top"; + break; + } case Value::Kind::Conjunction: { auto &C = cast(B); auto L = debugString(C.getLeftSubValue(), Depth + 1); diff --git a/clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp b/clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp --- a/clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp +++ b/clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp @@ -27,7 +27,14 @@ auto B = Ctx.atom(); auto Expected = R"(B0)"; - debugString(*B); + EXPECT_THAT(debugString(*B), StrEq(Expected)); +} + +TEST(BoolValueDebugStringTest, Top) { + ConstraintContext Ctx; + auto B = Ctx.top(); + + auto Expected = R"(top)"; EXPECT_THAT(debugString(*B), StrEq(Expected)); }