From: Ted Kremenek Date: Mon, 6 Jul 2009 21:58:46 +0000 (+0000) Subject: Make 'BasicStoreManager' + 'NewCastRegion' testable from the command line using ... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1cea75e70d76f55157749a7bcad319050492945;p=clang Make 'BasicStoreManager' + 'NewCastRegion' testable from the command line using '-analyzer-store=basic-new-cast'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74865 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h index 44f13b37d9..35be4c0d93 100644 --- a/include/clang/Analysis/PathSensitive/Store.h +++ b/include/clang/Analysis/PathSensitive/Store.h @@ -219,6 +219,7 @@ public: // FIXME: Do we need to pass GRStateManager anymore? StoreManager *CreateBasicStoreManager(GRStateManager& StMgr); +StoreManager *CreateBasicStoreNewCastManager(GRStateManager& StMgr); StoreManager *CreateRegionStoreManager(GRStateManager& StMgr); StoreManager *CreateFieldsOnlyRegionStoreManager(GRStateManager& StMgr); diff --git a/include/clang/Frontend/Analyses.def b/include/clang/Frontend/Analyses.def index ad799c3a8b..47466a0e65 100644 --- a/include/clang/Frontend/Analyses.def +++ b/include/clang/Frontend/Analyses.def @@ -49,6 +49,7 @@ ANALYSIS(CheckerCFRef, "checker-cfref", #endif ANALYSIS_STORE(BasicStore, "basic", "Use basic analyzer store", CreateBasicStoreManager) +ANALYSIS_STORE(BasicStoreNewCast, "basic-new-cast", "Use basic analyzer store with new CastRegion", CreateBasicStoreNewCastManager) ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store", CreateRegionStoreManager) #ifndef ANALYSIS_CONSTRAINTS diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index 19d641ee97..c897b2f3fc 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -38,8 +38,8 @@ class VISIBILITY_HIDDEN BasicStoreManager : public StoreManager { const MemRegion* SelfRegion; public: - BasicStoreManager(GRStateManager& mgr) - : StoreManager(mgr), + BasicStoreManager(GRStateManager& mgr, bool useNewCastRegion = false) + : StoreManager(mgr, useNewCastRegion), VBFactory(mgr.getAllocator()), SelfRegion(0) {} @@ -126,6 +126,10 @@ StoreManager* clang::CreateBasicStoreManager(GRStateManager& StMgr) { return new BasicStoreManager(StMgr); } +StoreManager* clang::CreateBasicStoreNewCastManager(GRStateManager& StMgr) { + return new BasicStoreManager(StMgr, true); +} + SVal BasicStoreManager::getLValueVar(const GRState *state, const VarDecl* VD) { return ValMgr.makeLoc(MRMgr.getVarRegion(VD)); } diff --git a/test/Analysis/CFDateGC.m b/test/Analysis/CFDateGC.m index dfc736627b..ff7978283c 100644 --- a/test/Analysis/CFDateGC.m +++ b/test/Analysis/CFDateGC.m @@ -1,6 +1,9 @@ -// RUN: clang-cc -analyze -checker-cfref -verify -fobjc-gc -analyzer-constraints=basic %s && -// RUN: clang-cc -analyze -checker-cfref -verify -fobjc-gc -analyzer-constraints=range %s && -// RUN: clang-cc -analyze -checker-cfref -verify -fobjc-gc -disable-free %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify -fobjc-gc -analyzer-constraints=basic %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=range %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify -fobjc-gc -analyzer-constraints=range %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -disable-free %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify -fobjc-gc -disable-free %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s diff --git a/test/Analysis/CFNumber.c b/test/Analysis/CFNumber.c index f62d2ab569..c740abf82e 100644 --- a/test/Analysis/CFNumber.c +++ b/test/Analysis/CFNumber.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s diff --git a/test/Analysis/CFRetainRelease_NSAssertionHandler.m b/test/Analysis/CFRetainRelease_NSAssertionHandler.m index 1ff950725c..419dfc5a1e 100644 --- a/test/Analysis/CFRetainRelease_NSAssertionHandler.m +++ b/test/Analysis/CFRetainRelease_NSAssertionHandler.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic && +// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic-new-cast && // RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic && +// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic-new-cast && // RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=region && // RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=region diff --git a/test/Analysis/CGColorSpace.c b/test/Analysis/CGColorSpace.c index 2887d47c51..ca3003ba89 100644 --- a/test/Analysis/CGColorSpace.c +++ b/test/Analysis/CGColorSpace.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/CheckNSError.m b/test/Analysis/CheckNSError.m index 779b865aff..d55f5eb77f 100644 --- a/test/Analysis/CheckNSError.m +++ b/test/Analysis/CheckNSError.m @@ -1,6 +1,8 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/NSPanel.m b/test/Analysis/NSPanel.m index c4d4c22540..4e02259e80 100644 --- a/test/Analysis/NSPanel.m +++ b/test/Analysis/NSPanel.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/NSString.m b/test/Analysis/NSString.m index b707071990..24009ddecc 100644 --- a/test/Analysis/NSString.m +++ b/test/Analysis/NSString.m @@ -1,5 +1,7 @@ // RUN: clang-cc -triple i386-pc-linux-gnu -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && -// RUN: clang-cc -triple i386-pc-linux-gnu -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s +// RUN: clang-cc -triple i386-pc-linux-gnu -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -triple i386-pc-linux-gnu -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -triple i386-pc-linux-gnu -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s // NOTWORK: clang-cc -triple i386-pc-linux-gnu -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && diff --git a/test/Analysis/NSWindow.m b/test/Analysis/NSWindow.m index 9609c5260f..621151e041 100644 --- a/test/Analysis/NSWindow.m +++ b/test/Analysis/NSWindow.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/NoReturn.m b/test/Analysis/NoReturn.m index 5f5ce281a7..802fc6eb5b 100644 --- a/test/Analysis/NoReturn.m +++ b/test/Analysis/NoReturn.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/ObjCProperties.m b/test/Analysis/ObjCProperties.m index 3ad256914a..d26ebf3940 100644 --- a/test/Analysis/ObjCProperties.m +++ b/test/Analysis/ObjCProperties.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic %s -verify && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic %s -verify && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range %s -verify && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range %s -verify && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic %s -verify && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range %s -verify diff --git a/test/Analysis/PR2599.m b/test/Analysis/PR2599.m index 098bfe8e85..e3fbfa6759 100644 --- a/test/Analysis/PR2599.m +++ b/test/Analysis/PR2599.m @@ -1,6 +1,9 @@ // RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s && +// RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic-new-cast -checker-cfref -fobjc-gc -verify %s && // RUN: clang-cc -analyze -analyzer-constraints=range -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s && +// RUN: clang-cc -analyze -analyzer-constraints=range -analyzer-store=basic-new-cast -checker-cfref -fobjc-gc -verify %s && // RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s && +// RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic-new-cast -checker-cfref -fobjc-gc -verify %s && // RUN: clang-cc -analyze -analyzer-constraints=range -analyzer-store=region -checker-cfref -fobjc-gc -verify %s typedef const void * CFTypeRef; diff --git a/test/Analysis/PR3991.m b/test/Analysis/PR3991.m index 20d4b5b960..e9a9d547d8 100644 --- a/test/Analysis/PR3991.m +++ b/test/Analysis/PR3991.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c index da7df4b28e..07abbcafd3 100644 --- a/test/Analysis/array-struct.c +++ b/test/Analysis/array-struct.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && -// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s // RegionStore now has an infinite recursion with this test case. // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && diff --git a/test/Analysis/basicstore_wine_crash.c b/test/Analysis/basicstore_wine_crash.c index cb5fac8d29..8692f2d50d 100644 --- a/test/Analysis/basicstore_wine_crash.c +++ b/test/Analysis/basicstore_wine_crash.c @@ -1,4 +1,5 @@ -// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic %s +// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic %s && +// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic-new-cast %s // Once xfail_regionstore_wine_crash.c passes, move this test case // into misc-ps.m. diff --git a/test/Analysis/casts.m b/test/Analysis/casts.m index 82c29fac90..f435d64923 100644 --- a/test/Analysis/casts.m +++ b/test/Analysis/casts.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic --verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast --verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s // Test function pointer casts. Currently we track function addresses using diff --git a/test/Analysis/cfref_PR2519.c b/test/Analysis/cfref_PR2519.c index 695123b533..fdd174a294 100644 --- a/test/Analysis/cfref_PR2519.c +++ b/test/Analysis/cfref_PR2519.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/cfref_rdar6080742.c b/test/Analysis/cfref_rdar6080742.c index 5d957615d0..a6567c0224 100644 --- a/test/Analysis/cfref_rdar6080742.c +++ b/test/Analysis/cfref_rdar6080742.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/complex.c b/test/Analysis/complex.c index cef624577a..dd5e09a361 100644 --- a/test/Analysis/complex.c +++ b/test/Analysis/complex.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/concrete-address.c b/test/Analysis/concrete-address.c index 84ebb21805..acc5e55ee6 100644 --- a/test/Analysis/concrete-address.c +++ b/test/Analysis/concrete-address.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic --verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast --verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s void foo() { diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c index 6d3b7e6f54..d7e9f5cb0c 100644 --- a/test/Analysis/dead-stores.c +++ b/test/Analysis/dead-stores.c @@ -1,6 +1,8 @@ // RUN: clang-cc -analyze -warn-dead-stores -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=basic -warn-dead-stores -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -analyzer-constraints=range -warn-dead-stores -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -warn-dead-stores -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s diff --git a/test/Analysis/delegates.m b/test/Analysis/delegates.m index 440f31113c..30f7d81653 100644 --- a/test/Analysis/delegates.m +++ b/test/Analysis/delegates.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s diff --git a/test/Analysis/exercise-ps.c b/test/Analysis/exercise-ps.c index c309349ab3..a36b8e6e03 100644 --- a/test/Analysis/exercise-ps.c +++ b/test/Analysis/exercise-ps.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s // // Just exercise the analyzer on code that has at one point caused issues diff --git a/test/Analysis/fields.c b/test/Analysis/fields.c index 900a6d6869..a180e257bc 100644 --- a/test/Analysis/fields.c +++ b/test/Analysis/fields.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify && +// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic-new-cast -verify && // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify unsigned foo(); diff --git a/test/Analysis/func.c b/test/Analysis/func.c index 2b4e7b0db0..e2471db0da 100644 --- a/test/Analysis/func.c +++ b/test/Analysis/func.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s void f(void) { diff --git a/test/Analysis/misc-ps-64.m b/test/Analysis/misc-ps-64.m index 163da4b4ab..faa7869770 100644 --- a/test/Analysis/misc-ps-64.m +++ b/test/Analysis/misc-ps-64.m @@ -1,5 +1,7 @@ // RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic --verify -fblocks %s && +// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=basic --verify -fblocks %s && // RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s && +// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=range --verify -fblocks %s && // RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s && // RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s diff --git a/test/Analysis/misc-ps-basic-store.m b/test/Analysis/misc-ps-basic-store.m index 1207f8663e..20fb3c8fea 100644 --- a/test/Analysis/misc-ps-basic-store.m +++ b/test/Analysis/misc-ps-basic-store.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s && +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic-new-cast --verify -fblocks %s //--------------------------------------------------------------------------- // Test case 'checkaccess_union' differs for region store and basic store. diff --git a/test/Analysis/misc-ps-ranges.m b/test/Analysis/misc-ps-ranges.m index a191bec3cf..1df7ef06f9 100644 --- a/test/Analysis/misc-ps-ranges.m +++ b/test/Analysis/misc-ps-ranges.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s && +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=range --verify -fblocks %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s // diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index ea41b5bb2f..025d74cccb 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic --verify -fblocks %s && +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=basic --verify -fblocks %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s && +// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic-new-cast -analyzer-constraints=range --verify -fblocks %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s diff --git a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m index 9a64b3001e..6ff3c14948 100644 --- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m +++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify +// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify && +// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic-new-cast %s -verify @interface MyClass {} - (void *)voidPtrM; diff --git a/test/Analysis/no-exit-cfg.c b/test/Analysis/no-exit-cfg.c index cad2127b20..fe090ccf8c 100644 --- a/test/Analysis/no-exit-cfg.c +++ b/test/Analysis/no-exit-cfg.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s // This is a test case for the issue reported in PR 2819: diff --git a/test/Analysis/no-outofbounds-basicstore.c b/test/Analysis/no-outofbounds-basicstore.c index 9a0b35906d..0df6f0428e 100644 --- a/test/Analysis/no-outofbounds-basicstore.c +++ b/test/Analysis/no-outofbounds-basicstore.c @@ -1,4 +1,5 @@ -// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s +// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s && +// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic-new-cast -verify %s void f() { long x = 0; diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c index 6e2074146c..b6609e1374 100644 --- a/test/Analysis/null-deref-ps.c +++ b/test/Analysis/null-deref-ps.c @@ -1,5 +1,7 @@ // RUN: clang-cc -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic && +// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic-new-cast && // RUN: clang-cc -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic && +// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic-new-cast && // RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s && // RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s diff --git a/test/Analysis/override-werror.c b/test/Analysis/override-werror.c index f928ee031f..899ea17793 100644 --- a/test/Analysis/override-werror.c +++ b/test/Analysis/override-werror.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic -verify && +// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic-new-cast -verify && // RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=region -verify // This test case illustrates that using '-analyze' overrides the effect of diff --git a/test/Analysis/pr4209.m b/test/Analysis/pr4209.m index 7d7d8fc5a1..c4e218e643 100644 --- a/test/Analysis/pr4209.m +++ b/test/Analysis/pr4209.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -verify %s && +// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=region -verify %s // This test case was crashing due to how CFRefCount.cpp resolved the diff --git a/test/Analysis/pr_2542_rdar_6793404.m b/test/Analysis/pr_2542_rdar_6793404.m index 82a028d652..70ce1dd7bd 100644 --- a/test/Analysis/pr_2542_rdar_6793404.m +++ b/test/Analysis/pr_2542_rdar_6793404.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=region -verify %s // BEGIN delta-debugging reduced header stuff diff --git a/test/Analysis/pr_4164.c b/test/Analysis/pr_4164.c index cc2479c3e4..5385f1bd13 100644 --- a/test/Analysis/pr_4164.c +++ b/test/Analysis/pr_4164.c @@ -1,4 +1,5 @@ // RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=region -verify %s // PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164 diff --git a/test/Analysis/rdar-6442306-1.m b/test/Analysis/rdar-6442306-1.m index 15d3498840..0c0923d71b 100644 --- a/test/Analysis/rdar-6442306-1.m +++ b/test/Analysis/rdar-6442306-1.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify && +// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic-new-cast -verify && // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify typedef int bar_return_t; diff --git a/test/Analysis/rdar-6539791.c b/test/Analysis/rdar-6539791.c index c1c9891543..bf70e6cc78 100644 --- a/test/Analysis/rdar-6539791.c +++ b/test/Analysis/rdar-6539791.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s typedef const struct __CFAllocator * CFAllocatorRef; diff --git a/test/Analysis/rdar-6541136.c b/test/Analysis/rdar-6541136.c index 6e6a479136..61c7756bb3 100644 --- a/test/Analysis/rdar-6541136.c +++ b/test/Analysis/rdar-6541136.c @@ -1,4 +1,5 @@ -// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=basic %s +// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=basic %s && +// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=basic-new-cast %s struct tea_cheese { unsigned magic; }; typedef struct tea_cheese kernel_tea_cheese_t; diff --git a/test/Analysis/rdar-6562655.m b/test/Analysis/rdar-6562655.m index 581d6eacf0..65afb1b515 100644 --- a/test/Analysis/rdar-6562655.m +++ b/test/Analysis/rdar-6562655.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s +// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic-new-cast -verify %s // // This test case mainly checks that the retain/release checker doesn't crash // on this file. diff --git a/test/Analysis/rdar-6582778-basic-store.c b/test/Analysis/rdar-6582778-basic-store.c index 9ec38ef7a5..14034530b7 100644 --- a/test/Analysis/rdar-6582778-basic-store.c +++ b/test/Analysis/rdar-6582778-basic-store.c @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s typedef const void * CFTypeRef; typedef double CFTimeInterval; diff --git a/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m b/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m index 5d1fa37c46..9075ad4c7b 100644 --- a/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m +++ b/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify +// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify && +// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic-new-cast %s -verify typedef struct Foo { int x; } Bar; diff --git a/test/Analysis/refcnt_naming.m b/test/Analysis/refcnt_naming.m index bea404799b..e2e4fd0724 100644 --- a/test/Analysis/refcnt_naming.m +++ b/test/Analysis/refcnt_naming.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s typedef const struct __CFString * CFStringRef; diff --git a/test/Analysis/region-1.m b/test/Analysis/region-1.m index ed172e431e..1924bc31a6 100644 --- a/test/Analysis/region-1.m +++ b/test/Analysis/region-1.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s // // This test case simply should not crash. It evaluates the logic of not diff --git a/test/Analysis/retain-release-basic-store.m b/test/Analysis/retain-release-basic-store.m index b16c231ce2..15ae0c9aaa 100644 --- a/test/Analysis/retain-release-basic-store.m +++ b/test/Analysis/retain-release-basic-store.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from diff --git a/test/Analysis/retain-release-gc-only.m b/test/Analysis/retain-release-gc-only.m index ec33a57d33..f22e1f368b 100644 --- a/test/Analysis/retain-release-gc-only.m +++ b/test/Analysis/retain-release-gc-only.m @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref -verify -fobjc-gc-only %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc-only %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify -fobjc-gc-only %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -fobjc-gc-only -verify %s //===----------------------------------------------------------------------===// diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m index 63470146bb..45a0cc2483 100644 --- a/test/Analysis/retain-release.m +++ b/test/Analysis/retain-release.m @@ -1,5 +1,6 @@ //>>SLICER -// RUN: clang-cc -analyze -checker-cfref -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s //===----------------------------------------------------------------------===// diff --git a/test/Analysis/stack-addr-ps.c b/test/Analysis/stack-addr-ps.c index 0d7a70373c..8340eaafed 100644 --- a/test/Analysis/stack-addr-ps.c +++ b/test/Analysis/stack-addr-ps.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s #include diff --git a/test/Analysis/uninit-msg-expr.m b/test/Analysis/uninit-msg-expr.m index 5ec878ea3c..dca6ea09d0 100644 --- a/test/Analysis/uninit-msg-expr.m +++ b/test/Analysis/uninit-msg-expr.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s //===----------------------------------------------------------------------===// diff --git a/test/Analysis/uninit-ps-rdar6145427.m b/test/Analysis/uninit-ps-rdar6145427.m index 49eb26984a..e57dcc0a97 100644 --- a/test/Analysis/uninit-ps-rdar6145427.m +++ b/test/Analysis/uninit-ps-rdar6145427.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -verify -analyzer-store=basic -checker-cfref %s && +// RUN: clang-cc -analyze -verify -analyzer-store=basic-new-cast -checker-cfref %s && // RUN: clang-cc -analyze -verify -analyzer-store=region -checker-cfref %s // Delta-Debugging reduced preamble. diff --git a/test/Analysis/uninit-vals-ps.c b/test/Analysis/uninit-vals-ps.c index 4177126536..8c74240399 100644 --- a/test/Analysis/uninit-vals-ps.c +++ b/test/Analysis/uninit-vals-ps.c @@ -1,4 +1,5 @@ -// RUN: clang-cc -analyze -checker-cfref -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s struct FPRec { diff --git a/test/Analysis/uninit-vals.m b/test/Analysis/uninit-vals.m index 7be247e7ca..134fd736e8 100644 --- a/test/Analysis/uninit-vals.m +++ b/test/Analysis/uninit-vals.m @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && +// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-new-cast -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s typedef unsigned int NSUInteger;