summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorKristof Umann <kristof.umann@ericsson.com>2019-04-19 11:01:35 +0000
committerKristof Umann <kristof.umann@ericsson.com>2019-04-19 11:01:35 +0000
commitcd3f147439724c73991f667f435bef03508749e4 (patch)
treeb39b21e194e2b459cc644d49101bd1f0473e9677 /clang/test
parent99f641ccadcab1e5b98f6ad09a9344855cdf287a (diff)
downloadbcm5719-llvm-cd3f147439724c73991f667f435bef03508749e4.tar.gz
bcm5719-llvm-cd3f147439724c73991f667f435bef03508749e4.zip
[analyzer] Fix an assertion failure if plugins added dependencies
Ideally, there is no reason behind not being able to depend on checkers that come from a different plugin (or on builtin checkers) -- however, this is only possible if all checkers are added to the registry before resolving checker dependencies. Since I used a binary search in my addDependency method, this also resulted in an assertion failure (due to CheckerRegistry::Checkers not being sorted), since the function used by plugins to register their checkers (clang_registerCheckers) calls addDependency. This patch resolves this issue by only noting which dependencies have to established when addDependency is called, and resolves them at a later stage when no more checkers are added to the registry, by which point CheckerRegistry::Checkers is already sorted. Differential Revision: https://reviews.llvm.org/D59461 llvm-svn: 358750
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/checker-dependencies.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Analysis/checker-dependencies.c b/clang/test/Analysis/checker-dependencies.c
index efb636db22a..6c8583adb35 100644
--- a/clang/test/Analysis/checker-dependencies.c
+++ b/clang/test/Analysis/checker-dependencies.c
@@ -1,3 +1,20 @@
// RUN: %clang_analyze_cc1 %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=nullability.NullReturnedFromNonnull
+
+// RUN: %clang_analyze_cc1 %s \
+// RUN: -analyzer-checker=osx.cocoa.RetainCount \
+// RUN: -analyzer-list-enabled-checkers \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-IMPLICITLY-ENABLED
+
+// CHECK-IMPLICITLY-ENABLED: osx.cocoa.RetainCountBase
+// CHECK-IMPLICITLY-ENABLED: osx.cocoa.RetainCount
+
+// RUN: %clang_analyze_cc1 %s \
+// RUN: -analyzer-checker=osx.cocoa.RetainCount \
+// RUN: -analyzer-disable-checker=osx.cocoa.RetainCountBase \
+// RUN: -analyzer-list-enabled-checkers \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-IMPLICITLY-DISABLED
+
+// CHECK-IMPLICITLY-DISABLED-NOT: osx.cocoa.RetainCountBase
+// CHECK-IMPLICITLY-DISABLED-NOT: osx.cocoa.RetainCount
OpenPOWER on IntegriCloud