16#include "llvm/ADT/STLFunctionalExtras.h"
30 for (
auto [Field, ChildLoc] :
RecordLoc->children()) {
31 if (Field->getName() ==
"assertion_result")
32 AssertionResultLoc = dyn_cast_or_null<RecordStorageLocation>(ChildLoc);
33 else if (Field->getName() ==
"expected_result")
34 ExpectedResultLoc = ChildLoc;
36 if (AssertionResultLoc ==
nullptr || ExpectedResultLoc ==
nullptr)
40 if (SuccessVal ==
nullptr || ExpectedVal ==
nullptr)
42 auto &A = Env.
arena();
44 Env.
assume(A.makeEquals(Res.formula(), A.makeEquals(SuccessVal->
formula(),
45 ExpectedVal->formula())));
56 ofClass(
hasName(
"testing::internal::AssertionResultExpectation")))));
llvm::MachO::RecordLoc RecordLoc
Represents a call to a member function that may be written either with member call syntax (e....
This represents one expression.
const Formula & formula() const
Holds the state of the program (store and heap) at a given program point.
BoolValue & makeAtomicBoolValue() const
Returns an atomic boolean value.
void assume(const Formula &)
Record a fact that must be true if this point in the program is reached.
void setValue(const StorageLocation &Loc, Value &Val)
Assigns Val as the value of Loc in the environment.
std::enable_if_t< std::is_base_of_v< StorageLocation, T >, T * > get(const ValueDecl &D) const
Returns the result of casting getStorageLocation(...) to a subclass of StorageLocation (using cast_or...
A storage location for a record (struct, class, or union).
Base class for elements of the local variable store and of the heap.
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
internal::Matcher< NamedDecl > hasName(StringRef Name)
Matches NamedDecl nodes that have the specified name.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
internal::Matcher< Stmt > StatementMatcher
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXThisExpr > cxxThisExpr
Matches implicit and explicit this expressions.
void transferAssertionResultExpectationOperatorBoolCall(const CXXMemberCallExpr *Expr, Environment &Env, llvm::function_ref< StorageLocation &(RecordStorageLocation &)> GetOk)
clang::ast_matchers::StatementMatcher isAssertionResultExpectationOperatorBoolCall()
RecordStorageLocation * getImplicitObjectLocation(const CXXMemberCallExpr &MCE, const Environment &Env)
Returns the storage location for the implicit object of a CXXMemberCallExpr, or null if none is defin...
Top level wrappers for InstallAPI frontend operations.