summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/AST/ASTImporterTest.cpp22
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp4
2 files changed, 10 insertions, 16 deletions
diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp
index f5dee659e0e..c8a5ddffce9 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -225,20 +225,14 @@ TEST(ImportExpr, ImportCXXThisExpr) {
TEST(ImportExpr, ImportAtomicExpr) {
MatchVerifier<Decl> Verifier;
- EXPECT_TRUE(
- testImport(
- "void declToImport() { int *ptr; __atomic_load_n(ptr, 1); }",
- Lang_CXX, "", Lang_CXX, Verifier,
- functionDecl(
- hasBody(
- compoundStmt(
- has(
- atomicExpr(
- has(declRefExpr(
- hasDeclaration(varDecl(hasName("ptr"))),
- hasType(asString("int *")))),
- has(integerLiteral(equals(1), hasType(asString("int"))))
- )))))));
+ EXPECT_TRUE(testImport(
+ "void declToImport() { int *ptr; __atomic_load_n(ptr, 1); }", Lang_CXX,
+ "", Lang_CXX, Verifier,
+ functionDecl(hasBody(compoundStmt(has(atomicExpr(
+ has(ignoringParenImpCasts(
+ declRefExpr(hasDeclaration(varDecl(hasName("ptr"))),
+ hasType(asString("int *"))))),
+ has(integerLiteral(equals(1), hasType(asString("int")))))))))));
}
TEST(ImportExpr, ImportLabelDeclAndAddrLabelExpr) {
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index 481b7e3041d..cc5cf715a70 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -122,8 +122,8 @@ TEST(Has, MatchesChildTypes) {
TEST(StatementMatcher, Has) {
StatementMatcher HasVariableI =
- expr(hasType(pointsTo(recordDecl(hasName("X")))),
- has(declRefExpr(to(varDecl(hasName("i"))))));
+ expr(hasType(pointsTo(recordDecl(hasName("X")))),
+ has(ignoringParenImpCasts(declRefExpr(to(varDecl(hasName("i")))))));
EXPECT_TRUE(matches(
"class X; X *x(int); void c() { int i; x(i); }", HasVariableI));
OpenPOWER on IntegriCloud