mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +00:00
Really remove FlatStoreManager and BasicStoreManager, this time from the driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge.
llvm-svn: 136422
This commit is contained in:
parent
7c7ce00265
commit
73665188fc
@ -15,9 +15,7 @@
|
||||
#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN)
|
||||
#endif
|
||||
|
||||
ANALYSIS_STORE(BasicStore, "basic", "Use basic analyzer store", CreateBasicStoreManager)
|
||||
ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store", CreateRegionStoreManager)
|
||||
ANALYSIS_STORE(FlatStore, "flat", "Use flat analyzer store", CreateFlatStoreManager)
|
||||
|
||||
#ifndef ANALYSIS_CONSTRAINTS
|
||||
#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN)
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
public:
|
||||
AnalyzerOptions() {
|
||||
AnalysisStoreOpt = BasicStoreModel;
|
||||
AnalysisStoreOpt = RegionStoreModel;
|
||||
AnalysisConstraintsOpt = RangeConstraintsModel;
|
||||
AnalysisDiagOpt = PD_HTML;
|
||||
ShowCheckerHelp = 0;
|
||||
|
@ -68,7 +68,7 @@ static void AnalyzerOptsToArgs(const AnalyzerOptions &Opts,
|
||||
std::vector<std::string> &Res) {
|
||||
if (Opts.ShowCheckerHelp)
|
||||
Res.push_back("-analyzer-checker-help");
|
||||
if (Opts.AnalysisStoreOpt != BasicStoreModel) {
|
||||
if (Opts.AnalysisStoreOpt != RegionStoreModel) {
|
||||
Res.push_back("-analyzer-store");
|
||||
Res.push_back(getAnalysisStoreName(Opts.AnalysisStoreOpt));
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ add_clang_library(clangStaticAnalyzerCore
|
||||
AggExprVisitor.cpp
|
||||
AnalysisManager.cpp
|
||||
BasicConstraintManager.cpp
|
||||
BasicStore.cpp
|
||||
BasicValueFactory.cpp
|
||||
BlockCounter.cpp
|
||||
BugReporter.cpp
|
||||
@ -20,7 +19,6 @@ add_clang_library(clangStaticAnalyzerCore
|
||||
Environment.cpp
|
||||
ExplodedGraph.cpp
|
||||
ExprEngine.cpp
|
||||
FlatStore.cpp
|
||||
GRState.cpp
|
||||
HTMLDiagnostics.cpp
|
||||
MemRegion.cpp
|
||||
@ -29,11 +27,11 @@ add_clang_library(clangStaticAnalyzerCore
|
||||
PlistDiagnostics.cpp
|
||||
RangeConstraintManager.cpp
|
||||
RegionStore.cpp
|
||||
SValBuilder.cpp
|
||||
SVals.cpp
|
||||
SimpleConstraintManager.cpp
|
||||
SimpleSValBuilder.cpp
|
||||
Store.cpp
|
||||
SValBuilder.cpp
|
||||
SVals.cpp
|
||||
SymbolManager.cpp
|
||||
TextPathDiagnostics.cpp
|
||||
)
|
||||
|
@ -336,3 +336,6 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset,
|
||||
return loc::MemRegionVal(MRMgr.getElementRegion(elementType, NewIdx, ArrayR,
|
||||
Ctx));
|
||||
}
|
||||
|
||||
StoreManager::BindingsHandler::~BindingsHandler() {}
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s -Wno-implicit-function-declaration
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=range %s -Wno-implicit-function-declaration
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify -fobjc-gc -disable-free %s -Wno-implicit-function-declaration
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s -Wno-implicit-function-declaration
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s -Wno-implicit-function-declaration
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -verify %s -analyzer-constraints=basic -analyzer-store=basic
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -verify %s -analyzer-constraints=range -analyzer-store=basic
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -verify %s -analyzer-constraints=basic -analyzer-store=region
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -verify %s -analyzer-constraints=range -analyzer-store=region
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -3,11 +3,6 @@
|
||||
// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
// ==-- FIXME: -analyzer-store=basic fails on this file (false negatives). --==
|
||||
// NOTWORK: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// The following code is reduced using delta-debugging from
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-checker=deadcode.DeadStores -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-checker=deadcode.DeadStores -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-checker=deadcode.DeadStores -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-checker=deadcode.DeadStores -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range %s -verify
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic -fobjc-gc -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=range -analyzer-store=basic -fobjc-gc -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic -fobjc-gc -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=range -analyzer-store=region -fobjc-gc -verify %s
|
||||
|
||||
typedef const void * CFTypeRef;
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.CastToStruct -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.CastToStruct -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.CastToStruct -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.CastToStruct -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
// Test function pointer casts. Currently we track function addresses using
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -analyzer-constraints=basic -verify -Wno-unreachable-code -ffreestanding %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -analyzer-constraints=range -verify -Wno-unreachable-code -ffreestanding %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=basic -verify -Wno-unreachable-code -ffreestanding %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=range -verify -Wno-unreachable-code -ffreestanding %s
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
void foo() {
|
||||
|
@ -1,6 +1,4 @@
|
||||
// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -analyzer-store=basic -analyzer-constraints=basic -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -analyzer-store=basic -analyzer-constraints=range -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -analyzer-store=region -analyzer-constraints=basic -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -analyzer-store=region -analyzer-constraints=range -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-store=basic -analyzer-constraints=basic -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-store=basic -analyzer-constraints=range -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-store=region -analyzer-constraints=basic -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-store=region -analyzer-constraints=range -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
|
||||
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
//
|
||||
// Just exercise the analyzer on code that has at one point caused issues
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=basic -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=region -verify
|
||||
|
||||
unsigned foo();
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
void f(void) {
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify -fblocks %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify -fblocks %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify -fblocks %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify -fblocks %s
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Test case 'checkaccess_union' differs for region store and basic store.
|
||||
// The basic store doesn't reason about compound literals, so the code
|
||||
// below won't fire an "uninitialized value" warning.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// PR 2948 (testcase; crash on VisitLValue for union types)
|
||||
// http://llvm.org/bugs/show_bug.cgi?id=2948
|
||||
|
||||
void checkaccess_union() {
|
||||
int ret = 0, status;
|
||||
if (((((__extension__ (((union { // no-warning
|
||||
__typeof (status) __in; int __i;}
|
||||
)
|
||||
{
|
||||
.__in = (status)}
|
||||
).__i))) & 0xff00) >> 8) == 1)
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
// BasicStore handles this case incorrectly because it doesn't reason about
|
||||
// the value pointed to by 'x' and thus creates different symbolic values
|
||||
// at the declarations of 'a' and 'b' respectively. See the companion test
|
||||
// in 'misc-ps-region-store.m'.
|
||||
void test_trivial_symbolic_comparison_pointer_parameter(int *x) {
|
||||
int a = *x;
|
||||
int b = *x;
|
||||
if (a != b) {
|
||||
int *p = 0;
|
||||
*p = 0xDEADBEEF; // expected-warning{{null}}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify -fblocks %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s
|
||||
|
||||
// <rdar://problem/6776949>
|
||||
|
@ -1,10 +1,6 @@
|
||||
// NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -fobjc-gc -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -fobjc-gc -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
|
||||
|
||||
@ -553,7 +549,6 @@ int test_array_compound(int *q, int *r, int *z) {
|
||||
return j;
|
||||
}
|
||||
|
||||
// This test case previously crashed with -analyzer-store=basic because the
|
||||
// symbolic value stored in 'x' wouldn't be implicitly casted to a signed value
|
||||
// during the comparison.
|
||||
int rdar_7124210(unsigned int x) {
|
||||
|
@ -1,8 +1,5 @@
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic %s 2>&1 | FileCheck -check-prefix=darwin8 %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin8 %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic %s 2>&1 | FileCheck -check-prefix=darwin9 %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin9 %s
|
||||
// RUN: %clang_cc1 -triple thumbv6-apple-darwin4.0.0-iphoneos -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic %s 2>&1 | FileCheck -check-prefix=darwin9 %s
|
||||
// RUN: %clang_cc1 -triple thumbv6-apple-darwin4.0.0-iphoneos -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin9 %s
|
||||
|
||||
@interface MyClass {}
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
// This is a test case for the issue reported in PR 2819:
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,unix.experimental,security.experimental.ArrayBound -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,unix.experimental,security.experimental.ArrayBound -analyzer-store=region -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -1,5 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,core.experimental -std=gnu99 -verify %s -analyzer-constraints=basic -analyzer-store=basic -Wreturn-type
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,core.experimental -std=gnu99 -verify %s -analyzer-constraints=range -analyzer-store=basic -Wreturn-type
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,core.experimental -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-no-purge-dead -verify %s -Wreturn-type
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,core.experimental -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wreturn-type
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -Werror %s -analyzer-store=basic -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -Werror %s -analyzer-store=region -verify
|
||||
|
||||
// This test case illustrates that using '-analyze' overrides the effect of
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
// This test case was crashing due to how CFRefCount.cpp resolved the
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -pedantic -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -pedantic -analyzer-store=region -verify %s
|
||||
|
||||
// BEGIN delta-debugging reduced header stuff
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
// PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=basic -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=region -verify
|
||||
|
||||
typedef int bar_return_t;
|
||||
|
@ -1,20 +0,0 @@
|
||||
// RUN: %clang_cc1 -verify -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic %s
|
||||
|
||||
struct tea_cheese { unsigned magic; };
|
||||
typedef struct tea_cheese kernel_tea_cheese_t;
|
||||
extern kernel_tea_cheese_t _wonky_gesticulate_cheese;
|
||||
|
||||
// This test case exercises the ElementRegion::getRValueType() logic.
|
||||
// All it tests is that it does not crash or do anything weird.
|
||||
// The out-of-bounds-access on line 19 is caught using the region store variant.
|
||||
|
||||
void foo( void )
|
||||
{
|
||||
kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
|
||||
struct load_wine *cmd = (void*) &wonky[1];
|
||||
cmd = cmd;
|
||||
char *p = (void*) &wonky[1];
|
||||
*p = 1;
|
||||
kernel_tea_cheese_t *q = &wonky[1];
|
||||
kernel_tea_cheese_t r = *q; // no-warning
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=region -verify %s
|
||||
//
|
||||
// This test case mainly checks that the retain/release checker doesn't crash
|
||||
|
@ -1,22 +0,0 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
|
||||
typedef const void * CFTypeRef;
|
||||
typedef double CFTimeInterval;
|
||||
typedef CFTimeInterval CFAbsoluteTime;
|
||||
typedef const struct __CFAllocator * CFAllocatorRef;
|
||||
typedef const struct __CFDate * CFDateRef;
|
||||
|
||||
extern CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
|
||||
CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
|
||||
|
||||
void f(void) {
|
||||
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
|
||||
CFTypeRef vals[] = { CFDateCreate(0, t) }; // no-warning
|
||||
}
|
||||
|
||||
CFTypeRef global;
|
||||
|
||||
void g(void) {
|
||||
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
|
||||
global = CFDateCreate(0, t); // no-warning
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=basic %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=basic -analyzer-store=region %s -verify
|
||||
|
||||
typedef struct Foo { int x; } Bar;
|
||||
|
@ -1,5 +1,4 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -triple i386-apple-darwin10 -analyzer-store=region %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -triple i386-apple-darwin10 -analyzer-store=basic %s
|
||||
|
||||
// Note that the target triple is important for this test case. It specifies that we use the
|
||||
// fragile Objective-C ABI.
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
|
||||
typedef const struct __CFString * CFStringRef;
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
//
|
||||
// This test case simply should not crash. It evaluates the logic of not
|
||||
|
@ -1,104 +0,0 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// The following code is reduced using delta-debugging from
|
||||
// Foundation.h (Mac OS X).
|
||||
//
|
||||
// It includes the basic definitions for the test cases below.
|
||||
// Not including Foundation.h directly makes this test case both svelte and
|
||||
// portable to non-Mac platforms.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
typedef unsigned int __darwin_natural_t;
|
||||
typedef unsigned long UInt32;
|
||||
typedef signed long CFIndex;
|
||||
typedef const void * CFTypeRef;
|
||||
typedef const struct __CFString * CFStringRef;
|
||||
typedef const struct __CFAllocator * CFAllocatorRef;
|
||||
extern const CFAllocatorRef kCFAllocatorDefault;
|
||||
extern CFTypeRef CFRetain(CFTypeRef cf);
|
||||
extern void CFRelease(CFTypeRef cf);
|
||||
typedef struct {
|
||||
}
|
||||
CFArrayCallBacks;
|
||||
extern const CFArrayCallBacks kCFTypeArrayCallBacks;
|
||||
typedef const struct __CFArray * CFArrayRef;
|
||||
typedef struct __CFArray * CFMutableArrayRef;
|
||||
extern CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks);
|
||||
extern const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx);
|
||||
typedef const struct __CFDictionary * CFDictionaryRef;
|
||||
typedef UInt32 CFStringEncoding;
|
||||
enum {
|
||||
kCFStringEncodingMacRoman = 0, kCFStringEncodingWindowsLatin1 = 0x0500, kCFStringEncodingISOLatin1 = 0x0201, kCFStringEncodingNextStepLatin = 0x0B01, kCFStringEncodingASCII = 0x0600, kCFStringEncodingUnicode = 0x0100, kCFStringEncodingUTF8 = 0x08000100, kCFStringEncodingNonLossyASCII = 0x0BFF , kCFStringEncodingUTF16 = 0x0100, kCFStringEncodingUTF16BE = 0x10000100, kCFStringEncodingUTF16LE = 0x14000100, kCFStringEncodingUTF32 = 0x0c000100, kCFStringEncodingUTF32BE = 0x18000100, kCFStringEncodingUTF32LE = 0x1c000100 };
|
||||
extern CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding);
|
||||
typedef double CFTimeInterval;
|
||||
typedef CFTimeInterval CFAbsoluteTime;
|
||||
typedef const struct __CFDate * CFDateRef;
|
||||
extern CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
|
||||
extern CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate);
|
||||
typedef __darwin_natural_t natural_t;
|
||||
typedef natural_t mach_port_name_t;
|
||||
typedef mach_port_name_t mach_port_t;
|
||||
typedef signed char BOOL;
|
||||
typedef struct _NSZone NSZone;
|
||||
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
|
||||
@protocol NSObject - (BOOL)isEqual:(id)object;
|
||||
- (id)retain;
|
||||
- (oneway void)release;
|
||||
@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
|
||||
@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
|
||||
@end @interface NSObject <NSObject> {
|
||||
}
|
||||
@end typedef float CGFloat;
|
||||
typedef double NSTimeInterval;
|
||||
@interface NSDate : NSObject <NSCopying, NSCoding> - (NSTimeInterval)timeIntervalSinceReferenceDate;
|
||||
@end enum {
|
||||
NSObjCNoType = 0, NSObjCVoidType = 'v', NSObjCCharType = 'c', NSObjCShortType = 's', NSObjCLongType = 'l', NSObjCLonglongType = 'q', NSObjCFloatType = 'f', NSObjCDoubleType = 'd', NSObjCBoolType = 'B', NSObjCSelectorType = ':', NSObjCObjectType = '@', NSObjCStructType = '{', NSObjCPointerType = '^', NSObjCStringType = '*', NSObjCArrayType = '[', NSObjCUnionType = '(', NSObjCBitfield = 'b' }
|
||||
__attribute__((deprecated));
|
||||
typedef int kern_return_t;
|
||||
typedef kern_return_t mach_error_t;
|
||||
typedef mach_port_t io_object_t;
|
||||
typedef io_object_t io_service_t;
|
||||
typedef struct __DASession * DASessionRef;
|
||||
extern DASessionRef DASessionCreate( CFAllocatorRef allocator );
|
||||
typedef struct __DADisk * DADiskRef;
|
||||
extern DADiskRef DADiskCreateFromBSDName( CFAllocatorRef allocator, DASessionRef session, const char * name );
|
||||
extern DADiskRef DADiskCreateFromIOMedia( CFAllocatorRef allocator, DASessionRef session, io_service_t media );
|
||||
extern CFDictionaryRef DADiskCopyDescription( DADiskRef disk );
|
||||
extern DADiskRef DADiskCopyWholeDisk( DADiskRef disk );
|
||||
@interface NSAppleEventManager : NSObject {
|
||||
}
|
||||
@end enum {
|
||||
kDAReturnSuccess = 0, kDAReturnError = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x01, kDAReturnBusy = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x02, kDAReturnBadArgument = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x03, kDAReturnExclusiveAccess = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x04, kDAReturnNoResources = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x05, kDAReturnNotFound = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x06, kDAReturnNotMounted = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x07, kDAReturnNotPermitted = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x08, kDAReturnNotPrivileged = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x09, kDAReturnNotReady = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0A, kDAReturnNotWritable = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0B, kDAReturnUnsupported = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0C };
|
||||
typedef mach_error_t DAReturn;
|
||||
typedef const struct __DADissenter * DADissenterRef;
|
||||
extern DADissenterRef DADissenterCreate( CFAllocatorRef allocator, DAReturn status, CFStringRef string );
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Test cases.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Test to see if we supresss an error when we store the pointer
|
||||
// to a struct. This is because the value "escapes" the basic reasoning
|
||||
// of basic store.
|
||||
|
||||
struct foo {
|
||||
NSDate* f;
|
||||
};
|
||||
|
||||
CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
|
||||
|
||||
CFAbsoluteTime f4() {
|
||||
struct foo x;
|
||||
|
||||
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
|
||||
CFDateRef date = CFDateCreate(0, t);
|
||||
[((NSDate*) date) retain];
|
||||
CFRelease(date);
|
||||
CFDateGetAbsoluteTime(date); // no-warning
|
||||
x.f = (NSDate*) date;
|
||||
[((NSDate*) date) release];
|
||||
t = CFDateGetAbsoluteTime(date); // no-warning
|
||||
return t;
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSAutoreleasePool -analyzer-store=basic -verify -fobjc-gc-only -fblocks %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSAutoreleasePool -analyzer-store=region -fobjc-gc-only -fblocks -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=basic -analyzer-output=text -fobjc-gc-only -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=region -analyzer-output=text -fobjc-gc-only -verify %s
|
||||
|
||||
/***
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=basic -analyzer-output=text -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=region -analyzer-output=text -verify %s
|
||||
|
||||
/***
|
||||
|
@ -1,6 +1,4 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=region -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=basic -fblocks -verify -x objective-c++ %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=region -fblocks -verify -x objective-c++ %s
|
||||
|
||||
#if __has_feature(attribute_ns_returns_retained)
|
||||
@ -1554,3 +1552,16 @@ CFArrayRef camel_copymachine() {
|
||||
return [F18 alloc];
|
||||
}
|
||||
@end
|
||||
|
||||
// Radar 6582778.
|
||||
void rdar6582778(void) {
|
||||
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
|
||||
CFTypeRef vals[] = { CFDateCreate(0, t) }; // expected-warning {{leak}}
|
||||
}
|
||||
|
||||
CFTypeRef global;
|
||||
|
||||
void rdar6582778_2(void) {
|
||||
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
|
||||
global = CFDateCreate(0, t); // no-warning
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s
|
||||
|
||||
int* f1() {
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=basic %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s
|
||||
|
||||
// Delta-Debugging reduced preamble.
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
|
||||
|
||||
struct FPRec {
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
|
||||
|
||||
typedef unsigned int NSUInteger;
|
||||
|
@ -1,5 +1,4 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=unix.API,osx.API %s -analyzer-store=region -fblocks -verify
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=unix.API,osx.API %s -analyzer-store=basic -fblocks -verify
|
||||
|
||||
struct _opaque_pthread_once_t {
|
||||
long __sig;
|
||||
|
@ -1,4 +1,3 @@
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=region -fblocks -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user