forked from OSchip/llvm-project
Add clang-cc option "--analyzer-experimental-internal-checks". This
option enables new "internal" checks that will eventually be turned on by default but still require broader testing. llvm-svn: 88671
This commit is contained in:
parent
379d84b7ed
commit
4ef13f8ac9
|
@ -51,6 +51,7 @@ void CheckObjCUnusedIvar(const ObjCImplementationDecl *D, BugReporter& BR);
|
||||||
|
|
||||||
void RegisterAppleChecks(GRExprEngine& Eng, const Decl &D);
|
void RegisterAppleChecks(GRExprEngine& Eng, const Decl &D);
|
||||||
void RegisterExperimentalChecks(GRExprEngine &Eng);
|
void RegisterExperimentalChecks(GRExprEngine &Eng);
|
||||||
|
void RegisterExperimentalInternalChecks(GRExprEngine &Eng);
|
||||||
|
|
||||||
void CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR);
|
void CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR);
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
unsigned VisualizeEGDot : 1;
|
unsigned VisualizeEGDot : 1;
|
||||||
unsigned VisualizeEGUbi : 1;
|
unsigned VisualizeEGUbi : 1;
|
||||||
unsigned EnableExperimentalChecks : 1;
|
unsigned EnableExperimentalChecks : 1;
|
||||||
|
unsigned EnableExperimentalInternalChecks : 1;
|
||||||
public:
|
public:
|
||||||
AnalyzerOptions() {
|
AnalyzerOptions() {
|
||||||
AnalyzeAll = 0;
|
AnalyzeAll = 0;
|
||||||
|
@ -79,6 +79,7 @@ public:
|
||||||
VisualizeEGDot = 0;
|
VisualizeEGDot = 0;
|
||||||
VisualizeEGUbi = 0;
|
VisualizeEGUbi = 0;
|
||||||
EnableExperimentalChecks = 0;
|
EnableExperimentalChecks = 0;
|
||||||
|
EnableExperimentalInternalChecks = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,27 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "GRExprEngineInternalChecks.h"
|
||||||
#include "GRExprEngineExperimentalChecks.h"
|
#include "GRExprEngineExperimentalChecks.h"
|
||||||
#include "clang/Analysis/LocalCheckers.h"
|
#include "clang/Analysis/LocalCheckers.h"
|
||||||
|
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
|
||||||
void clang::RegisterExperimentalChecks(GRExprEngine &Eng) {
|
void clang::RegisterExperimentalChecks(GRExprEngine &Eng) {
|
||||||
|
// These are checks that never belong as internal checks
|
||||||
|
// within GRExprEngine.
|
||||||
RegisterPthreadLockChecker(Eng);
|
RegisterPthreadLockChecker(Eng);
|
||||||
RegisterMallocChecker(Eng);
|
RegisterMallocChecker(Eng);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clang::RegisterExperimentalInternalChecks(GRExprEngine &Eng) {
|
||||||
|
// These are internal checks that should eventually migrate to
|
||||||
|
// RegisterInternalChecks() once they have been further tested.
|
||||||
|
|
||||||
|
// Note that this must be registered after ReturnStackAddresEngsChecker.
|
||||||
|
RegisterReturnPointerRangeChecker(Eng);
|
||||||
|
RegisterPointerSubChecker(Eng);
|
||||||
|
RegisterPointerArithChecker(Eng);
|
||||||
|
RegisterCastToStructChecker(Eng);
|
||||||
|
RegisterArrayBoundChecker(Eng);
|
||||||
|
}
|
||||||
|
|
|
@ -395,13 +395,6 @@ void GRExprEngine::RegisterInternalChecks() {
|
||||||
RegisterDivZeroChecker(*this);
|
RegisterDivZeroChecker(*this);
|
||||||
RegisterReturnStackAddressChecker(*this);
|
RegisterReturnStackAddressChecker(*this);
|
||||||
RegisterReturnUndefChecker(*this);
|
RegisterReturnUndefChecker(*this);
|
||||||
RegisterPointerSubChecker(*this);
|
|
||||||
RegisterPointerArithChecker(*this);
|
|
||||||
RegisterFixedAddressChecker(*this);
|
RegisterFixedAddressChecker(*this);
|
||||||
// Note that this must be registered after ReturnStackAddressChecker.
|
|
||||||
RegisterReturnPointerRangeChecker(*this);
|
|
||||||
|
|
||||||
RegisterCastToStructChecker(*this);
|
|
||||||
RegisterArrayBoundChecker(*this);
|
|
||||||
RegisterUndefinedArraySubscriptChecker(*this);
|
RegisterUndefinedArraySubscriptChecker(*this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,6 +331,10 @@ static void ActionGRExprEngine(AnalysisConsumer &C, AnalysisManager& mgr, Decl *
|
||||||
Eng.setTransferFunctions(tf);
|
Eng.setTransferFunctions(tf);
|
||||||
Eng.RegisterInternalChecks(); // FIXME: Internal checks should just
|
Eng.RegisterInternalChecks(); // FIXME: Internal checks should just
|
||||||
// automatically register.
|
// automatically register.
|
||||||
|
|
||||||
|
if (C.Opts.EnableExperimentalInternalChecks)
|
||||||
|
RegisterExperimentalInternalChecks(Eng);
|
||||||
|
|
||||||
RegisterAppleChecks(Eng, *D);
|
RegisterAppleChecks(Eng, *D);
|
||||||
|
|
||||||
if (C.Opts.EnableExperimentalChecks)
|
if (C.Opts.EnableExperimentalChecks)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// The following code is reduced using delta-debugging from
|
// The following code is reduced using delta-debugging from
|
||||||
|
|
|
@ -1,7 +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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||||
|
|
||||||
typedef signed long CFIndex;
|
typedef signed long CFIndex;
|
||||||
typedef const struct __CFAllocator * CFAllocatorRef;
|
typedef const struct __CFAllocator * CFAllocatorRef;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
|
||||||
// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
|
||||||
// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=region
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=region
|
||||||
// RUN: clang-cc -analyze -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=region
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=region
|
||||||
|
|
||||||
typedef struct objc_selector *SEL;
|
typedef struct objc_selector *SEL;
|
||||||
typedef signed char BOOL;
|
typedef signed char BOOL;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
typedef struct CGColorSpace *CGColorSpaceRef;
|
typedef struct CGColorSpace *CGColorSpaceRef;
|
||||||
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
|
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
|
|
||||||
typedef signed char BOOL;
|
typedef signed char BOOL;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
|
||||||
typedef signed char BOOL;
|
typedef signed char BOOL;
|
||||||
@protocol NSObject
|
@protocol NSObject
|
||||||
- (BOOL)isEqual:(id)object;
|
- (BOOL)isEqual:(id)object;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
// BEGIN delta-debugging reduced header stuff
|
// BEGIN delta-debugging reduced header stuff
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
// ==-- FIXME: -analyzer-store=basic fails on this file (false negatives). --==
|
// ==-- FIXME: -analyzer-store=basic fails on this file (false negatives). --==
|
||||||
// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
|
// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
|
||||||
// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
// NOTWORK: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||||
// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||||
// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
// NOTWORK: clang-cc -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// The following code is reduced using delta-debugging from
|
// The following code is reduced using delta-debugging from
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -warn-dead-stores -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -warn-dead-stores -analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -warn-dead-stores -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
// These declarations were reduced using Delta-Debugging from Foundation.h
|
// These declarations were reduced using Delta-Debugging from Foundation.h
|
||||||
// on Mac OS X. The test cases are below.
|
// on Mac OS X. The test cases are below.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic %s -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range %s -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic %s -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range %s -verify
|
||||||
|
|
||||||
// The point of this test cases is to exercise properties in the static
|
// The point of this test cases is to exercise properties in the static
|
||||||
// analyzer
|
// analyzer
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -warn-objc-methodsigs -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-methodsigs -verify %s
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -analyzer-constraints=basic -analyzer-store=basic -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-experimental-internal-checks -analyzer-constraints=range -analyzer-store=basic -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-experimental-internal-checks -analyzer-constraints=basic -analyzer-store=basic -checker-cfref -fobjc-gc -verify %s
|
||||||
// RUN: clang-cc -analyze -analyzer-constraints=range -analyzer-store=region -checker-cfref -fobjc-gc -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -analyzer-constraints=range -analyzer-store=region -checker-cfref -fobjc-gc -verify %s
|
||||||
|
|
||||||
typedef const void * CFTypeRef;
|
typedef const void * CFTypeRef;
|
||||||
typedef const struct __CFString * CFStringRef;
|
typedef const struct __CFString * CFStringRef;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -warn-objc-missing-dealloc %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-missing-dealloc %s -verify
|
||||||
|
|
||||||
// Tests for the checker which checks missing/extra ivar 'release' calls
|
// Tests for the checker which checks missing/extra ivar 'release' calls
|
||||||
// in dealloc.
|
// in dealloc.
|
||||||
|
|
|
@ -1,7 +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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Delta-debugging produced forward declarations.
|
// Delta-debugging produced forward declarations.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
struct s {
|
struct s {
|
||||||
int data;
|
int data;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=region --verify %s
|
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region --verify %s
|
||||||
|
|
||||||
// Test if the 'storage' region gets properly initialized after it is cast to
|
// Test if the 'storage' region gets properly initialized after it is cast to
|
||||||
// 'struct sockaddr *'.
|
// 'struct sockaddr *'.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic --verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic --verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region --verify %s
|
||||||
|
|
||||||
// Test function pointer casts. Currently we track function addresses using
|
// Test function pointer casts. Currently we track function addresses using
|
||||||
// loc::FunctionVal. Because casts can be arbitrary, do we need to model
|
// loc::FunctionVal. Because casts can be arbitrary, do we need to model
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
typedef unsigned char Boolean;
|
typedef unsigned char Boolean;
|
||||||
typedef signed long CFIndex;
|
typedef signed long CFIndex;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
// This test case was reported in <rdar:problem/6080742>.
|
// This test case was reported in <rdar:problem/6080742>.
|
||||||
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
|
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic --verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic --verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region --verify %s
|
||||||
|
|
||||||
void foo() {
|
void foo() {
|
||||||
int *p = (int*) 0x10000; // Should not crash here.
|
int *p = (int*) 0x10000; // Should not crash here.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -warn-dead-stores -warn-uninit-values -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -warn-uninit-values -verify %s
|
||||||
|
|
||||||
void f1()
|
void f1()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// RUN: clang-cc -analyze -warn-dead-stores -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s
|
||||||
|
|
||||||
void f1() {
|
void f1() {
|
||||||
int k, y;
|
int k, y;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// RUN: clang-cc -analyze -warn-dead-stores -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -warn-dead-stores -verify %s
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
void f1() {
|
void f1() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -warn-dead-stores -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -verify %s
|
||||||
|
|
||||||
typedef signed char BOOL;
|
typedef signed char BOOL;
|
||||||
typedef unsigned int NSUInteger;
|
typedef unsigned int NSUInteger;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region %s
|
||||||
|
|
||||||
typedef struct added_obj_st {
|
typedef struct added_obj_st {
|
||||||
int type;
|
int type;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
//
|
//
|
||||||
// Just exercise the analyzer on code that has at one point caused issues
|
// Just exercise the analyzer on code that has at one point caused issues
|
||||||
// (i.e., no assertions or crashes).
|
// (i.e., no assertions or crashes).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=basic -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=region -verify
|
||||||
|
|
||||||
unsigned foo();
|
unsigned foo();
|
||||||
typedef struct bf { unsigned x:2; } bf;
|
typedef struct bf { unsigned x:2; } bf;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
void f(void) {
|
void f(void) {
|
||||||
void (*p)(void);
|
void (*p)(void);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void f1() {
|
void f1() {
|
||||||
|
|
|
@ -1,7 +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 -analyzer-experimental-internal-checks -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 -analyzer-constraints=range --verify -fblocks %s
|
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
|
||||||
|
|
||||||
// <rdar://problem/6440393> - A bunch of misc. failures involving evaluating
|
// <rdar://problem/6440393> - A bunch of misc. failures involving evaluating
|
||||||
// these expressions and building CFGs. These tests are here to prevent
|
// these expressions and building CFGs. These tests are here to prevent
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic --verify -fblocks %s
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Test case 'checkaccess_union' differs for region store and basic store.
|
// Test case 'checkaccess_union' differs for region store and basic store.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s -analyzer-eagerly-assume
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s -analyzer-eagerly-assume
|
||||||
|
|
||||||
// Delta-reduced header stuff (needed for test cases).
|
// Delta-reduced header stuff (needed for test cases).
|
||||||
typedef signed char BOOL;
|
typedef signed char BOOL;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
|
||||||
|
|
||||||
// <rdar://problem/6776949>
|
// <rdar://problem/6776949>
|
||||||
// main's 'argc' argument is always > 0
|
// main's 'argc' argument is always > 0
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
|
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
|
||||||
|
|
||||||
// Here is a case where a pointer is treated as integer, invalidated as an
|
// Here is a case where a pointer is treated as integer, invalidated as an
|
||||||
// integer, and then used again as a pointer. This test just makes sure
|
// integer, and then used again as a pointer. This test just makes sure
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
|
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
|
||||||
|
|
||||||
// Here is a case where a pointer is treated as integer, invalidated as an
|
// Here is a case where a pointer is treated as integer, invalidated as an
|
||||||
// integer, and then used again as a pointer. This test just makes sure
|
// integer, and then used again as a pointer. This test just makes sure
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
|
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
|
||||||
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref --analyzer-store=region --verify -fblocks %s
|
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region --verify -fblocks %s
|
||||||
|
|
||||||
typedef struct objc_selector *SEL;
|
typedef struct objc_selector *SEL;
|
||||||
typedef signed char BOOL;
|
typedef signed char BOOL;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
|
// NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
|
||||||
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -fobjc-gc -analyzer-constraints=basic --verify -fblocks %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -fobjc-gc -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 -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=basic -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 -analyzer-experimental-internal-checks -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
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
|
||||||
|
|
||||||
typedef struct objc_ivar *Ivar;
|
typedef struct objc_ivar *Ivar;
|
||||||
typedef struct objc_selector *SEL;
|
typedef struct objc_selector *SEL;
|
||||||
|
|
|
@ -1,5 +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 -analyzer-experimental-internal-checks -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=region %s -verify
|
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
|
||||||
|
|
||||||
@interface MyClass {}
|
@interface MyClass {}
|
||||||
- (void *)voidPtrM;
|
- (void *)voidPtrM;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
// This is a test case for the issue reported in PR 2819:
|
// This is a test case for the issue reported in PR 2819:
|
||||||
// http://llvm.org/bugs/show_bug.cgi?id=2819
|
// http://llvm.org/bugs/show_bug.cgi?id=2819
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s
|
// RUN: clang-cc -checker-cfref -analyze -analyzer-experimental-internal-checks -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -checker-cfref -analyze -analyzer-store=region -verify %s
|
// RUN: clang-cc -checker-cfref -analyze -analyzer-experimental-internal-checks -analyzer-store=region -verify %s
|
||||||
// XFAIL: *
|
// XFAIL: *
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
|
|
||||||
// The store for 'a[1]' should not be removed mistakenly. SymbolicRegions may
|
// The store for 'a[1]' should not be removed mistakenly. SymbolicRegions may
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
|
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
|
||||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
|
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
|
||||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s
|
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s
|
||||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||||
|
|
||||||
typedef unsigned uintptr_t;
|
typedef unsigned uintptr_t;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
char f1() {
|
char f1() {
|
||||||
char* s = "abcd";
|
char* s = "abcd";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -Werror %s -analyzer-store=basic -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=region -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -Werror %s -analyzer-store=region -verify
|
||||||
|
|
||||||
// This test case illustrates that using '-analyze' overrides the effect of
|
// This test case illustrates that using '-analyze' overrides the effect of
|
||||||
// -Werror. This allows basic warnings not to interfere with producing
|
// -Werror. This allows basic warnings not to interfere with producing
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
// This test case was crashing due to how CFRefCount.cpp resolved the
|
// This test case was crashing due to how CFRefCount.cpp resolved the
|
||||||
// ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr.
|
// ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -pedantic -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -pedantic -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -pedantic -analyzer-store=region -verify %s
|
||||||
|
|
||||||
// BEGIN delta-debugging reduced header stuff
|
// BEGIN delta-debugging reduced header stuff
|
||||||
|
|
||||||
|
|
|
@ -1,5 +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 -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
// PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164
|
// PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify -triple i686-apple-darwin9 %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -triple i686-apple-darwin9 %s
|
||||||
|
|
||||||
void f1() {
|
void f1() {
|
||||||
int a[10];
|
int a[10];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=basic -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref %s --analyzer-store=region -verify
|
||||||
|
|
||||||
typedef int bar_return_t;
|
typedef int bar_return_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -warn-dead-stores -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-dead-stores -verify %s
|
||||||
//
|
//
|
||||||
// This test exercises the live variables analysis (LiveVariables.cpp).
|
// This test exercises the live variables analysis (LiveVariables.cpp).
|
||||||
// The case originally identified a non-termination bug.
|
// The case originally identified a non-termination bug.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s
|
// RUN: clang-cc -verify -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region %s
|
||||||
|
|
||||||
struct tea_cheese { unsigned magic; };
|
struct tea_cheese { unsigned magic; };
|
||||||
typedef struct tea_cheese kernel_tea_cheese_t;
|
typedef struct tea_cheese kernel_tea_cheese_t;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=basic %s
|
// RUN: clang-cc -verify -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic %s
|
||||||
|
|
||||||
struct tea_cheese { unsigned magic; };
|
struct tea_cheese { unsigned magic; };
|
||||||
typedef struct tea_cheese kernel_tea_cheese_t;
|
typedef struct tea_cheese kernel_tea_cheese_t;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=region -verify %s
|
||||||
//
|
//
|
||||||
// This test case mainly checks that the retain/release checker doesn't crash
|
// This test case mainly checks that the retain/release checker doesn't crash
|
||||||
// on this file.
|
// on this file.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
|
|
||||||
typedef const void * CFTypeRef;
|
typedef const void * CFTypeRef;
|
||||||
typedef double CFTimeInterval;
|
typedef double CFTimeInterval;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=basic %s -verify
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-constraints=basic -analyzer-store=region %s -verify
|
||||||
|
|
||||||
typedef struct Foo { int x; } Bar;
|
typedef struct Foo { int x; } Bar;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -triple i386-apple-darwin10 -analyzer-store=region
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -triple i386-apple-darwin10 -analyzer-store=region
|
||||||
// RUN: clang-cc -analyze -checker-cfref -triple i386-apple-darwin10 -analyzer-store=basic
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -triple i386-apple-darwin10 -analyzer-store=basic
|
||||||
|
|
||||||
// Note that the target triple is important for this test case. It specifies that we use the
|
// Note that the target triple is important for this test case. It specifies that we use the
|
||||||
// fragile Objective-C ABI.
|
// fragile Objective-C ABI.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
|
|
||||||
typedef const struct __CFString * CFStringRef;
|
typedef const struct __CFString * CFStringRef;
|
||||||
typedef const struct __CFAllocator * CFAllocatorRef;
|
typedef const struct __CFAllocator * CFAllocatorRef;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
|
||||||
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
|
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
|
||||||
//
|
//
|
||||||
// This test case simply should not crash. It evaluates the logic of not
|
// This test case simply should not crash. It evaluates the logic of not
|
||||||
// using MemRegion::getRValueType in incorrect places.
|
// using MemRegion::getRValueType in incorrect places.
|
||||||
|
|
|
@ -87,6 +87,10 @@ static llvm::cl::opt<bool>
|
||||||
AnalyzerExperimentalChecks("analyzer-experimental-checks",
|
AnalyzerExperimentalChecks("analyzer-experimental-checks",
|
||||||
llvm::cl::desc("Use experimental path-sensitive checks"));
|
llvm::cl::desc("Use experimental path-sensitive checks"));
|
||||||
|
|
||||||
|
static llvm::cl::opt<bool>
|
||||||
|
AnalyzerExperimentalInternalChecks("analyzer-experimental-internal-checks",
|
||||||
|
llvm::cl::desc("Use new default path-sensitive checks currently in testing"));
|
||||||
|
|
||||||
static llvm::cl::opt<std::string>
|
static llvm::cl::opt<std::string>
|
||||||
AnalyzeSpecificFunction("analyze-function",
|
AnalyzeSpecificFunction("analyze-function",
|
||||||
llvm::cl::desc("Run analysis on specific function"));
|
llvm::cl::desc("Run analysis on specific function"));
|
||||||
|
@ -131,6 +135,7 @@ void clang::InitializeAnalyzerOptions(AnalyzerOptions &Opts) {
|
||||||
Opts.EagerlyAssume = EagerlyAssume;
|
Opts.EagerlyAssume = EagerlyAssume;
|
||||||
Opts.AnalyzeSpecificFunction = AnalyzeSpecificFunction;
|
Opts.AnalyzeSpecificFunction = AnalyzeSpecificFunction;
|
||||||
Opts.EnableExperimentalChecks = AnalyzerExperimentalChecks;
|
Opts.EnableExperimentalChecks = AnalyzerExperimentalChecks;
|
||||||
|
Opts.EnableExperimentalInternalChecks = AnalyzerExperimentalInternalChecks;
|
||||||
Opts.TrimGraph = TrimGraph;
|
Opts.TrimGraph = TrimGraph;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,11 @@ sub Analyze {
|
||||||
push @CmdArgs,"-analyzer-display-progress";
|
push @CmdArgs,"-analyzer-display-progress";
|
||||||
push @CmdArgs,"-analyzer-eagerly-assume";
|
push @CmdArgs,"-analyzer-eagerly-assume";
|
||||||
push @CmdArgs,(split /\s/,$Analyses);
|
push @CmdArgs,(split /\s/,$Analyses);
|
||||||
|
|
||||||
|
if (defined $ENV{"CCC_EXPERIMENTAL_CHECKS"}) {
|
||||||
|
push @CmdArgs,"-analyzer-experimental-internal-checks";
|
||||||
|
}
|
||||||
|
|
||||||
$RunAnalyzer = 1;
|
$RunAnalyzer = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -903,6 +903,8 @@ OPTIONS:
|
||||||
|
|
||||||
-analyze-headers - Also analyze functions in #included files.
|
-analyze-headers - Also analyze functions in #included files.
|
||||||
|
|
||||||
|
--experimental-checks - Enable experimental checks that are currently in heavy testing
|
||||||
|
|
||||||
-o - Target directory for HTML report files. Subdirectories
|
-o - Target directory for HTML report files. Subdirectories
|
||||||
will be created as needed to represent separate "runs" of
|
will be created as needed to represent separate "runs" of
|
||||||
the analyzer. If this option is not specified, a directory
|
the analyzer. If this option is not specified, a directory
|
||||||
|
@ -1097,6 +1099,12 @@ while (@ARGV) {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($arg = "--experimental-checks") {
|
||||||
|
shift @ARGV;
|
||||||
|
$ENV{"CCC_EXPERIMENTAL_CHECKS"} = 1;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
if ($arg =~ /^--use-cc(=(.+))?$/) {
|
if ($arg =~ /^--use-cc(=(.+))?$/) {
|
||||||
shift @ARGV;
|
shift @ARGV;
|
||||||
my $cc;
|
my $cc;
|
||||||
|
|
Loading…
Reference in New Issue