diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2015-03-12 14:14:48 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2015-03-12 14:14:48 +0000 |
| commit | e9f931f974ca72725836427f7f0d9f80ac7dee14 (patch) | |
| tree | 3b9bbd6005db3d600fb29ceff27731a79507e9b1 /clang/unittests/ASTMatchers | |
| parent | 0c22d5a3392e21772ec7c29ba1bdc818f9ab61e5 (diff) | |
| download | bcm5719-llvm-e9f931f974ca72725836427f7f0d9f80ac7dee14.tar.gz bcm5719-llvm-e9f931f974ca72725836427f7f0d9f80ac7dee14.zip | |
Reverting r232034, as it broke one of the bots with link errors. Details at: http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/6352/steps/build/logs/stdio
llvm-svn: 232038
Diffstat (limited to 'clang/unittests/ASTMatchers')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 45 | ||||
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.h | 22 |
2 files changed, 2 insertions, 65 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 7edec96c0f3..d43e3f339b2 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -4714,50 +4714,5 @@ TEST(Matcher, IsExpansionInFileMatching) { #endif // LLVM_ON_WIN32 - -TEST(ObjCMessageExprMatcher, SimpleExprs) { - // don't find ObjCMessageExpr where none are present - EXPECT_TRUE(notMatchesObjC("", objcMessageExpr(anything()))); - - std::string Objc1String = - "@interface Str " - " - (Str *)uppercaseString:(Str *)str;" - "@end " - "@interface foo " - "- (void)meth:(Str *)text;" - "@end " - " " - "@implementation foo " - "- (void) meth:(Str *)text { " - " [self contents];" - " Str *up = [text uppercaseString];" - "} " - "@end "; - EXPECT_TRUE(matchesObjC( - Objc1String, - objcMessageExpr(anything()))); - EXPECT_TRUE(matchesObjC( - Objc1String, - objcMessageExpr(hasSelector("contents")))); - EXPECT_TRUE(matchesObjC( - Objc1String, - objcMessageExpr(matchesSelector("cont*")))); - EXPECT_FALSE(matchesObjC( - Objc1String, - objcMessageExpr(matchesSelector("?cont*")))); - EXPECT_TRUE(notMatchesObjC( - Objc1String, - objcMessageExpr(hasSelector("contents"), hasNullSelector()))); - EXPECT_TRUE(matchesObjC( - Objc1String, - objcMessageExpr(hasSelector("contents"), hasUnarySelector()))); - EXPECT_TRUE(matchesObjC( - Objc1String, - objcMessageExpr(matchesSelector("uppercase*"), - argumentCountIs(0) - ))); - -} - } // end namespace ast_matchers } // end namespace clang diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.h b/clang/unittests/ASTMatchers/ASTMatchersTest.h index 4befe4a129d..eb4cac5abc5 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.h +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.h @@ -62,8 +62,7 @@ template <typename T> testing::AssertionResult matchesConditionally( const std::string &Code, const T &AMatcher, bool ExpectMatch, llvm::StringRef CompileArg, - const FileContentMappings &VirtualMappedFiles = FileContentMappings(), - const std::string &Filename = "input.cc") { + const FileContentMappings &VirtualMappedFiles = FileContentMappings()) { bool Found = false, DynamicFound = false; MatchFinder Finder; VerifyMatch VerifyFound(nullptr, &Found); @@ -79,7 +78,7 @@ testing::AssertionResult matchesConditionally( // Some tests need rtti/exceptions on Args.push_back("-frtti"); Args.push_back("-fexceptions"); - if (!runToolOnCodeWithArgs(Factory->create(), Code, Args, Filename, + if (!runToolOnCodeWithArgs(Factory->create(), Code, Args, "input.cc", VirtualMappedFiles)) { return testing::AssertionFailure() << "Parsing error in \"" << Code << "\""; } @@ -110,23 +109,6 @@ testing::AssertionResult notMatches(const std::string &Code, return matchesConditionally(Code, AMatcher, false, "-std=c++11"); } -template <typename T> -testing::AssertionResult matchesObjC(const std::string &Code, - const T &AMatcher) { - return matchesConditionally( - Code, AMatcher, true, - "", FileContentMappings(), "input.m"); -} - -template <typename T> -testing::AssertionResult notMatchesObjC(const std::string &Code, - const T &AMatcher) { - return matchesConditionally( - Code, AMatcher, false, - "", FileContentMappings(), "input.m"); -} - - // Function based on matchesConditionally with "-x cuda" argument added and // small CUDA header prepended to the code string. template <typename T> |

