summaryrefslogtreecommitdiffstats
path: root/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-06-30 20:29:29 +0000
committerJustin Lebar <jlebar@google.com>2016-06-30 20:29:29 +0000
commitf042a1dff80b57583992e3c191c59c2347055fdc (patch)
tree66a820348225e45fad9c2d61dd3bc6ac3e45f0f6 /unittests/ASTMatchers/ASTMatchersNodeTest.cpp
parent9276143e24b079a90482999db58611a459501473 (diff)
Fix ASTMatchersNodeTest to work on Windows.
It was failing because it had an explicit check for whether we're on Windows. There are a few other similar explicit checks in this file which I didn't remove because they serve as reasonable documentation that the test doesn't work with a Windows triple. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersNodeTest.cpp')
-rw-r--r--unittests/ASTMatchers/ASTMatchersNodeTest.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index bf2c08a5aa..6c8a5e000f 100644
--- a/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -82,13 +82,11 @@ TEST(NameableDeclaration, REMatchesVariousDecls) {
TEST(DeclarationMatcher, MatchClass) {
DeclarationMatcher ClassMatcher(recordDecl());
- llvm::Triple Triple(llvm::sys::getDefaultTargetTriple());
- if (Triple.getOS() != llvm::Triple::Win32 ||
- Triple.getEnvironment() != llvm::Triple::MSVC)
- EXPECT_FALSE(matches("", ClassMatcher));
- else
- // Matches class type_info.
- EXPECT_TRUE(matches("", ClassMatcher));
+
+ // This passes on Windows only because we explicitly pass -target
+ // i386-unknown-unknown. If we were to compile with the default target
+ // triple, we'd want to EXPECT_TRUE if it's Win32 or MSVC.
+ EXPECT_FALSE(matches("", ClassMatcher));
DeclarationMatcher ClassX = recordDecl(recordDecl(hasName("X")));
EXPECT_TRUE(matches("class X;", ClassX));