Adding new AST matcher: gnuNullExpr
It matches GNU __null expression. llvm-svn: 236731
This commit is contained in:
parent
9c95013e8f
commit
1d068bb254
|
@ -1441,6 +1441,11 @@ const internal::VariadicDynCastAllOfMatcher<
|
|||
Stmt,
|
||||
CXXNullPtrLiteralExpr> nullPtrLiteralExpr;
|
||||
|
||||
/// \brief Matches GNU __null expression.
|
||||
const internal::VariadicDynCastAllOfMatcher<
|
||||
Stmt,
|
||||
GNUNullExpr> gnuNullExpr;
|
||||
|
||||
/// \brief Matches binary operator expressions.
|
||||
///
|
||||
/// Example matches a || b
|
||||
|
|
|
@ -2144,6 +2144,10 @@ TEST(Matcher, NullPtrLiteral) {
|
|||
EXPECT_TRUE(matches("int* i = nullptr;", nullPtrLiteralExpr()));
|
||||
}
|
||||
|
||||
TEST(Matcher, GNUNullExpr) {
|
||||
EXPECT_TRUE(matches("int* i = __null;", gnuNullExpr()));
|
||||
}
|
||||
|
||||
TEST(Matcher, AsmStatement) {
|
||||
EXPECT_TRUE(matches("void foo() { __asm(\"mov al, 2\"); }", asmStmt()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue