]> granicus.if.org Git - clang/commitdiff
Removing the AST matcher test for thread_local storage duration. Not all platforms...
authorAaron Ballman <aaron@aaronballman.com>
Wed, 18 Nov 2015 18:37:29 +0000 (18:37 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 18 Nov 2015 18:37:29 +0000 (18:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253486 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ASTMatchers/ASTMatchersTest.cpp

index 6d81bd88b9e2ef7ef0da25335003a3ee43189a5b..2433d9faf1b9a44e62d59724b2b6ff8622350cbd 100644 (file)
@@ -1357,22 +1357,22 @@ TEST(Matcher, VarDecl_Storage) {
 
 TEST(Matcher, VarDecl_StorageDuration) {
   std::string T =
-      "void f() { int x; static int y; thread_local int z; } int a;";
+      "void f() { int x; static int y; } int a;";
 
   EXPECT_TRUE(matches(T, varDecl(hasName("x"), hasAutomaticStorageDuration())));
   EXPECT_TRUE(
       notMatches(T, varDecl(hasName("y"), hasAutomaticStorageDuration())));
-  EXPECT_TRUE(
-      notMatches(T, varDecl(hasName("z"), hasAutomaticStorageDuration())));
   EXPECT_TRUE(
       notMatches(T, varDecl(hasName("a"), hasAutomaticStorageDuration())));
 
   EXPECT_TRUE(matches(T, varDecl(hasName("y"), hasStaticStorageDuration())));
   EXPECT_TRUE(matches(T, varDecl(hasName("a"), hasStaticStorageDuration())));
   EXPECT_TRUE(notMatches(T, varDecl(hasName("x"), hasStaticStorageDuration())));
-  EXPECT_TRUE(notMatches(T, varDecl(hasName("z"), hasStaticStorageDuration())));
 
-  EXPECT_TRUE(matches(T, varDecl(hasName("z"), hasThreadStorageDuration())));
+  // FIXME: It is really hard to test with thread_local itself because not all
+  // targets support TLS, which causes this to be an error depending on what
+  // platform the test is being run on. We do not have access to the TargetInfo
+  // object to be able to test whether the platform supports TLS or not.
   EXPECT_TRUE(notMatches(T, varDecl(hasName("x"), hasThreadStorageDuration())));
   EXPECT_TRUE(notMatches(T, varDecl(hasName("y"), hasThreadStorageDuration())));
   EXPECT_TRUE(notMatches(T, varDecl(hasName("a"), hasThreadStorageDuration())));