aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/CFDateGC.m7
-rw-r--r--test/Analysis/CFNumber.c6
-rw-r--r--test/Analysis/CFRetainRelease_NSAssertionHandler.m14
-rw-r--r--test/Analysis/CGColorSpace.c6
-rw-r--r--test/Analysis/CheckNSError.m2
-rw-r--r--test/Analysis/MissingDealloc.m2
-rw-r--r--test/Analysis/NSPanel.m6
-rw-r--r--test/Analysis/NSString.m15
-rw-r--r--test/Analysis/NSWindow.m6
-rw-r--r--test/Analysis/NoReturn.m6
-rw-r--r--test/Analysis/ObjCProperties.m6
-rw-r--r--test/Analysis/ObjCRetSigs.m2
-rw-r--r--test/Analysis/PR2599.m5
-rw-r--r--test/Analysis/PR2978.m2
-rw-r--r--test/Analysis/PR3991.m6
-rw-r--r--test/Analysis/PR9741.cpp2
-rw-r--r--test/Analysis/additive-folding-range-constraints.c2
-rw-r--r--test/Analysis/additive-folding.c4
-rw-r--r--test/Analysis/analyzeOneFunction.m56
-rw-r--r--test/Analysis/array-struct-region.c4
-rw-r--r--test/Analysis/array-struct.c6
-rw-r--r--test/Analysis/auto-obj-dtors-cfg-output.cpp1365
-rw-r--r--test/Analysis/bstring.c8
-rw-r--r--test/Analysis/casts.c4
-rw-r--r--test/Analysis/casts.m23
-rw-r--r--test/Analysis/cfref_PR2519.c6
-rw-r--r--test/Analysis/cfref_rdar6080742.c6
-rw-r--r--test/Analysis/chroot.c2
-rw-r--r--test/Analysis/complex.c2
-rw-r--r--test/Analysis/concrete-address.c3
-rw-r--r--test/Analysis/constant-folding.c2
-rw-r--r--test/Analysis/dead-stores.c2
-rw-r--r--test/Analysis/dead-stores.cpp2
-rw-r--r--test/Analysis/dead-stores.m2
-rw-r--r--test/Analysis/default-diagnostic-visitors.c13
-rw-r--r--test/Analysis/delegates.m3
-rw-r--r--test/Analysis/div-zero.cpp13
-rw-r--r--test/Analysis/elementtype.c2
-rw-r--r--test/Analysis/exercise-ps.c3
-rw-r--r--test/Analysis/fields.c3
-rw-r--r--test/Analysis/flat-store.c11
-rw-r--r--test/Analysis/free.c2
-rw-r--r--test/Analysis/func.c3
-rw-r--r--test/Analysis/idempotent-operations.m2
-rw-r--r--test/Analysis/initializers-cfg-output.cpp105
-rw-r--r--test/Analysis/iterators.cpp2
-rw-r--r--test/Analysis/keychainAPI-diagnostic-visitor.m35
-rw-r--r--test/Analysis/keychainAPI.m323
-rw-r--r--test/Analysis/malloc-overflow.c113
-rw-r--r--test/Analysis/malloc-overflow.cpp11
-rw-r--r--test/Analysis/malloc.c4
-rw-r--r--test/Analysis/misc-ps-64.m6
-rw-r--r--test/Analysis/misc-ps-basic-store.m35
-rw-r--r--test/Analysis/misc-ps-cxx0x.cpp61
-rw-r--r--test/Analysis/misc-ps-eager-assume.m2
-rw-r--r--test/Analysis/misc-ps-flat-store.c10
-rw-r--r--test/Analysis/misc-ps-ranges.m3
-rw-r--r--test/Analysis/misc-ps-region-store-i386.m2
-rw-r--r--test/Analysis/misc-ps-region-store-x86_64.m2
-rw-r--r--test/Analysis/misc-ps-region-store.cpp57
-rw-r--r--test/Analysis/misc-ps-region-store.m4
-rw-r--r--test/Analysis/misc-ps-region-store.mm4
-rw-r--r--test/Analysis/misc-ps.m13
-rw-r--r--test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m2
-rw-r--r--test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m9
-rw-r--r--test/Analysis/no-exit-cfg.c3
-rw-r--r--test/Analysis/no-outofbounds.c3
-rw-r--r--test/Analysis/null-deref-ps-region.c2
-rw-r--r--test/Analysis/null-deref-ps.c6
-rw-r--r--test/Analysis/nullptr.cpp2
-rw-r--r--test/Analysis/objc-arc.m8
-rw-r--r--test/Analysis/operator-calls.cpp2
-rw-r--r--test/Analysis/out-of-bounds.c5
-rw-r--r--test/Analysis/outofbound-notwork.c32
-rw-r--r--test/Analysis/outofbound.c11
-rw-r--r--test/Analysis/override-werror.c3
-rw-r--r--test/Analysis/plist-output-alternate.m316
-rw-r--r--test/Analysis/plist-output.m2
-rw-r--r--test/Analysis/pr4209.m3
-rw-r--r--test/Analysis/pr_2542_rdar_6793404.m3
-rw-r--r--test/Analysis/pr_4164.c3
-rw-r--r--test/Analysis/properties.m2
-rw-r--r--test/Analysis/pthreadlock.c137
-rw-r--r--test/Analysis/ptr-arith.c4
-rw-r--r--test/Analysis/rdar-6442306-1.m3
-rw-r--r--test/Analysis/rdar-6540084.m2
-rw-r--r--test/Analysis/rdar-6541136-region.c2
-rw-r--r--test/Analysis/rdar-6541136.c20
-rw-r--r--test/Analysis/rdar-6562655.m3
-rw-r--r--test/Analysis/rdar-6582778-basic-store.c22
-rw-r--r--test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m3
-rw-r--r--test/Analysis/rdar-7168531.m3
-rw-r--r--test/Analysis/refcnt_naming.m3
-rw-r--r--test/Analysis/reference.cpp3
-rw-r--r--test/Analysis/region-1.m3
-rw-r--r--test/Analysis/retain-release-basic-store.m104
-rw-r--r--test/Analysis/retain-release-gc-only.m5
-rw-r--r--test/Analysis/retain-release-path-notes-gc.m3
-rw-r--r--test/Analysis/retain-release-path-notes.m3
-rw-r--r--test/Analysis/retain-release-region-store.m2
-rw-r--r--test/Analysis/retain-release.m76
-rw-r--r--test/Analysis/retain-release.mm12
-rw-r--r--test/Analysis/security-syntax-checks-no-emit.c2
-rw-r--r--test/Analysis/security-syntax-checks.m19
-rw-r--r--test/Analysis/self-init.m2
-rw-r--r--test/Analysis/sizeofpointer.c2
-rw-r--r--test/Analysis/stack-addr-ps.c3
-rw-r--r--test/Analysis/stack-addr-ps.cpp30
-rw-r--r--test/Analysis/stack-block-returned.cpp9
-rw-r--r--test/Analysis/stream.c2
-rw-r--r--test/Analysis/string-fail.c4
-rw-r--r--test/Analysis/string.c8
-rw-r--r--test/Analysis/temp-obj-dtors-cfg-output.cpp1141
-rw-r--r--test/Analysis/undef-buffers.c13
-rw-r--r--test/Analysis/uninit-msg-expr.m1
-rw-r--r--test/Analysis/uninit-ps-rdar6145427.m1
-rw-r--r--test/Analysis/uninit-vals-ps.c1
-rw-r--r--test/Analysis/uninit-vals.m1
-rw-r--r--test/Analysis/unix-fns.c1
-rw-r--r--test/Analysis/unreachable-code-path.c2
-rw-r--r--test/Analysis/unused-ivars.m4
-rw-r--r--test/Analysis/variadic-method-types.m1
122 files changed, 2718 insertions, 1798 deletions
diff --git a/test/Analysis/CFDateGC.m b/test/Analysis/CFDateGC.m
index bd1a4b7967ca..69b99f052b01 100644
--- a/test/Analysis/CFDateGC.m
+++ b/test/Analysis/CFDateGC.m
@@ -1,8 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s -Wno-implicit-function-declaration
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s -Wno-implicit-function-declaration
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
diff --git a/test/Analysis/CFNumber.c b/test/Analysis/CFNumber.c
index 11af0747a317..fbbe4d15f49f 100644
--- a/test/Analysis/CFNumber.c
+++ b/test/Analysis/CFNumber.c
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber,osx.cocoa.RetainCount -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber,osx.cocoa.RetainCount -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
typedef signed long CFIndex;
typedef const struct __CFAllocator * CFAllocatorRef;
diff --git a/test/Analysis/CFRetainRelease_NSAssertionHandler.m b/test/Analysis/CFRetainRelease_NSAssertionHandler.m
index ee52201e6285..e0c9be1c1ebf 100644
--- a/test/Analysis/CFRetainRelease_NSAssertionHandler.m
+++ b/test/Analysis/CFRetainRelease_NSAssertionHandler.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -verify %s -analyzer-constraints=basic -analyzer-store=region
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -verify %s -analyzer-constraints=range -analyzer-store=region
typedef struct objc_selector *SEL;
typedef signed char BOOL;
@@ -22,6 +20,7 @@ extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
@interface NSAssertionHandler : NSObject {}
+ (NSAssertionHandler *)currentHandler;
- (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format,...;
+- (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format,...;
@end
extern NSString * const NSConnectionReplyMode;
@@ -65,3 +64,10 @@ extern NSString * const NSConnectionReplyMode;
}
@end
+
+void pointerFunction (int *x) {
+ // Manual expansion of NSCAssert( x != 0, @"")
+ do { if (!((x != 0))) { [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] file:[NSString stringWithUTF8String:__FILE__] lineNumber:__LINE__ description:((@""))]; } } while(0);
+
+ *x = 1; // no-warning
+}
diff --git a/test/Analysis/CGColorSpace.c b/test/Analysis/CGColorSpace.c
index ea458404c5dd..1bd20fa1cfa1 100644
--- a/test/Analysis/CGColorSpace.c
+++ b/test/Analysis/CGColorSpace.c
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-constraints=range -verify %s
typedef struct CGColorSpace *CGColorSpaceRef;
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
diff --git a/test/Analysis/CheckNSError.m b/test/Analysis/CheckNSError.m
index 3bc7d8f748e1..5bf7e08a587a 100644
--- a/test/Analysis/CheckNSError.m
+++ b/test/Analysis/CheckNSError.m
@@ -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
diff --git a/test/Analysis/MissingDealloc.m b/test/Analysis/MissingDealloc.m
index e7930d1223b7..51a5912d4443 100644
--- a/test/Analysis/MissingDealloc.m
+++ b/test/Analysis/MissingDealloc.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.experimental.Dealloc '-DIBOutlet=__attribute__((iboutlet))' %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.osx.cocoa.Dealloc '-DIBOutlet=__attribute__((iboutlet))' %s -verify
typedef signed char BOOL;
@protocol NSObject
- (BOOL)isEqual:(id)object;
diff --git a/test/Analysis/NSPanel.m b/test/Analysis/NSPanel.m
index 19b72d8f692f..ac725716457f 100644
--- a/test/Analysis/NSPanel.m
+++ b/test/Analysis/NSPanel.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
// BEGIN delta-debugging reduced header stuff
diff --git a/test/Analysis/NSString.m b/test/Analysis/NSString.m
index 6ff4bb1e554f..48450daa013d 100644
--- a/test/Analysis/NSString.m
+++ b/test/Analysis/NSString.m
@@ -1,13 +1,8 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=range -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=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
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,osx.AtomicCAS,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,osx.AtomicCAS,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,osx.AtomicCAS,experimental.core -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.cocoa.RetainCount,osx.AtomicCAS,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
+
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
diff --git a/test/Analysis/NSWindow.m b/test/Analysis/NSWindow.m
index 404448574ea1..495f8e19d8ef 100644
--- a/test/Analysis/NSWindow.m
+++ b/test/Analysis/NSWindow.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core,deadcode.DeadStores -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core,deadcode.DeadStores -analyzer-store=region -analyzer-constraints=range -verify %s
// These declarations were reduced using Delta-Debugging from Foundation.h
// on Mac OS X. The test cases are below.
diff --git a/test/Analysis/NoReturn.m b/test/Analysis/NoReturn.m
index 42952ed3a7cc..ea2efd061711 100644
--- a/test/Analysis/NoReturn.m
+++ b/test/Analysis/NoReturn.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
#include <stdarg.h>
diff --git a/test/Analysis/ObjCProperties.m b/test/Analysis/ObjCProperties.m
index 103db486b1c2..d88e0571e4c1 100644
--- a/test/Analysis/ObjCProperties.m
+++ b/test/Analysis/ObjCProperties.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=basic %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range %s -verify
// The point of this test cases is to exercise properties in the static
// analyzer
diff --git a/test/Analysis/ObjCRetSigs.m b/test/Analysis/ObjCRetSigs.m
index 9778e41d9ced..02be25717a63 100644
--- a/test/Analysis/ObjCRetSigs.m
+++ b/test/Analysis/ObjCRetSigs.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify %s
int printf(const char *, ...);
diff --git a/test/Analysis/PR2599.m b/test/Analysis/PR2599.m
index b9e9d6b757de..5436063738a6 100644
--- a/test/Analysis/PR2599.m
+++ b/test/Analysis/PR2599.m
@@ -1,7 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-constraints=range -analyzer-store=region -fobjc-gc -verify %s
typedef const void * CFTypeRef;
typedef const struct __CFString * CFStringRef;
diff --git a/test/Analysis/PR2978.m b/test/Analysis/PR2978.m
index c07150f0ce2a..ea139d28af82 100644
--- a/test/Analysis/PR2978.m
+++ b/test/Analysis/PR2978.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=osx.cocoa.experimental.Dealloc %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=experimental.osx.cocoa.Dealloc %s -verify
// Tests for the checker which checks missing/extra ivar 'release' calls
// in dealloc.
diff --git a/test/Analysis/PR3991.m b/test/Analysis/PR3991.m
index 23f199311e47..38d0bc0b5293 100644
--- a/test/Analysis/PR3991.m
+++ b/test/Analysis/PR3991.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
//===----------------------------------------------------------------------===//
// Delta-debugging produced forward declarations.
diff --git a/test/Analysis/PR9741.cpp b/test/Analysis/PR9741.cpp
index e20e56c9406a..7497d5627c91 100644
--- a/test/Analysis/PR9741.cpp
+++ b/test/Analysis/PR9741.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cc1 -std=c++0x -Wuninitialized -verify %s
+// RUN: %clang_cc1 -cc1 -std=c++11 -Wuninitialized -verify %s
void f() {
int a[] = { 1, 2, 3 };
diff --git a/test/Analysis/additive-folding-range-constraints.c b/test/Analysis/additive-folding-range-constraints.c
index e342bb453cda..32e0cfe142ad 100644
--- a/test/Analysis/additive-folding-range-constraints.c
+++ b/test/Analysis/additive-folding-range-constraints.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -verify -analyzer-constraints=range %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -verify -analyzer-constraints=range %s
// These are used to trigger warnings.
typedef typeof(sizeof(int)) size_t;
diff --git a/test/Analysis/additive-folding.c b/test/Analysis/additive-folding.c
index 17d9db6ea23a..71d0151f22af 100644
--- a/test/Analysis/additive-folding.c
+++ b/test/Analysis/additive-folding.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode,unix.experimental.Malloc -verify -analyzer-constraints=basic %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode,unix.experimental.Malloc -verify -analyzer-constraints=range %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.deadcode.UnreachableCode,experimental.unix.Malloc -verify -analyzer-constraints=basic %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.deadcode.UnreachableCode,experimental.unix.Malloc -verify -analyzer-constraints=range %s
// These are used to trigger warnings.
typedef typeof(sizeof(int)) size_t;
diff --git a/test/Analysis/analyzeOneFunction.m b/test/Analysis/analyzeOneFunction.m
new file mode 100644
index 000000000000..1ff2fc8fe8a3
--- /dev/null
+++ b/test/Analysis/analyzeOneFunction.m
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -analyze -analyze-function="myMethodWithY:withX:" -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s
+
+typedef signed char BOOL;
+typedef unsigned int NSUInteger;
+typedef struct _NSZone NSZone;
+@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+@protocol NSObject - (BOOL)isEqual:(id)object; @end
+@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end
+@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
+@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end
+@interface NSObject <NSObject> {}
++(id)alloc;
+-(id)init;
+-(id)autorelease;
+-(id)copy;
+-(id)retain;
+@end
+@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
+- (NSUInteger)length;
+-(id)initWithFormat:(NSString *)f,...;
+-(BOOL)isEqualToString:(NSString *)s;
++ (id)string;
+@end
+
+@interface Test1 : NSObject {
+ NSString *text;
+}
+-(id)myMethod;
+-(id)myMethodWithY:(int)Y withX:(int)X;
+
+@property (nonatomic, assign) NSString *text;
+@end
+
+@implementation Test1
+
+@synthesize text;
+
+-(id)myMethod {
+ Test1 *cell = [[[Test1 alloc] init] autorelease];
+
+ NSString *string1 = [[NSString alloc] initWithFormat:@"test %f", 0.0]; // No warning: this function is not analized.
+ cell.text = string1;
+
+ return cell;
+}
+
+-(id)myMethodWithY:(int)Y withX:(int)X {
+ Test1 *cell = [[[Test1 alloc] init] autorelease];
+
+ NSString *string1 = [[NSString alloc] initWithFormat:@"test %f %d", 0.0, X+Y]; // expected-warning {{Potential leak}}
+ cell.text = string1;
+
+ return cell;
+}
+
+@end
diff --git a/test/Analysis/array-struct-region.c b/test/Analysis/array-struct-region.c
index 37a6f75b3ca2..1284933db09d 100644
--- a/test/Analysis/array-struct-region.c
+++ b/test/Analysis/array-struct-region.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,deadcode.experimental.UnreachableCode -analyzer-store=region -analyzer-constraints=basic -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,deadcode.experimental.UnreachableCode -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core,experimental.deadcode.UnreachableCode -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core,experimental.deadcode.UnreachableCode -analyzer-store=region -analyzer-constraints=range -verify %s
int string_literal_init() {
char a[] = "abc";
diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c
index 6b8bb6c5f675..c5bdb86a14ed 100644
--- a/test/Analysis/array-struct.c
+++ b/test/Analysis/array-struct.c
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core.CastToStruct -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core.CastToStruct -analyzer-store=region -analyzer-constraints=range -verify %s
struct s {
int data;
diff --git a/test/Analysis/auto-obj-dtors-cfg-output.cpp b/test/Analysis/auto-obj-dtors-cfg-output.cpp
index c877061eb6ae..17aa486de0ce 100644
--- a/test/Analysis/auto-obj-dtors-cfg-output.cpp
+++ b/test/Analysis/auto-obj-dtors-cfg-output.cpp
@@ -155,655 +155,718 @@ void test_catch_copy() {
}
}
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3: const A &b = a;
-// CHECK: 4: A()
-// CHECK: 5: const A &c = A();
-// CHECK: 6: [B1.5].~A() (Implicit destructor)
-// CHECK: 7: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1:
-// CHECK: 2: A a[2];
-// CHECK: 3:
-// CHECK: 4: A b[0];
-// CHECK: 5: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3:
-// CHECK: 4: A c;
-// CHECK: 5:
-// CHECK: 6: A d;
-// CHECK: 7: [B1.6].~A() (Implicit destructor)
-// CHECK: 8: [B1.4].~A() (Implicit destructor)
-// CHECK: 9:
-// CHECK: 10: A b;
-// CHECK: 11: [B1.10].~A() (Implicit destructor)
-// CHECK: 12: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B4 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B3
-// CHECK: [ B1 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B1.2].~A() (Implicit destructor)
-// CHECK: 4: [B3.4].~A() (Implicit destructor)
-// CHECK: 5: [B3.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: return;
-// CHECK: 2: [B3.4].~A() (Implicit destructor)
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B3
-// CHECK: Successors (1): B0
-// CHECK: [ B3 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3:
-// CHECK: 4: A b;
-// CHECK: 5: UV
-// CHECK: T: if [B3.5]
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (2): B2 B1
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (2): B1 B2
-// CHECK: Successors (0):
-// CHECK: [ B8 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B7
-// CHECK: [ B1 ]
-// CHECK: l1:
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B1.2].~A() (Implicit destructor)
-// CHECK: 4: [B6.2].~A() (Implicit destructor)
-// CHECK: 5: [B7.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1:
-// CHECK: 2: A b;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: 4: [B6.4].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: [B6.4].~A() (Implicit destructor)
-// CHECK: T: goto l1;
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1: UV
-// CHECK: T: if [B4.1]
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (2): B3 B2
-// CHECK: [ B5 ]
-// CHECK: 1: [B6.4].~A() (Implicit destructor)
-// CHECK: 2: [B6.2].~A() (Implicit destructor)
-// CHECK: T: goto l0;
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B6
-// CHECK: [ B6 ]
-// CHECK: l0:
-// CHECK: 1:
-// CHECK: 2: A b;
-// CHECK: 3:
-// CHECK: 4: A a;
-// CHECK: 5: UV
-// CHECK: T: if [B6.5]
-// CHECK: Predecessors (2): B7 B5
-// CHECK: Successors (2): B5 B4
-// CHECK: [ B7 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (1): B6
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B5 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B4
-// CHECK: [ B1 ]
-// CHECK: 1: [B4.4].~A() (Implicit destructor)
-// CHECK: 2: [B4.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: A b = a;
-// CHECK: 5: b.operator int()
-// CHECK: 6: [B4.5]
-// CHECK: T: if [B4.6]
-// CHECK: Predecessors (1): B5
-// CHECK: Successors (2): B3 B2
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B9 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B8
-// CHECK: [ B1 ]
-// CHECK: 1: [B8.4].~A() (Implicit destructor)
-// CHECK: 2:
-// CHECK: 3: A e;
-// CHECK: 4: [B1.3].~A() (Implicit destructor)
-// CHECK: 5: [B8.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B5
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1:
-// CHECK: 2: A d;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: 4: [B4.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: return;
-// CHECK: 2: [B4.2].~A() (Implicit destructor)
-// CHECK: 3: [B8.4].~A() (Implicit destructor)
-// CHECK: 4: [B8.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B0
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: T: if [B4.3]
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (2): B3 B2
-// CHECK: [ B5 ]
-// CHECK: 1:
-// CHECK: 2: A d;
-// CHECK: 3: [B5.2].~A() (Implicit destructor)
-// CHECK: 4: [B7.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B1
-// CHECK: [ B6 ]
-// CHECK: 1: return;
-// CHECK: 2: [B7.2].~A() (Implicit destructor)
-// CHECK: 3: [B8.4].~A() (Implicit destructor)
-// CHECK: 4: [B8.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B0
-// CHECK: [ B7 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: T: if [B7.3]
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (2): B6 B5
-// CHECK: [ B8 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: A b = a;
-// CHECK: 5: b.operator int()
-// CHECK: 6: [B8.5]
-// CHECK: T: if [B8.6]
-// CHECK: Predecessors (1): B9
-// CHECK: Successors (2): B7 B4
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (3): B1 B3 B6
-// CHECK: Successors (0):
-// CHECK: [ B6 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B5
-// CHECK: [ B1 ]
-// CHECK: 1: [B2.2].~A() (Implicit destructor)
-// CHECK: 2: [B5.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: a
-// CHECK: 2: A b = a;
-// CHECK: 3: b.operator int()
-// CHECK: 4: [B2.3]
-// CHECK: T: while [B2.4]
-// CHECK: Predecessors (2): B3 B5
-// CHECK: Successors (2): B4 B1
-// CHECK: [ B3 ]
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B2
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: 4: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B3
-// CHECK: [ B5 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B2
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B12 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B11
-// CHECK: [ B1 ]
-// CHECK: 1: [B2.2].~A() (Implicit destructor)
-// CHECK: 2:
-// CHECK: 3: A e;
-// CHECK: 4: [B1.3].~A() (Implicit destructor)
-// CHECK: 5: [B11.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B9 B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: a
-// CHECK: 2: A b = a;
-// CHECK: 3: b.operator int()
-// CHECK: 4: [B2.3]
-// CHECK: T: while [B2.4]
-// CHECK: Predecessors (2): B3 B11
-// CHECK: Successors (2): B10 B1
-// CHECK: [ B3 ]
-// CHECK: Predecessors (2): B4 B7
-// CHECK: Successors (1): B2
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A d;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: 4: [B10.2].~A() (Implicit destructor)
-// CHECK: 5: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B3
-// CHECK: [ B5 ]
-// CHECK: 1: return;
-// CHECK: 2: [B10.2].~A() (Implicit destructor)
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: 4: [B11.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B0
-// CHECK: [ B6 ]
-// CHECK: 1: UV
-// CHECK: T: if [B6.1]
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (2): B5 B4
-// CHECK: [ B7 ]
-// CHECK: 1: [B10.2].~A() (Implicit destructor)
-// CHECK: 2: [B2.2].~A() (Implicit destructor)
-// CHECK: T: continue;
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (1): B3
-// CHECK: [ B8 ]
-// CHECK: 1: UV
-// CHECK: T: if [B8.1]
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (2): B7 B6
-// CHECK: [ B9 ]
-// CHECK: 1: [B10.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (1): B1
-// CHECK: [ B10 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: T: if [B10.3]
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (2): B9 B8
-// CHECK: [ B11 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: Predecessors (1): B12
-// CHECK: Successors (1): B2
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (2): B1 B5
-// CHECK: Successors (0):
-// CHECK: [ B4 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B2
-// CHECK: [ B1 ]
-// CHECK: 1: UV
-// CHECK: T: do ... while [B1.1]
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (2): B3 B0
-// CHECK: [ B2 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B3 B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (1): B2
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B12 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B11
-// CHECK: [ B1 ]
-// CHECK: 1:
-// CHECK: 2: A d;
-// CHECK: 3: [B1.2].~A() (Implicit destructor)
-// CHECK: 4: [B11.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B8 B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: UV
-// CHECK: T: do ... while [B2.1]
-// CHECK: Predecessors (2): B3 B6
-// CHECK: Successors (2): B10 B1
-// CHECK: [ B3 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: 4: [B9.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B5
-// CHECK: Successors (1): B2
-// CHECK: [ B4 ]
-// CHECK: 1: return;
-// CHECK: 2: [B9.2].~A() (Implicit destructor)
-// CHECK: 3: [B11.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B5
-// CHECK: Successors (1): B0
-// CHECK: [ B5 ]
-// CHECK: 1: UV
-// CHECK: T: if [B5.1]
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (2): B4 B3
-// CHECK: [ B6 ]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: continue;
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B2
-// CHECK: [ B7 ]
-// CHECK: 1: UV
-// CHECK: T: if [B7.1]
-// CHECK: Predecessors (1): B9
-// CHECK: Successors (2): B6 B5
-// CHECK: [ B8 ]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Predecessors (1): B9
-// CHECK: Successors (1): B1
-// CHECK: [ B9 ]
-// CHECK: 1:
-// CHECK: 2: A b;
-// CHECK: 3: UV
-// CHECK: T: if [B9.3]
-// CHECK: Predecessors (2): B10 B11
-// CHECK: Successors (2): B8 B7
-// CHECK: [ B10 ]
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B9
-// CHECK: [ B11 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: Predecessors (1): B12
-// CHECK: Successors (1): B9
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (2): B1 B4
-// CHECK: Successors (0):
-// CHECK: [ B4 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B2
-// CHECK: [ B1 ]
-// CHECK: 1: [B2.4].~A() (Implicit destructor)
-// CHECK: 2: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B3 B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: A b = a;
-// CHECK: 5: b.operator int()
-// CHECK: T: switch [B2.5]
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B9 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B2
-// CHECK: [ B1 ]
-// CHECK: 1: [B2.4].~A() (Implicit destructor)
-// CHECK: 2:
-// CHECK: 3: A g;
-// CHECK: 4: [B1.3].~A() (Implicit destructor)
-// CHECK: 5: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (3): B3 B7 B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: A b = a;
-// CHECK: 5: b.operator int()
-// CHECK: T: switch [B2.5]
-// CHECK: Predecessors (1): B9
-// CHECK: Successors (3): B3 B8
-// CHECK: B1
-// CHECK: [ B3 ]
-// CHECK: case 1:
-// CHECK: T: break;
-// CHECK: Predecessors (2): B2 B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A f;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: 4: [B8.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B3
-// CHECK: [ B5 ]
-// CHECK: 1: return;
-// CHECK: 2: [B8.2].~A() (Implicit destructor)
-// CHECK: 3: [B2.4].~A() (Implicit destructor)
-// CHECK: 4: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B0
-// CHECK: [ B6 ]
-// CHECK: 1: UV
-// CHECK: T: if [B6.1]
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (2): B5 B4
-// CHECK: [ B7 ]
-// CHECK: 1: [B8.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (1): B1
-// CHECK: [ B8 ]
-// CHECK: case 0:
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: T: if [B8.3]
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (2): B7 B6
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (2): B1 B5
-// CHECK: Successors (0):
-// CHECK: [ B6 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B5
-// CHECK: [ B1 ]
-// CHECK: 1: [B2.2].~A() (Implicit destructor)
-// CHECK: 2: [B5.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: a
-// CHECK: 2: A b = a;
-// CHECK: 3: b.operator int()
-// CHECK: 4: [B2.3]
-// CHECK: T: for (...; [B2.4]; )
-// CHECK: Predecessors (2): B3 B5
-// CHECK: Successors (2): B4 B1
-// CHECK: [ B3 ]
-// CHECK: 1: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B2
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A c;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B3
-// CHECK: [ B5 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B2
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B12 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B11
-// CHECK: [ B1 ]
-// CHECK: 1: [B2.2].~A() (Implicit destructor)
-// CHECK: 2: [B11.4].~A() (Implicit destructor)
-// CHECK: 3:
-// CHECK: 4: A f;
-// CHECK: 5: [B1.4].~A() (Implicit destructor)
-// CHECK: 6: [B11.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B9 B2
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: b
-// CHECK: 2: A c = b;
-// CHECK: 3: c.operator int()
-// CHECK: 4: [B2.3]
-// CHECK: T: for (...; [B2.4]; )
-// CHECK: Predecessors (2): B3 B11
-// CHECK: Successors (2): B10 B1
-// CHECK: [ B3 ]
-// CHECK: 1: [B2.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B4 B7
-// CHECK: Successors (1): B2
-// CHECK: [ B4 ]
-// CHECK: 1:
-// CHECK: 2: A e;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: 4: [B10.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B3
-// CHECK: [ B5 ]
-// CHECK: 1: return;
-// CHECK: 2: [B10.2].~A() (Implicit destructor)
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: 4: [B11.4].~A() (Implicit destructor)
-// CHECK: 5: [B11.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B6
-// CHECK: Successors (1): B0
-// CHECK: [ B6 ]
-// CHECK: 1: UV
-// CHECK: T: if [B6.1]
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (2): B5 B4
-// CHECK: [ B7 ]
-// CHECK: 1: [B10.2].~A() (Implicit destructor)
-// CHECK: T: continue;
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (1): B3
-// CHECK: [ B8 ]
-// CHECK: 1: UV
-// CHECK: T: if [B8.1]
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (2): B7 B6
-// CHECK: [ B9 ]
-// CHECK: 1: [B10.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (1): B1
-// CHECK: [ B10 ]
-// CHECK: 1:
-// CHECK: 2: A d;
-// CHECK: 3: UV
-// CHECK: T: if [B10.3]
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (2): B9 B8
-// CHECK: [ B11 ]
-// CHECK: 1:
-// CHECK: 2: A a;
-// CHECK: 3:
-// CHECK: 4: A b;
-// CHECK: Predecessors (1): B12
-// CHECK: Successors (1): B2
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (2): B1 B5
-// CHECK: Successors (0):
-// CHECK: [ B3 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B0
-// CHECK: [ B1 ]
-// CHECK: T: try ...
-// CHECK: Predecessors (0):
-// CHECK: Successors (2): B2 B0
-// CHECK: [ B2 ]
-// CHECK: catch (const A &e):
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (3): B2 B1 B3
-// CHECK: Successors (0):
-// CHECK: [ B3 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B0
-// CHECK: [ B1 ]
-// CHECK: T: try ...
-// CHECK: Predecessors (0):
-// CHECK: Successors (2): B2 B0
-// CHECK: [ B2 ]
-// CHECK: catch (A e):
-// CHECK: 1: .~A() (Implicit destructor)
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (3): B2 B1 B3
-// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3: a
+// CHECK: 4: [B1.3]
+// CHECK: 5: const A &b = a;
+// CHECK: 6: A()
+// CHECK: 7: [B1.6] (BindTemporary)
+// CHECK: 8: [B1.7]
+// CHECK: 9: [B1.8]
+// CHECK: 10: const A &c = A();
+// CHECK: 11: [B1.10].~A() (Implicit destructor)
+// CHECK: 12: [B1.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1:
+// CHECK: 2: A a[2];
+// CHECK: 3:
+// CHECK: 4: A b[0];
+// CHECK: 5: [B1.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3:
+// CHECK: 4: A c;
+// CHECK: 5:
+// CHECK: 6: A d;
+// CHECK: 7: [B1.6].~A() (Implicit destructor)
+// CHECK: 8: [B1.4].~A() (Implicit destructor)
+// CHECK: 9:
+// CHECK: 10: A b;
+// CHECK: 11: [B1.10].~A() (Implicit destructor)
+// CHECK: 12: [B1.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B4 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B3
+// CHECK: [ B1 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B1.2].~A() (Implicit destructor)
+// CHECK: 4: [B3.4].~A() (Implicit destructor)
+// CHECK: 5: [B3.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: return;
+// CHECK: 2: [B3.4].~A() (Implicit destructor)
+// CHECK: 3: [B3.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B3
+// CHECK: Successors (1): B0
+// CHECK: [ B3 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3:
+// CHECK: 4: A b;
+// CHECK: 5: UV
+// CHECK: 6: [B3.5]
+// CHECK: T: if [B3.6]
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (2): B2 B1
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (2): B1 B2
+// CHECK: Successors (0):
+// CHECK: [ B8 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B7
+// CHECK: [ B1 ]
+// CHECK: l1:
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B1.2].~A() (Implicit destructor)
+// CHECK: 4: [B6.2].~A() (Implicit destructor)
+// CHECK: 5: [B7.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1:
+// CHECK: 2: A b;
+// CHECK: 3: [B2.2].~A() (Implicit destructor)
+// CHECK: 4: [B6.4].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: [B6.4].~A() (Implicit destructor)
+// CHECK: T: goto l1;
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1: UV
+// CHECK: 2: [B4.1]
+// CHECK: T: if [B4.2]
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (2): B3 B2
+// CHECK: [ B5 ]
+// CHECK: 1: [B6.4].~A() (Implicit destructor)
+// CHECK: 2: [B6.2].~A() (Implicit destructor)
+// CHECK: T: goto l0;
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B6
+// CHECK: [ B6 ]
+// CHECK: l0:
+// CHECK: 1:
+// CHECK: 2: A b;
+// CHECK: 3:
+// CHECK: 4: A a;
+// CHECK: 5: UV
+// CHECK: 6: [B6.5]
+// CHECK: T: if [B6.6]
+// CHECK: Predecessors (2): B7 B5
+// CHECK: Successors (2): B5 B4
+// CHECK: [ B7 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (1): B6
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B5 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B4
+// CHECK: [ B1 ]
+// CHECK: 1: [B4.6].~A() (Implicit destructor)
+// CHECK: 2: [B4.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B2.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B3.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3: a
+// CHECK: 4: [B4.3]
+// CHECK: 5: [B4.4]
+// CHECK: 6: A b = a;
+// CHECK: 7: b
+// CHECK: 8: [B4.7]
+// CHECK: 9: [B4.8].operator int
+// CHECK: 10: [B4.9]()
+// CHECK: 11: [B4.10]
+// CHECK: T: if [B4.11]
+// CHECK: Predecessors (1): B5
+// CHECK: Successors (2): B3 B2
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B9 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B8
+// CHECK: [ B1 ]
+// CHECK: 1: [B8.6].~A() (Implicit destructor)
+// CHECK: 2:
+// CHECK: 3: A e;
+// CHECK: 4: [B1.3].~A() (Implicit destructor)
+// CHECK: 5: [B8.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B5
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1:
+// CHECK: 2: A d;
+// CHECK: 3: [B2.2].~A() (Implicit destructor)
+// CHECK: 4: [B4.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: return;
+// CHECK: 2: [B4.2].~A() (Implicit destructor)
+// CHECK: 3: [B8.6].~A() (Implicit destructor)
+// CHECK: 4: [B8.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B0
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: UV
+// CHECK: 4: [B4.3]
+// CHECK: T: if [B4.4]
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (2): B3 B2
+// CHECK: [ B5 ]
+// CHECK: 1:
+// CHECK: 2: A d;
+// CHECK: 3: [B5.2].~A() (Implicit destructor)
+// CHECK: 4: [B7.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B1
+// CHECK: [ B6 ]
+// CHECK: 1: return;
+// CHECK: 2: [B7.2].~A() (Implicit destructor)
+// CHECK: 3: [B8.6].~A() (Implicit destructor)
+// CHECK: 4: [B8.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B0
+// CHECK: [ B7 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: UV
+// CHECK: 4: [B7.3]
+// CHECK: T: if [B7.4]
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (2): B6 B5
+// CHECK: [ B8 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3: a
+// CHECK: 4: [B8.3]
+// CHECK: 5: [B8.4]
+// CHECK: 6: A b = a;
+// CHECK: 7: b
+// CHECK: 8: [B8.7]
+// CHECK: 9: [B8.8].operator int
+// CHECK: 10: [B8.9]()
+// CHECK: 11: [B8.10]
+// CHECK: T: if [B8.11]
+// CHECK: Predecessors (1): B9
+// CHECK: Successors (2): B7 B4
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (3): B1 B3 B6
+// CHECK: Successors (0):
+// CHECK: [ B6 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B5
+// CHECK: [ B1 ]
+// CHECK: 1: [B2.4].~A() (Implicit destructor)
+// CHECK: 2: [B5.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: a
+// CHECK: 2: [B2.1]
+// CHECK: 3: [B2.2]
+// CHECK: 4: A b = a;
+// CHECK: 5: b
+// CHECK: 6: [B2.5]
+// CHECK: 7: [B2.6].operator int
+// CHECK: 8: [B2.7]()
+// CHECK: 9: [B2.8]
+// CHECK: T: while [B2.9]
+// CHECK: Predecessors (2): B3 B5
+// CHECK: Successors (2): B4 B1
+// CHECK: [ B3 ]
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B2
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B4.2].~A() (Implicit destructor)
+// CHECK: 4: [B2.4].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B3
+// CHECK: [ B5 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B2
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B12 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B11
+// CHECK: [ B1 ]
+// CHECK: 1: [B2.4].~A() (Implicit destructor)
+// CHECK: 2:
+// CHECK: 3: A e;
+// CHECK: 4: [B1.3].~A() (Implicit destructor)
+// CHECK: 5: [B11.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B9 B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: a
+// CHECK: 2: [B2.1]
+// CHECK: 3: [B2.2]
+// CHECK: 4: A b = a;
+// CHECK: 5: b
+// CHECK: 6: [B2.5]
+// CHECK: 7: [B2.6].operator int
+// CHECK: 8: [B2.7]()
+// CHECK: 9: [B2.8]
+// CHECK: T: while [B2.9]
+// CHECK: Predecessors (2): B3 B11
+// CHECK: Successors (2): B10 B1
+// CHECK: [ B3 ]
+// CHECK: Predecessors (2): B4 B7
+// CHECK: Successors (1): B2
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A d;
+// CHECK: 3: [B4.2].~A() (Implicit destructor)
+// CHECK: 4: [B10.2].~A() (Implicit destructor)
+// CHECK: 5: [B2.4].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B3
+// CHECK: [ B5 ]
+// CHECK: 1: return;
+// CHECK: 2: [B10.2].~A() (Implicit destructor)
+// CHECK: 3: [B2.4].~A() (Implicit destructor)
+// CHECK: 4: [B11.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B0
+// CHECK: [ B6 ]
+// CHECK: 1: UV
+// CHECK: 2: [B6.1]
+// CHECK: T: if [B6.2]
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (2): B5 B4
+// CHECK: [ B7 ]
+// CHECK: 1: [B10.2].~A() (Implicit destructor)
+// CHECK: 2: [B2.4].~A() (Implicit destructor)
+// CHECK: T: continue;
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (1): B3
+// CHECK: [ B8 ]
+// CHECK: 1: UV
+// CHECK: 2: [B8.1]
+// CHECK: T: if [B8.2]
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (2): B7 B6
+// CHECK: [ B9 ]
+// CHECK: 1: [B10.2].~A() (Implicit destructor)
+// CHECK: T: break;
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (1): B1
+// CHECK: [ B10 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: UV
+// CHECK: 4: [B10.3]
+// CHECK: T: if [B10.4]
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (2): B9 B8
+// CHECK: [ B11 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: Predecessors (1): B12
+// CHECK: Successors (1): B2
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (2): B1 B5
+// CHECK: Successors (0):
+// CHECK: [ B4 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B2
+// CHECK: [ B1 ]
+// CHECK: 1: UV
+// CHECK: 2: [B1.1]
+// CHECK: T: do ... while [B1.2]
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (2): B3 B0
+// CHECK: [ B2 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3: [B2.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B3 B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (1): B2
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B12 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B11
+// CHECK: [ B1 ]
+// CHECK: 1:
+// CHECK: 2: A d;
+// CHECK: 3: [B1.2].~A() (Implicit destructor)
+// CHECK: 4: [B11.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B8 B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: UV
+// CHECK: 2: [B2.1]
+// CHECK: T: do ... while [B2.2]
+// CHECK: Predecessors (2): B3 B6
+// CHECK: Successors (2): B10 B1
+// CHECK: [ B3 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B3.2].~A() (Implicit destructor)
+// CHECK: 4: [B9.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B5
+// CHECK: Successors (1): B2
+// CHECK: [ B4 ]
+// CHECK: 1: return;
+// CHECK: 2: [B9.2].~A() (Implicit destructor)
+// CHECK: 3: [B11.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B5
+// CHECK: Successors (1): B0
+// CHECK: [ B5 ]
+// CHECK: 1: UV
+// CHECK: 2: [B5.1]
+// CHECK: T: if [B5.2]
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (2): B4 B3
+// CHECK: [ B6 ]
+// CHECK: 1: [B9.2].~A() (Implicit destructor)
+// CHECK: T: continue;
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B2
+// CHECK: [ B7 ]
+// CHECK: 1: UV
+// CHECK: 2: [B7.1]
+// CHECK: T: if [B7.2]
+// CHECK: Predecessors (1): B9
+// CHECK: Successors (2): B6 B5
+// CHECK: [ B8 ]
+// CHECK: 1: [B9.2].~A() (Implicit destructor)
+// CHECK: T: break;
+// CHECK: Predecessors (1): B9
+// CHECK: Successors (1): B1
+// CHECK: [ B9 ]
+// CHECK: 1:
+// CHECK: 2: A b;
+// CHECK: 3: UV
+// CHECK: 4: [B9.3]
+// CHECK: T: if [B9.4]
+// CHECK: Predecessors (2): B10 B11
+// CHECK: Successors (2): B8 B7
+// CHECK: [ B10 ]
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B9
+// CHECK: [ B11 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: Predecessors (1): B12
+// CHECK: Successors (1): B9
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (2): B1 B4
+// CHECK: Successors (0):
+// CHECK: [ B4 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B2
+// CHECK: [ B1 ]
+// CHECK: 1: [B2.6].~A() (Implicit destructor)
+// CHECK: 2: [B2.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B3 B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3: a
+// CHECK: 4: [B2.3]
+// CHECK: 5: [B2.4]
+// CHECK: 6: A b = a;
+// CHECK: 7: b
+// CHECK: 8: [B2.7]
+// CHECK: 9: [B2.8].operator int
+// CHECK: 10: [B2.9]()
+// CHECK: T: switch [B2.10]
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B3.2].~A() (Implicit destructor)
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B9 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B2
+// CHECK: [ B1 ]
+// CHECK: 1: [B2.6].~A() (Implicit destructor)
+// CHECK: 2:
+// CHECK: 3: A g;
+// CHECK: 4: [B1.3].~A() (Implicit destructor)
+// CHECK: 5: [B2.2].~A() (Implicit destructor)
+// CHECK: Predecessors (3): B3 B7 B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3: a
+// CHECK: 4: [B2.3]
+// CHECK: 5: [B2.4]
+// CHECK: 6: A b = a;
+// CHECK: 7: b
+// CHECK: 8: [B2.7]
+// CHECK: 9: [B2.8].operator int
+// CHECK: 10: [B2.9]()
+// CHECK: T: switch [B2.10]
+// CHECK: Predecessors (1): B9
+// CHECK: Successors (3): B3 B8
+// CHECK: B1
+// CHECK: [ B3 ]
+// CHECK: case 1:
+// CHECK: T: break;
+// CHECK: Predecessors (2): B2 B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A f;
+// CHECK: 3: [B4.2].~A() (Implicit destructor)
+// CHECK: 4: [B8.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B3
+// CHECK: [ B5 ]
+// CHECK: 1: return;
+// CHECK: 2: [B8.2].~A() (Implicit destructor)
+// CHECK: 3: [B2.6].~A() (Implicit destructor)
+// CHECK: 4: [B2.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B0
+// CHECK: [ B6 ]
+// CHECK: 1: UV
+// CHECK: 2: [B6.1]
+// CHECK: T: if [B6.2]
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (2): B5 B4
+// CHECK: [ B7 ]
+// CHECK: 1: [B8.2].~A() (Implicit destructor)
+// CHECK: T: break;
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (1): B1
+// CHECK: [ B8 ]
+// CHECK: case 0:
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: UV
+// CHECK: 4: [B8.3]
+// CHECK: T: if [B8.4]
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (2): B7 B6
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (2): B1 B5
+// CHECK: Successors (0):
+// CHECK: [ B6 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B5
+// CHECK: [ B1 ]
+// CHECK: 1: [B2.4].~A() (Implicit destructor)
+// CHECK: 2: [B5.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: a
+// CHECK: 2: [B2.1]
+// CHECK: 3: [B2.2]
+// CHECK: 4: A b = a;
+// CHECK: 5: b
+// CHECK: 6: [B2.5]
+// CHECK: 7: [B2.6].operator int
+// CHECK: 8: [B2.7]()
+// CHECK: 9: [B2.8]
+// CHECK: T: for (...; [B2.9]; )
+// CHECK: Predecessors (2): B3 B5
+// CHECK: Successors (2): B4 B1
+// CHECK: [ B3 ]
+// CHECK: 1: [B2.4].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B2
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A c;
+// CHECK: 3: [B4.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B3
+// CHECK: [ B5 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B2
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B12 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B11
+// CHECK: [ B1 ]
+// CHECK: 1: [B2.4].~A() (Implicit destructor)
+// CHECK: 2: [B11.4].~A() (Implicit destructor)
+// CHECK: 3:
+// CHECK: 4: A f;
+// CHECK: 5: [B1.4].~A() (Implicit destructor)
+// CHECK: 6: [B11.2].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B9 B2
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: b
+// CHECK: 2: [B2.1]
+// CHECK: 3: [B2.2]
+// CHECK: 4: A c = b;
+// CHECK: 5: c
+// CHECK: 6: [B2.5]
+// CHECK: 7: [B2.6].operator int
+// CHECK: 8: [B2.7]()
+// CHECK: 9: [B2.8]
+// CHECK: T: for (...; [B2.9]; )
+// CHECK: Predecessors (2): B3 B11
+// CHECK: Successors (2): B10 B1
+// CHECK: [ B3 ]
+// CHECK: 1: [B2.4].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B4 B7
+// CHECK: Successors (1): B2
+// CHECK: [ B4 ]
+// CHECK: 1:
+// CHECK: 2: A e;
+// CHECK: 3: [B4.2].~A() (Implicit destructor)
+// CHECK: 4: [B10.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B3
+// CHECK: [ B5 ]
+// CHECK: 1: return;
+// CHECK: 2: [B10.2].~A() (Implicit destructor)
+// CHECK: 3: [B2.4].~A() (Implicit destructor)
+// CHECK: 4: [B11.4].~A() (Implicit destructor)
+// CHECK: 5: [B11.2].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B6
+// CHECK: Successors (1): B0
+// CHECK: [ B6 ]
+// CHECK: 1: UV
+// CHECK: 2: [B6.1]
+// CHECK: T: if [B6.2]
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (2): B5 B4
+// CHECK: [ B7 ]
+// CHECK: 1: [B10.2].~A() (Implicit destructor)
+// CHECK: T: continue;
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (1): B3
+// CHECK: [ B8 ]
+// CHECK: 1: UV
+// CHECK: 2: [B8.1]
+// CHECK: T: if [B8.2]
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (2): B7 B6
+// CHECK: [ B9 ]
+// CHECK: 1: [B10.2].~A() (Implicit destructor)
+// CHECK: T: break;
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (1): B1
+// CHECK: [ B10 ]
+// CHECK: 1:
+// CHECK: 2: A d;
+// CHECK: 3: UV
+// CHECK: 4: [B10.3]
+// CHECK: T: if [B10.4]
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (2): B9 B8
+// CHECK: [ B11 ]
+// CHECK: 1:
+// CHECK: 2: A a;
+// CHECK: 3:
+// CHECK: 4: A b;
+// CHECK: Predecessors (1): B12
+// CHECK: Successors (1): B2
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (2): B1 B5
+// CHECK: Successors (0):
+// CHECK: [ B3 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B0
+// CHECK: [ B1 ]
+// CHECK: T: try ...
+// CHECK: Predecessors (0):
+// CHECK: Successors (2): B2 B0
+// CHECK: [ B2 ]
+// CHECK: catch (const A &e):
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (3): B2 B1 B3
+// CHECK: Successors (0):
+// CHECK: [ B3 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B0
+// CHECK: [ B1 ]
+// CHECK: T: try ...
+// CHECK: Predecessors (0):
+// CHECK: Successors (2): B2 B0
+// CHECK: [ B2 ]
+// CHECK: catch (A e):
+// CHECK: 1: .~A() (Implicit destructor)
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (3): B2 B1 B3
+// CHECK: Successors (0):
diff --git a/test/Analysis/bstring.c b/test/Analysis/bstring.c
index cd43e36d0351..e23059fcec48 100644
--- a/test/Analysis/bstring.c
+++ b/test/Analysis/bstring.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.experimental.CString -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.experimental.CString -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,unix.experimental.CString -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,unix.experimental.CString -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.unix.CString -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,experimental.unix.CString -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,experimental.unix.CString -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,experimental.unix.CString -analyzer-store=region -Wno-null-dereference -verify %s
//===----------------------------------------------------------------------===
// Declarations
diff --git a/test/Analysis/casts.c b/test/Analysis/casts.c
index 35d97fec675d..8b88a2db432e 100644
--- a/test/Analysis/casts.c
+++ b/test/Analysis/casts.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
// Test if the 'storage' region gets properly initialized after it is cast to
// 'struct sockaddr *'.
diff --git a/test/Analysis/casts.m b/test/Analysis/casts.m
index d073dff963fc..d9700fe5c754 100644
--- a/test/Analysis/casts.m
+++ b/test/Analysis/casts.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
// Test function pointer casts. Currently we track function addresses using
// loc::FunctionVal. Because casts can be arbitrary, do we need to model
@@ -20,3 +19,23 @@ void* test2(void *p) {
MyFuncTest1 fp = (MyFuncTest1) p;
return (*fp)();
}
+
+// <radar://10087620>
+// A cast from int onjective C property reference to int.
+typedef signed char BOOL;
+@protocol NSObject - (BOOL)isEqual:(id)object; @end
+@interface NSObject <NSObject> {} - (id)init; @end
+typedef enum {
+ EEOne,
+ EETwo
+} RDR10087620Enum;
+@interface RDR10087620 : NSObject {
+ RDR10087620Enum elem;
+}
+@property (readwrite, nonatomic) RDR10087620Enum elem;
+static void
+adium_media_ready_cb(RDR10087620 *InObj)
+{
+ InObj.elem |= EEOne;
+}
+@end \ No newline at end of file
diff --git a/test/Analysis/cfref_PR2519.c b/test/Analysis/cfref_PR2519.c
index 280676330a46..529210986916 100644
--- a/test/Analysis/cfref_PR2519.c
+++ b/test/Analysis/cfref_PR2519.c
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
typedef unsigned char Boolean;
typedef signed long CFIndex;
diff --git a/test/Analysis/cfref_rdar6080742.c b/test/Analysis/cfref_rdar6080742.c
index aceefbe54872..ea4c3ee6d549 100644
--- a/test/Analysis/cfref_rdar6080742.c
+++ b/test/Analysis/cfref_rdar6080742.c
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
// This test case was reported in <rdar:problem/6080742>.
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
diff --git a/test/Analysis/chroot.c b/test/Analysis/chroot.c
index 7a584da6c05c..1948f48471f1 100644
--- a/test/Analysis/chroot.c
+++ b/test/Analysis/chroot.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=unix.experimental.Chroot -analyzer-store region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.unix.Chroot -analyzer-store region -verify %s
extern int chroot(const char* path);
extern int chdir(const char* path);
diff --git a/test/Analysis/complex.c b/test/Analysis/complex.c
index b125a502f1df..c118a61455af 100644
--- a/test/Analysis/complex.c
+++ b/test/Analysis/complex.c
@@ -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
diff --git a/test/Analysis/concrete-address.c b/test/Analysis/concrete-address.c
index a722ab092e2c..f6c445ebf56e 100644
--- a/test/Analysis/concrete-address.c
+++ b/test/Analysis/concrete-address.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
void foo() {
int *p = (int*) 0x10000; // Should not crash here.
diff --git a/test/Analysis/constant-folding.c b/test/Analysis/constant-folding.c
index d3cbf9c56479..e7a5705fa59a 100644
--- a/test/Analysis/constant-folding.c
+++ b/test/Analysis/constant-folding.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.deadcode.UnreachableCode -Wno-null-dereference -verify %s
// Trigger a warning if the analyzer reaches this point in the control flow.
#define WARN ((void)*(char*)0)
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c
index 85ea1ee2cb64..5ddb4528c1b2 100644
--- a/test/Analysis/dead-stores.c
+++ b/test/Analysis/dead-stores.c
@@ -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
diff --git a/test/Analysis/dead-stores.cpp b/test/Analysis/dead-stores.cpp
index 932e94092847..43d8796ce091 100644
--- a/test/Analysis/dead-stores.cpp
+++ b/test/Analysis/dead-stores.cpp
@@ -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
diff --git a/test/Analysis/dead-stores.m b/test/Analysis/dead-stores.m
index 3a06a8adeb0d..4ed71c4e8bfa 100644
--- a/test/Analysis/dead-stores.m
+++ b/test/Analysis/dead-stores.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=deadcode.DeadStores -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -verify %s
typedef signed char BOOL;
typedef unsigned int NSUInteger;
diff --git a/test/Analysis/default-diagnostic-visitors.c b/test/Analysis/default-diagnostic-visitors.c
new file mode 100644
index 000000000000..9cb9ba8c33e3
--- /dev/null
+++ b/test/Analysis/default-diagnostic-visitors.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -verify %s
+
+// This file is for testing enhanced diagnostics produced by the default BugReporterVisitors.
+
+int getPasswordAndItem()
+{
+ int err = 0;
+ int *password; // expected-note {{Variable 'password' declared without an initial value}}
+ if (password == 0) { // expected-warning {{The left operand of '==' is a garbage value}} // expected-note {{The left operand of '==' is a garbage value}}
+ err = *password;
+ }
+ return err;
+}
diff --git a/test/Analysis/delegates.m b/test/Analysis/delegates.m
index 218083598919..8f42b83b0eeb 100644
--- a/test/Analysis/delegates.m
+++ b/test/Analysis/delegates.m
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=basic -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
diff --git a/test/Analysis/div-zero.cpp b/test/Analysis/div-zero.cpp
new file mode 100644
index 000000000000..d1261dc57335
--- /dev/null
+++ b/test/Analysis/div-zero.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core.DivideZero -verify %s
+
+int fooPR10616 (int qX ) {
+ int a, c, d;
+
+ d = (qX-1);
+ while ( d != 0 ) {
+ d = c - (c/d) * d;
+ }
+
+ return (a % (qX-1)); // expected-warning {{Division by zero}}
+
+}
diff --git a/test/Analysis/elementtype.c b/test/Analysis/elementtype.c
index d41202a1f07f..7452a0a124fe 100644
--- a/test/Analysis/elementtype.c
+++ b/test/Analysis/elementtype.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region %s
typedef struct added_obj_st {
int type;
diff --git a/test/Analysis/exercise-ps.c b/test/Analysis/exercise-ps.c
index 02772a148b6b..5dd1f3f12bd2 100644
--- a/test/Analysis/exercise-ps.c
+++ b/test/Analysis/exercise-ps.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
//
// Just exercise the analyzer on code that has at one point caused issues
// (i.e., no assertions or crashes).
diff --git a/test/Analysis/fields.c b/test/Analysis/fields.c
index 0991d00868cf..2e72c77d9fac 100644
--- a/test/Analysis/fields.c
+++ b/test/Analysis/fields.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core %s -analyzer-store=region -verify
unsigned foo();
typedef struct bf { unsigned x:2; } bf;
diff --git a/test/Analysis/flat-store.c b/test/Analysis/flat-store.c
deleted file mode 100644
index bf93c724400f..000000000000
--- a/test/Analysis/flat-store.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=flat -Wno-null-dereference -verify %s
-#define FAIL ((void)*(char*)0)
-struct simple { int x; };
-
-void PR7297 () {
- struct simple a;
- struct simple *p = &a;
- p->x = 5;
- if (!p[0].x) FAIL; // no-warning
- if (p[0].x) FAIL; // expected-warning {{null}}
-}
diff --git a/test/Analysis/free.c b/test/Analysis/free.c
index d57da69ba456..44c4f19f1b3c 100644
--- a/test/Analysis/free.c
+++ b/test/Analysis/free.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,unix.experimental.Malloc -fblocks -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,experimental.unix.Malloc -fblocks -verify %s
void free(void *);
void t1 () {
diff --git a/test/Analysis/func.c b/test/Analysis/func.c
index 0694f7bd4c26..b6cebde81091 100644
--- a/test/Analysis/func.c
+++ b/test/Analysis/func.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
void f(void) {
void (*p)(void);
diff --git a/test/Analysis/idempotent-operations.m b/test/Analysis/idempotent-operations.m
index 8f534940c975..b4765082d84a 100644
--- a/test/Analysis/idempotent-operations.m
+++ b/test/Analysis/idempotent-operations.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=deadcode.IdempotentOperations -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=deadcode.IdempotentOperations,osx.cocoa.RetainCount -verify %s
typedef signed char BOOL;
typedef unsigned long NSUInteger;
diff --git a/test/Analysis/initializers-cfg-output.cpp b/test/Analysis/initializers-cfg-output.cpp
index 5c5d51494749..b73809f2b83a 100644
--- a/test/Analysis/initializers-cfg-output.cpp
+++ b/test/Analysis/initializers-cfg-output.cpp
@@ -44,51 +44,60 @@ TestControlFlow::TestControlFlow(bool b)
int v;
}
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1:
-// CHECK: 2: A([B1.1]) (Base initializer)
-// CHECK: 3:
-// CHECK: 4: C([B1.3]) (Base initializer)
-// CHECK: 5:
-// CHECK: 6: B([B1.5]) (Base initializer)
-// CHECK: 7:
-// CHECK: 8: A([B1.7]) (Base initializer)
-// CHECK: 9: i(/*implicit*/int()) (Member initializer)
-// CHECK: 10: r(this->i) (Member initializer)
-// CHECK: 11:
-// CHECK: 12: A a;
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B5 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B4
-// CHECK: [ B1 ]
-// CHECK: 1: [B4.2] ? [B2.1] : [B3.1]
-// CHECK: 2: y([B1.1]) (Member initializer)
-// CHECK: 3: z(this->y) (Member initializer)
-// CHECK: 4: int v;
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: 0
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: 1
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1: x(0) (Member initializer)
-// CHECK: 2: b
-// CHECK: T: [B4.2] ? ... : ...
-// CHECK: Predecessors (1): B5
-// CHECK: Successors (2): B2 B3
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1:
+// CHECK: 2: A([B1.1]) (Base initializer)
+// CHECK: 3:
+// CHECK: 4: C([B1.3]) (Base initializer)
+// CHECK: 5:
+// CHECK: 6: B([B1.5]) (Base initializer)
+// CHECK: 7:
+// CHECK: 8: A([B1.7]) (Base initializer)
+// CHECK: 9: /*implicit*/int()
+// CHECK: 10: i([B1.9]) (Member initializer)
+// CHECK: 11: this
+// CHECK: 12: [B1.11]->i
+// CHECK: 13: r([B1.12]) (Member initializer)
+// CHECK: 14:
+// CHECK: 15: A a;
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B5 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B4
+// CHECK: [ B1 ]
+// CHECK: 1: [B4.4] ? [B2.1] : [B3.1]
+// CHECK: 2: y([B1.1]) (Member initializer)
+// CHECK: 3: this
+// CHECK: 4: [B1.3]->y
+// CHECK: 5: [B1.4]
+// CHECK: 6: z([B1.5]) (Member initializer)
+// CHECK: 7: int v;
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: 0
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: 1
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1: 0
+// CHECK: 2: x([B4.1]) (Member initializer)
+// CHECK: 3: b
+// CHECK: 4: [B4.3]
+// CHECK: T: [B4.4] ? ... : ...
+// CHECK: Predecessors (1): B5
+// CHECK: Successors (2): B2 B3
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+
diff --git a/test/Analysis/iterators.cpp b/test/Analysis/iterators.cpp
index c3416f5beac1..741970aa6c47 100644
--- a/test/Analysis/iterators.cpp
+++ b/test/Analysis/iterators.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.experimental.Iterators -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.cplusplus.Iterators -verify %s
// XFAIL: win32
#include <vector>
diff --git a/test/Analysis/keychainAPI-diagnostic-visitor.m b/test/Analysis/keychainAPI-diagnostic-visitor.m
new file mode 100644
index 000000000000..a78b114a00fb
--- /dev/null
+++ b/test/Analysis/keychainAPI-diagnostic-visitor.m
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=osx.SecKeychainAPI -analyzer-store=region -analyzer-output=text -verify %s
+
+// This file is for testing enhanced diagnostics produced by the default SecKeychainAPI checker.
+
+typedef unsigned int OSStatus;
+typedef unsigned int SecKeychainAttributeList;
+typedef unsigned int SecKeychainItemRef;
+typedef unsigned int SecItemClass;
+typedef unsigned int UInt32;
+enum {
+ noErr = 0,
+ GenericError = 1
+};
+OSStatus SecKeychainItemCopyContent (
+ SecKeychainItemRef itemRef,
+ SecItemClass *itemClass,
+ SecKeychainAttributeList *attrList,
+ UInt32 *length,
+ void **outData
+ );
+
+void DellocWithCFStringCreate4() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ char *bytes;
+ char *x;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, (void **)&bytes); // expected-note {{Data is allocated here}}
+ x = bytes;
+ if (st == noErr) // expected-note {{Assuming 'st' is equal to noErr}} // expected-note{{Taking true branch}}
+ x = bytes;;
+
+ length++; // expected-warning {{Allocated data is not released}} // expected-note{{Allocated data is not released}}
+}
+
diff --git a/test/Analysis/keychainAPI.m b/test/Analysis/keychainAPI.m
new file mode 100644
index 000000000000..d10600dea590
--- /dev/null
+++ b/test/Analysis/keychainAPI.m
@@ -0,0 +1,323 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=osx.SecKeychainAPI %s -verify
+
+// Fake typedefs.
+typedef unsigned int OSStatus;
+typedef unsigned int SecKeychainAttributeList;
+typedef unsigned int SecKeychainItemRef;
+typedef unsigned int SecItemClass;
+typedef unsigned int UInt32;
+typedef unsigned int CFTypeRef;
+typedef unsigned int UInt16;
+typedef unsigned int SecProtocolType;
+typedef unsigned int SecAuthenticationType;
+typedef unsigned int SecKeychainAttributeInfo;
+enum {
+ noErr = 0,
+ GenericError = 1
+};
+
+// Functions that allocate data.
+OSStatus SecKeychainItemCopyContent (
+ SecKeychainItemRef itemRef,
+ SecItemClass *itemClass,
+ SecKeychainAttributeList *attrList,
+ UInt32 *length,
+ void **outData
+);
+OSStatus SecKeychainFindGenericPassword (
+ CFTypeRef keychainOrArray,
+ UInt32 serviceNameLength,
+ const char *serviceName,
+ UInt32 accountNameLength,
+ const char *accountName,
+ UInt32 *passwordLength,
+ void **passwordData,
+ SecKeychainItemRef *itemRef
+);
+OSStatus SecKeychainFindInternetPassword (
+ CFTypeRef keychainOrArray,
+ UInt32 serverNameLength,
+ const char *serverName,
+ UInt32 securityDomainLength,
+ const char *securityDomain,
+ UInt32 accountNameLength,
+ const char *accountName,
+ UInt32 pathLength,
+ const char *path,
+ UInt16 port,
+ SecProtocolType protocol,
+ SecAuthenticationType authenticationType,
+ UInt32 *passwordLength,
+ void **passwordData,
+ SecKeychainItemRef *itemRef
+);
+OSStatus SecKeychainItemCopyAttributesAndData (
+ SecKeychainItemRef itemRef,
+ SecKeychainAttributeInfo *info,
+ SecItemClass *itemClass,
+ SecKeychainAttributeList **attrList,
+ UInt32 *length,
+ void **outData
+);
+
+// Functions which free data.
+OSStatus SecKeychainItemFreeContent (
+ SecKeychainAttributeList *attrList,
+ void *data
+);
+OSStatus SecKeychainItemFreeAttributesAndData (
+ SecKeychainAttributeList *attrList,
+ void *data
+);
+
+void errRetVal() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData);
+ if (st == GenericError) // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeContent'.}}
+ SecKeychainItemFreeContent(ptr, outData); // expected-warning{{Call to free data when error was returned during allocation.}}
+}
+
+// If null is passed in, the data is not allocated, so no need for the matching free.
+void fooDoNotReportNull() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 *length = 0;
+ void **outData = 0;
+ SecKeychainItemCopyContent(2, ptr, ptr, 0, 0);
+ SecKeychainItemCopyContent(2, ptr, ptr, length, outData);
+}// no-warning
+
+void doubleAlloc() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData);
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData); // expected-warning {{Allocated data should be released before another call to the allocator:}}
+ if (st == noErr)
+ SecKeychainItemFreeContent(ptr, outData);
+}
+
+void fooOnlyFree() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData = &length;
+ SecKeychainItemFreeContent(ptr, outData);// expected-warning{{Trying to free data which has not been allocated}}
+}
+
+// Do not warn if undefined value is passed to a function.
+void fooOnlyFreeUndef() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData;
+ SecKeychainItemFreeContent(ptr, outData);
+}// no-warning
+
+// Do not warn if the address is a parameter in the enclosing function.
+void fooOnlyFreeParam(void *attrList, void* X) {
+ SecKeychainItemFreeContent(attrList, X);
+}// no-warning
+
+// If we are returning the value, do not report.
+void* returnContent() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData);
+ return outData;
+} // no-warning
+
+// Password was passed in as an argument and does nt have to be deleted.
+OSStatus getPasswordAndItem(void** password, UInt32* passwordLength) {
+ OSStatus err;
+ SecKeychainItemRef item;
+ err = SecKeychainFindGenericPassword(0, 3, "xx", 3, "xx",
+ passwordLength, password, &item);
+ return err;
+} // no-warning
+
+// Make sure we do not report an error if we call free only if password != 0.
+// Also, do not report double allocation if first allocation returned an error.
+OSStatus testSecKeychainFindGenericPassword(UInt32* passwordLength,
+ CFTypeRef keychainOrArray, SecProtocolType protocol,
+ SecAuthenticationType authenticationType) {
+ OSStatus err;
+ SecKeychainItemRef item;
+ void *password;
+ err = SecKeychainFindGenericPassword(0, 3, "xx", 3, "xx",
+ passwordLength, &password, &item);
+ if( err == GenericError ) {
+ err = SecKeychainFindInternetPassword(keychainOrArray,
+ 16, "server", 16, "domain", 16, "account",
+ 16, "path", 222, protocol, authenticationType,
+ passwordLength, &(password), 0);
+ }
+
+ if (err == noErr && password) {
+ SecKeychainItemFreeContent(0, password);
+ }
+ return err;
+}
+
+int apiMismatch(SecKeychainItemRef itemRef,
+ SecKeychainAttributeInfo *info,
+ SecItemClass *itemClass) {
+ OSStatus st = 0;
+ SecKeychainAttributeList *attrList;
+ UInt32 length;
+ void *outData;
+
+ st = SecKeychainItemCopyAttributesAndData(itemRef, info, itemClass,
+ &attrList, &length, &outData);
+ if (st == noErr)
+ SecKeychainItemFreeContent(attrList, outData); // expected-warning{{Deallocator doesn't match the allocator}}
+ return 0;
+}
+
+int ErrorCodesFromDifferentAPISDoNotInterfere(SecKeychainItemRef itemRef,
+ SecKeychainAttributeInfo *info,
+ SecItemClass *itemClass) {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData;
+ OSStatus st2 = 0;
+ SecKeychainAttributeList *attrList;
+ UInt32 length2;
+ void *outData2;
+
+ st2 = SecKeychainItemCopyAttributesAndData(itemRef, info, itemClass,
+ &attrList, &length2, &outData2);
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData);
+ if (st == noErr) {
+ SecKeychainItemFreeContent(ptr, outData);
+ if (st2 == noErr) {
+ SecKeychainItemFreeAttributesAndData(attrList, outData2);
+ }
+ }
+ return 0; // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeAttributesAndData'}}
+}
+
+int foo(CFTypeRef keychainOrArray, SecProtocolType protocol,
+ SecAuthenticationType authenticationType, SecKeychainItemRef *itemRef) {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+
+ UInt32 length;
+ void *outData[5];
+
+ st = SecKeychainFindInternetPassword(keychainOrArray,
+ 16, "server", 16, "domain", 16, "account",
+ 16, "path", 222, protocol, authenticationType,
+ &length, &(outData[3]), itemRef);
+ if (length == 5) {
+ if (st == noErr)
+ SecKeychainItemFreeContent(ptr, outData[3]);
+ }
+ if (length) { // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeContent'.}}
+ length++;
+ }
+ return 0;
+}// no-warning
+
+void free(void *ptr);
+void deallocateWithFree() {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *outData;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData);
+ if (st == noErr)
+ free(outData); // expected-warning{{Deallocator doesn't match the allocator: 'SecKeychainItemFreeContent' should be used}}
+}
+
+// Typesdefs for CFStringCreateWithBytesNoCopy.
+typedef char uint8_t;
+typedef signed long CFIndex;
+typedef UInt32 CFStringEncoding;
+typedef unsigned Boolean;
+typedef const struct __CFString * CFStringRef;
+typedef const struct __CFAllocator * CFAllocatorRef;
+extern const CFAllocatorRef kCFAllocatorDefault;
+extern const CFAllocatorRef kCFAllocatorSystemDefault;
+extern const CFAllocatorRef kCFAllocatorMalloc;
+extern const CFAllocatorRef kCFAllocatorMallocZone;
+extern const CFAllocatorRef kCFAllocatorNull;
+extern const CFAllocatorRef kCFAllocatorUseContext;
+CFStringRef CFStringCreateWithBytesNoCopy(CFAllocatorRef alloc, const uint8_t *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean externalFormat, CFAllocatorRef contentsDeallocator);
+extern void CFRelease(CFStringRef cf);
+
+void DellocWithCFStringCreate1(CFAllocatorRef alloc) {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *bytes;
+ char * x;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &bytes);
+ if (st == noErr) {
+ CFStringRef userStr = CFStringCreateWithBytesNoCopy(alloc, bytes, length, 5, 0, kCFAllocatorDefault); // expected-warning{{Deallocator doesn't match the allocator:}}
+ CFRelease(userStr);
+ }
+}
+
+void DellocWithCFStringCreate2(CFAllocatorRef alloc) {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *bytes;
+ char * x;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &bytes);
+ if (st == noErr) {
+ CFStringRef userStr = CFStringCreateWithBytesNoCopy(alloc, bytes, length, 5, 0, kCFAllocatorNull); // expected-warning{{Allocated data is not released}}
+ CFRelease(userStr);
+ }
+}
+
+void DellocWithCFStringCreate3(CFAllocatorRef alloc) {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *bytes;
+ char * x;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &bytes);
+ if (st == noErr) {
+ CFStringRef userStr = CFStringCreateWithBytesNoCopy(alloc, bytes, length, 5, 0, kCFAllocatorUseContext);
+ CFRelease(userStr);
+ }
+}
+
+void DellocWithCFStringCreate4(CFAllocatorRef alloc) {
+ unsigned int *ptr = 0;
+ OSStatus st = 0;
+ UInt32 length;
+ void *bytes;
+ char * x;
+ st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &bytes);
+ if (st == noErr) {
+ CFStringRef userStr = CFStringCreateWithBytesNoCopy(alloc, bytes, length, 5, 0, 0); // expected-warning{{Deallocator doesn't match the allocator:}}
+ CFRelease(userStr);
+ }
+}
+
+//Example from bug 10797.
+__inline__ static
+const char *__WBASLLevelString(int level) {
+ return "foo";
+}
+
+static int *bug10798(int *p, int columns, int prevRow) {
+ int *row = 0;
+ row = p + prevRow * columns;
+ prevRow += 2;
+ do {
+ ++prevRow;
+ row+=columns;
+ } while(10 >= row[1]);
+ return row;
+}
diff --git a/test/Analysis/malloc-overflow.c b/test/Analysis/malloc-overflow.c
new file mode 100644
index 000000000000..714fd3d308ad
--- /dev/null
+++ b/test/Analysis/malloc-overflow.c
@@ -0,0 +1,113 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.MallocOverflow -verify %s
+
+#define NULL ((void *) 0)
+typedef __typeof__(sizeof(int)) size_t;
+extern void * malloc(size_t);
+
+void * f1(int n)
+{
+ return malloc(n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
+
+void * f2(int n)
+{
+ return malloc(sizeof(int) * n); // // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
+
+void * f3()
+{
+ return malloc(4 * sizeof(int)); // no-warning
+}
+
+struct s4
+{
+ int n;
+};
+
+void * f4(struct s4 *s)
+{
+ return malloc(s->n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
+
+void * f5(struct s4 *s)
+{
+ struct s4 s2 = *s;
+ return malloc(s2.n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
+
+void * f6(int n)
+{
+ return malloc((n + 1) * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
+
+extern void * malloc (size_t);
+
+void * f7(int n)
+{
+ if (n > 10)
+ return NULL;
+ return malloc(n * sizeof(int)); // no-warning
+}
+
+void * f8(int n)
+{
+ if (n < 10)
+ return malloc(n * sizeof(int)); // no-warning
+ else
+ return NULL;
+}
+
+void * f9(int n)
+{
+ int * x = malloc(n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+ for (int i = 0; i < n; i++)
+ x[i] = i;
+ return x;
+}
+
+void * f10(int n)
+{
+ int * x = malloc(n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+ int i = 0;
+ while (i < n)
+ x[i++] = 0;
+ return x;
+}
+
+void * f11(int n)
+{
+ int * x = malloc(n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+ int i = 0;
+ do {
+ x[i++] = 0;
+ } while (i < n);
+ return x;
+}
+
+void * f12(int n)
+{
+ n = (n > 10 ? 10 : n);
+ int * x = malloc(n * sizeof(int)); // no-warning
+ for (int i = 0; i < n; i++)
+ x[i] = i;
+ return x;
+}
+
+struct s13
+{
+ int n;
+};
+
+void * f13(struct s13 *s)
+{
+ if (s->n > 10)
+ return NULL;
+ return malloc(s->n * sizeof(int)); // no warning
+}
+
+void * f14(int n)
+{
+ if (n < 0)
+ return NULL;
+ return malloc(n * sizeof(int)); // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
diff --git a/test/Analysis/malloc-overflow.cpp b/test/Analysis/malloc-overflow.cpp
new file mode 100644
index 000000000000..c1ac6be4b029
--- /dev/null
+++ b/test/Analysis/malloc-overflow.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.MallocOverflow -verify %s
+
+class A {
+public:
+ A& operator<<(const A &a);
+};
+
+void f() {
+ A a = A(), b = A();
+ a << b;
+}
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c
index f9af199b5fad..d9087ab83093 100644
--- a/test/Analysis/malloc.c
+++ b/test/Analysis/malloc.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode,core.experimental.CastSize,unix.experimental.Malloc -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.deadcode.UnreachableCode,experimental.core.CastSize,experimental.unix.Malloc -analyzer-store=region -verify %s
typedef __typeof(sizeof(int)) size_t;
void *malloc(size_t);
void free(void *);
@@ -41,7 +41,7 @@ void f2_realloc_0() {
void f2_realloc_1() {
int *p = malloc(12);
- int *q = realloc(p,0); // expected-warning{{Assigned value is garbage or undefined}}
+ int *q = realloc(p,0); // no-warning
}
// ownership attributes tests
diff --git a/test/Analysis/misc-ps-64.m b/test/Analysis/misc-ps-64.m
index 1cd738292781..e20a27f611e7 100644
--- a/test/Analysis/misc-ps-64.m
+++ b/test/Analysis/misc-ps-64.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify -fblocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s
// <rdar://problem/6440393> - A bunch of misc. failures involving evaluating
// these expressions and building CFGs. These tests are here to prevent
diff --git a/test/Analysis/misc-ps-basic-store.m b/test/Analysis/misc-ps-basic-store.m
deleted file mode 100644
index a29326d8b0e7..000000000000
--- a/test/Analysis/misc-ps-basic-store.m
+++ /dev/null
@@ -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}}
- }
-}
-
diff --git a/test/Analysis/misc-ps-cxx0x.cpp b/test/Analysis/misc-ps-cxx0x.cpp
index f21e82c4bcb4..53b6fa29ad6e 100644
--- a/test/Analysis/misc-ps-cxx0x.cpp
+++ b/test/Analysis/misc-ps-cxx0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang --analyze -std=c++0x %s -Xclang -verify
+// RUN: %clang --analyze -std=c++11 %s -Xclang -verify -o /dev/null
void test_static_assert() {
static_assert(sizeof(void *) == sizeof(void*), "test_static_assert");
@@ -9,3 +9,62 @@ void test_analyzer_working() {
*p = 0xDEADBEEF; // expected-warning {{null}}
}
+// Test that pointer-to-member functions don't cause the analyzer
+// to crash.
+struct RDar10243398 {
+ void bar(int x);
+};
+
+typedef void (RDar10243398::*RDar10243398MemberFn)(int x);
+
+void test_rdar10243398(RDar10243398 *p) {
+ RDar10243398MemberFn q = &RDar10243398::bar;
+ ((*p).*(q))(1);
+}
+
+// Tests for CXXTemporaryObjectExpr.
+struct X {
+ X( int *ip, int );
+};
+
+// Test to see if CXXTemporaryObjectExpr is being handled.
+int tempobj1()
+{
+ int j;
+ int i;
+ X a = X( &j, 1 );
+
+ return i; // expected-warning {{Undefined or garbage value returned to caller}}
+}
+
+// Test to see if CXXTemporaryObjectExpr invalidates arguments.
+int tempobj2()
+{
+ int j;
+ X a = X( &j, 1 );
+
+ return j; // no-warning
+}
+
+
+// Test for correct handling of C++ ForRange statement.
+void test1() {
+ int array[2] = { 1, 2 };
+ int j = 0;
+ for ( int i : array )
+ j += i;
+ int *p = 0;
+ *p = 0xDEADBEEF; // expected-warning {{null}}
+}
+
+void test2() {
+ int array[2] = { 1, 2 };
+ int j = 0;
+ for (int i : array)
+ j += i;
+ if (j == 3)
+ return;
+ int *p = 0;
+ *p = 0xDEADBEEF; // no-warning
+}
+
diff --git a/test/Analysis/misc-ps-eager-assume.m b/test/Analysis/misc-ps-eager-assume.m
index 4380a187b800..0aff8e49b274 100644
--- a/test/Analysis/misc-ps-eager-assume.m
+++ b/test/Analysis/misc-ps-eager-assume.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s -analyzer-eagerly-assume
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s -analyzer-eagerly-assume
// Delta-reduced header stuff (needed for test cases).
typedef signed char BOOL;
diff --git a/test/Analysis/misc-ps-flat-store.c b/test/Analysis/misc-ps-flat-store.c
deleted file mode 100644
index e6369cbfb079..000000000000
--- a/test/Analysis/misc-ps-flat-store.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=flat -verify %s
-
-void f1() {
- int x;
- int *p;
- x = 1;
- p = 0;
- if (x != 1)
- *p = 1; // no-warning
-}
diff --git a/test/Analysis/misc-ps-ranges.m b/test/Analysis/misc-ps-ranges.m
index f2851f3257dd..00337f448147 100644
--- a/test/Analysis/misc-ps-ranges.m
+++ b/test/Analysis/misc-ps-ranges.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s
// <rdar://problem/6776949>
// main's 'argc' argument is always > 0
diff --git a/test/Analysis/misc-ps-region-store-i386.m b/test/Analysis/misc-ps-region-store-i386.m
index 2988dca4abd9..3106a24c5c7f 100644
--- a/test/Analysis/misc-ps-region-store-i386.m
+++ b/test/Analysis/misc-ps-region-store-i386.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify -fblocks %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify -fblocks %s
// 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
diff --git a/test/Analysis/misc-ps-region-store-x86_64.m b/test/Analysis/misc-ps-region-store-x86_64.m
index 9f1498ef47f4..2c604cfdcdf7 100644
--- a/test/Analysis/misc-ps-region-store-x86_64.m
+++ b/test/Analysis/misc-ps-region-store-x86_64.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify -fblocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify -fblocks %s
// 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
diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp
index 795935959628..37153f765062 100644
--- a/test/Analysis/misc-ps-region-store.cpp
+++ b/test/Analysis/misc-ps-region-store.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
// Test basic handling of references.
char &test1_aux();
@@ -414,3 +414,56 @@ void TestAssignIntoSymbolicOffset::test(int x, int y) {
}
}
+// Test loads from static fields. This previously triggered an uninitialized
+// value warning.
+class ClassWithStatic {
+public:
+ static const unsigned value = 1;
+};
+
+int rdar9948787_negative() {
+ ClassWithStatic classWithStatic;
+ unsigned value = classWithStatic.value;
+ if (value == 1)
+ return 1;
+ int *p = 0;
+ *p = 0xDEADBEEF; // no-warning
+ return 0;
+}
+
+int rdar9948787_positive() {
+ ClassWithStatic classWithStatic;
+ unsigned value = classWithStatic.value;
+ if (value == 0)
+ return 1;
+ int *p = 0;
+ *p = 0xDEADBEEF; // expected-warning {{null}}
+ return 0;
+}
+
+// Regression test against global constants and switches.
+enum rdar10202899_ValT { rdar10202899_ValTA, rdar10202899_ValTB, rdar10202899_ValTC };
+const rdar10202899_ValT val = rdar10202899_ValTA;
+void rdar10202899_test1() {
+ switch (val) {
+ case rdar10202899_ValTA: {}
+ };
+}
+
+void rdar10202899_test2() {
+ if (val == rdar10202899_ValTA)
+ return;
+ int *p = 0;
+ *p = 0xDEADBEEF;
+}
+
+void rdar10202899_test3() {
+ switch (val) {
+ case rdar10202899_ValTA: return;
+ default: ;
+ };
+ int *p = 0;
+ *p = 0xDEADBEEF;
+}
+
+
diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m
index 27f12c9a893a..0fdab83d7f8a 100644
--- a/test/Analysis/misc-ps-region-store.m
+++ b/test/Analysis/misc-ps-region-store.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental.CastToStruct,security.experimental.ReturnPtrRange,security.experimental.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental.CastToStruct,security.experimental.ReturnPtrRange,security.experimental.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core.CastToStruct,experimental.security.ReturnPtrRange,experimental.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core.CastToStruct,experimental.security.ReturnPtrRange,experimental.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
typedef long unsigned int size_t;
void *memcpy(void *, const void *, size_t);
diff --git a/test/Analysis/misc-ps-region-store.mm b/test/Analysis/misc-ps-region-store.mm
index 08f3e2486f8a..fee9433dac3b 100644
--- a/test/Analysis/misc-ps-region-store.mm
+++ b/test/Analysis/misc-ps-region-store.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
//===------------------------------------------------------------------------------------------===//
// This files tests our path-sensitive handling of Objective-c++ files.
diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m
index da84b2487a8e..007c558299f5 100644
--- a/test/Analysis/misc-ps.m
+++ b/test/Analysis/misc-ps.m
@@ -1,12 +1,8 @@
// 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
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core,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,experimental.core,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,experimental.core,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,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
#ifndef __clang_analyzer__
#error __clang__analyzer__ not defined
@@ -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) {
diff --git a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m
index 80eeaf69ddbc..e2ad1176e33f 100644
--- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m
+++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,core.experimental -analyzer-constraints=range -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=range -analyzer-store=region -verify %s
// <rdar://problem/6888289> - This test case shows that a nil instance
// variable can possibly be initialized by a method.
diff --git a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
index 3fcbc55044ea..eb15435600b9 100644
--- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
+++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
@@ -1,9 +1,6 @@
-// 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
+// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,experimental.core -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,experimental.core -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,experimental.core -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin9 %s
@interface MyClass {}
- (void *)voidPtrM;
diff --git a/test/Analysis/no-exit-cfg.c b/test/Analysis/no-exit-cfg.c
index cfcd76d6e0cf..1a80a254cba9 100644
--- a/test/Analysis/no-exit-cfg.c
+++ b/test/Analysis/no-exit-cfg.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
// This is a test case for the issue reported in PR 2819:
// http://llvm.org/bugs/show_bug.cgi?id=2819
diff --git a/test/Analysis/no-outofbounds.c b/test/Analysis/no-outofbounds.c
index 2d77cc92adf9..821f48610fc0 100644
--- a/test/Analysis/no-outofbounds.c
+++ b/test/Analysis/no-outofbounds.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core,experimental.unix,experimental.security.ArrayBound -analyzer-store=region -verify %s
//===----------------------------------------------------------------------===//
// This file tests cases where we should not flag out-of-bounds warnings.
diff --git a/test/Analysis/null-deref-ps-region.c b/test/Analysis/null-deref-ps-region.c
index 85784558161e..08bfac748c2b 100644
--- a/test/Analysis/null-deref-ps-region.c
+++ b/test/Analysis/null-deref-ps-region.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -std=gnu99 -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -std=gnu99 -analyzer-store=region -verify %s
// The store for 'a[1]' should not be removed mistakenly. SymbolicRegions may
diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c
index 4d0cc3fbddad..641dde207558 100644
--- a/test/Analysis/null-deref-ps.c
+++ b/test/Analysis/null-deref-ps.c
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wreturn-type
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wreturn-type
typedef unsigned uintptr_t;
diff --git a/test/Analysis/nullptr.cpp b/test/Analysis/nullptr.cpp
index 6f78baebfe22..fc7e7ef482b8 100644
--- a/test/Analysis/nullptr.cpp
+++ b/test/Analysis/nullptr.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++0x -analyze -analyzer-checker=core -analyzer-store region -verify %s
+// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core -analyzer-store region -verify %s
// test to see if nullptr is detected as a null pointer
void foo1(void) {
diff --git a/test/Analysis/objc-arc.m b/test/Analysis/objc-arc.m
index 6b22fd099b06..b02af0515186 100644
--- a/test/Analysis/objc-arc.m
+++ b/test/Analysis/objc-arc.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-checker=deadcode -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-nonfragile-abi -fobjc-arc %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc %s
typedef signed char BOOL;
typedef struct _NSZone NSZone;
@@ -147,3 +147,9 @@ void test_objc_unretainedObject() {
(void) x;
}
+// Previously this resulted in a "return of stack address" warning.
+id test_return() {
+ id x = (__bridge_transfer id) CFCreateString();
+ return x; // no-warning
+}
+
diff --git a/test/Analysis/operator-calls.cpp b/test/Analysis/operator-calls.cpp
index 766d16140ed0..73cd28ac0d56 100644
--- a/test/Analysis/operator-calls.cpp
+++ b/test/Analysis/operator-calls.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -verify %s
struct X0 { };
bool operator==(const X0&, const X0&);
diff --git a/test/Analysis/out-of-bounds.c b/test/Analysis/out-of-bounds.c
index 8c65b478f1c2..ac2cdc82598d 100644
--- a/test/Analysis/out-of-bounds.c
+++ b/test/Analysis/out-of-bounds.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,security.experimental.ArrayBoundV2 -verify %s
+// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,experimental.security.ArrayBoundV2 -verify %s
// Tests doing an out-of-bounds access after the end of an array using:
// - constant integer index
@@ -94,7 +94,6 @@ void test2_ptr(int x) {
p[-1] = 1; // expected-warning{{Out of bound memory access}}
}
-// ** FIXME ** Doesn't work yet because we don't support pointer arithmetic.
// Tests doing an out-of-bounds access before the start of an array using:
// - indirect pointer to buffer, manipulated using simple pointer arithmetic
// - constant integer index
@@ -103,7 +102,7 @@ void test2_ptr_arith(int x) {
int buf[100];
int *p = buf;
--p;
- p[0] = 1; // no-warning
+ p[0] = 1; // expected-warning {{Out of bound memory access (accessed memory precedes memory block)}}
}
// Tests doing an out-of-bounds access before the start of a multi-dimensional
diff --git a/test/Analysis/outofbound-notwork.c b/test/Analysis/outofbound-notwork.c
new file mode 100644
index 000000000000..45e713b6880a
--- /dev/null
+++ b/test/Analysis/outofbound-notwork.c
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,experimental.unix,experimental.security.ArrayBound -analyzer-store=region -verify %s
+// XFAIL: *
+
+// Once we better handle modeling of sizes of VLAs, we can pull this back
+// into outofbound.c.
+
+void sizeof_vla(int a) {
+ if (a == 5) {
+ char x[a];
+ int y[sizeof(x)];
+ y[4] = 4; // no-warning
+ y[5] = 5; // expected-warning{{out-of-bound}}
+ }
+}
+
+void sizeof_vla_2(int a) {
+ if (a == 5) {
+ char x[a];
+ int y[sizeof(x) / sizeof(char)];
+ y[4] = 4; // no-warning
+ y[5] = 5; // expected-warning{{out-of-bound}}
+ }
+}
+
+void sizeof_vla_3(int a) {
+ if (a == 5) {
+ char x[a];
+ int y[sizeof(*&*&*&x)];
+ y[4] = 4; // no-warning
+ y[5] = 5; // expected-warning{{out-of-bound}}
+ }
+}
diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c
index 891719c1932f..2e7a7d30d67f 100644
--- a/test/Analysis/outofbound.c
+++ b/test/Analysis/outofbound.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,unix.experimental,security.experimental.ArrayBound -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,experimental.unix,experimental.security.ArrayBound -analyzer-store=region -verify %s
typedef __typeof(sizeof(int)) size_t;
void *malloc(size_t);
@@ -63,15 +63,6 @@ void vla(int a) {
}
}
-void sizeof_vla(int a) {
- if (a == 5) {
- char x[a];
- int y[sizeof(x)];
- y[4] = 4; // no-warning
- y[5] = 5; // expected-warning{{out-of-bound}}
- }
-}
-
void alloca_region(int a) {
if (a == 5) {
char *x = __builtin_alloca(a);
diff --git a/test/Analysis/override-werror.c b/test/Analysis/override-werror.c
index 1b1f9e1c0169..d3b75f694d0b 100644
--- a/test/Analysis/override-werror.c
+++ b/test/Analysis/override-werror.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -Werror %s -analyzer-store=region -verify
// This test case illustrates that using '-analyze' overrides the effect of
// -Werror. This allows basic warnings not to interfere with producing
diff --git a/test/Analysis/plist-output-alternate.m b/test/Analysis/plist-output-alternate.m
index 0f4d3aee0744..23a260a129c7 100644
--- a/test/Analysis/plist-output-alternate.m
+++ b/test/Analysis/plist-output-alternate.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o - %s | FileCheck %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o - %s | FileCheck %s
void test_null_init(void) {
int *p = 0;
@@ -69,34 +69,6 @@ void rdar8331641(int x) {
// CHECK: <key>path</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>kind</key><string>event</string>
-// CHECK: <key>location</key>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>4</integer>
-// CHECK: <key>col</key><integer>3</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: <key>ranges</key>
-// CHECK: <array>
-// CHECK: <array>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>4</integer>
-// CHECK: <key>col</key><integer>3</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>4</integer>
-// CHECK: <key>col</key><integer>8</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: </array>
-// CHECK: </array>
-// CHECK: <key>extended_message</key>
-// CHECK: <string>Variable &apos;p&apos; initialized to a null pointer value</string>
-// CHECK: <key>message</key>
-// CHECK: <string>Variable &apos;p&apos; initialized to a null pointer value</string>
-// CHECK: </dict>
-// CHECK: <dict>
// CHECK: <key>kind</key><string>control</string>
// CHECK: <key>edges</key>
// CHECK: <array>
@@ -110,7 +82,7 @@ void rdar8331641(int x) {
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>4</integer>
-// CHECK: <key>col</key><integer>8</integer>
+// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -193,13 +165,13 @@ void rdar8331641(int x) {
// CHECK: <key>end</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
+// CHECK: <key>line</key><integer>11</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>col</key><integer>4</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -210,7 +182,7 @@ void rdar8331641(int x) {
// CHECK: <key>kind</key><string>event</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
+// CHECK: <key>line</key><integer>11</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -218,22 +190,36 @@ void rdar8331641(int x) {
// CHECK: <array>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>col</key><integer>4</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
-// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>col</key><integer>4</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </array>
// CHECK: <key>extended_message</key>
-// CHECK: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
// CHECK: <key>message</key>
-// CHECK: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
// CHECK: </dict>
+// CHECK: </array>
+// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK: <key>category</key><string>Logic error</string>
+// CHECK: <key>type</key><string>Dereference of null pointer</string>
+// CHECK: <key>location</key>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>path</key>
+// CHECK: <array>
// CHECK: <dict>
// CHECK: <key>kind</key><string>control</string>
// CHECK: <key>edges</key>
@@ -242,12 +228,12 @@ void rdar8331641(int x) {
// CHECK: <key>start</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
+// CHECK: <key>line</key><integer>15</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>10</integer>
+// CHECK: <key>line</key><integer>15</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -255,12 +241,12 @@ void rdar8331641(int x) {
// CHECK: <key>end</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>line</key><integer>18</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>line</key><integer>18</integer>
// CHECK: <key>col</key><integer>4</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -272,7 +258,7 @@ void rdar8331641(int x) {
// CHECK: <key>kind</key><string>event</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>line</key><integer>18</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -280,29 +266,29 @@ void rdar8331641(int x) {
// CHECK: <array>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>line</key><integer>18</integer>
// CHECK: <key>col</key><integer>4</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>line</key><integer>18</integer>
// CHECK: <key>col</key><integer>4</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </array>
// CHECK: <key>extended_message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
// CHECK: <key>message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
// CHECK: </dict>
// CHECK: </array>
-// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
// CHECK: <key>category</key><string>Logic error</string>
// CHECK: <key>type</key><string>Dereference of null pointer</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>11</integer>
+// CHECK: <key>line</key><integer>18</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -318,12 +304,12 @@ void rdar8331641(int x) {
// CHECK: <key>start</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>15</integer>
+// CHECK: <key>line</key><integer>22</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>15</integer>
+// CHECK: <key>line</key><integer>22</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -331,12 +317,12 @@ void rdar8331641(int x) {
// CHECK: <key>end</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>22</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
+// CHECK: <key>line</key><integer>22</integer>
// CHECK: <key>col</key><integer>8</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -348,29 +334,29 @@ void rdar8331641(int x) {
// CHECK: <key>kind</key><string>event</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>22</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <key>ranges</key>
// CHECK: <array>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>22</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
+// CHECK: <key>line</key><integer>22</integer>
// CHECK: <key>col</key><integer>8</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </array>
// CHECK: <key>extended_message</key>
-// CHECK: <string>Variable &apos;q&apos; initialized to a null pointer value</string>
+// CHECK: <string>Assuming &apos;p&apos; is null</string>
// CHECK: <key>message</key>
-// CHECK: <string>Variable &apos;q&apos; initialized to a null pointer value</string>
+// CHECK: <string>Assuming &apos;p&apos; is null</string>
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>kind</key><string>control</string>
@@ -380,12 +366,12 @@ void rdar8331641(int x) {
// CHECK: <key>start</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>22</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>17</integer>
+// CHECK: <key>line</key><integer>22</integer>
// CHECK: <key>col</key><integer>8</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -393,13 +379,13 @@ void rdar8331641(int x) {
// CHECK: <key>end</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>18</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>23</integer>
+// CHECK: <key>col</key><integer>5</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>18</integer>
-// CHECK: <key>col</key><integer>4</integer>
+// CHECK: <key>line</key><integer>23</integer>
+// CHECK: <key>col</key><integer>6</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -410,38 +396,38 @@ void rdar8331641(int x) {
// CHECK: <key>kind</key><string>event</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>18</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>23</integer>
+// CHECK: <key>col</key><integer>5</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <key>ranges</key>
// CHECK: <array>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>18</integer>
-// CHECK: <key>col</key><integer>4</integer>
+// CHECK: <key>line</key><integer>23</integer>
+// CHECK: <key>col</key><integer>6</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>18</integer>
-// CHECK: <key>col</key><integer>4</integer>
+// CHECK: <key>line</key><integer>23</integer>
+// CHECK: <key>col</key><integer>6</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </array>
// CHECK: <key>extended_message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
// CHECK: <key>message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
// CHECK: </dict>
// CHECK: </array>
-// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
+// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
// CHECK: <key>category</key><string>Logic error</string>
// CHECK: <key>type</key><string>Dereference of null pointer</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>18</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>line</key><integer>23</integer>
+// CHECK: <key>col</key><integer>5</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </dict>
@@ -456,12 +442,12 @@ void rdar8331641(int x) {
// CHECK: <key>start</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>22</integer>
+// CHECK: <key>line</key><integer>28</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>22</integer>
+// CHECK: <key>line</key><integer>28</integer>
// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
@@ -469,13 +455,13 @@ void rdar8331641(int x) {
// CHECK: <key>end</key>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>23</integer>
-// CHECK: <key>col</key><integer>5</integer>
+// CHECK: <key>line</key><integer>28</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>23</integer>
-// CHECK: <key>col</key><integer>6</integer>
+// CHECK: <key>line</key><integer>28</integer>
+// CHECK: <key>col</key><integer>8</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -486,44 +472,30 @@ void rdar8331641(int x) {
// CHECK: <key>kind</key><string>event</string>
// CHECK: <key>location</key>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>23</integer>
-// CHECK: <key>col</key><integer>5</integer>
+// CHECK: <key>line</key><integer>28</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <key>ranges</key>
// CHECK: <array>
// CHECK: <array>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>23</integer>
-// CHECK: <key>col</key><integer>6</integer>
+// CHECK: <key>line</key><integer>28</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>line</key><integer>23</integer>
-// CHECK: <key>col</key><integer>6</integer>
+// CHECK: <key>line</key><integer>28</integer>
+// CHECK: <key>col</key><integer>8</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </array>
// CHECK: <key>extended_message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK: <string>Assuming &apos;q&apos; is null</string>
// CHECK: <key>message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK: <string>Assuming &apos;q&apos; is null</string>
// CHECK: </dict>
-// CHECK: </array>
-// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
-// CHECK: <key>category</key><string>Logic error</string>
-// CHECK: <key>type</key><string>Dereference of null pointer</string>
-// CHECK: <key>location</key>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>23</integer>
-// CHECK: <key>col</key><integer>5</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: </dict>
-// CHECK: <dict>
-// CHECK: <key>path</key>
-// CHECK: <array>
// CHECK: <dict>
// CHECK: <key>kind</key><string>control</string>
// CHECK: <key>edges</key>
@@ -533,12 +505,12 @@ void rdar8331641(int x) {
// CHECK: <array>
// CHECK: <dict>
// CHECK: <key>line</key><integer>28</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>col</key><integer>7</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>28</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>col</key><integer>8</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -551,7 +523,7 @@ void rdar8331641(int x) {
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>29</integer>
-// CHECK: <key>col</key><integer>10</integer>
+// CHECK: <key>col</key><integer>5</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -559,34 +531,6 @@ void rdar8331641(int x) {
// CHECK: </array>
// CHECK: </dict>
// CHECK: <dict>
-// CHECK: <key>kind</key><string>event</string>
-// CHECK: <key>location</key>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>29</integer>
-// CHECK: <key>col</key><integer>5</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: <key>ranges</key>
-// CHECK: <array>
-// CHECK: <array>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>29</integer>
-// CHECK: <key>col</key><integer>5</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>29</integer>
-// CHECK: <key>col</key><integer>10</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: </array>
-// CHECK: </array>
-// CHECK: <key>extended_message</key>
-// CHECK: <string>Variable &apos;p&apos; initialized to a null pointer value</string>
-// CHECK: <key>message</key>
-// CHECK: <string>Variable &apos;p&apos; initialized to a null pointer value</string>
-// CHECK: </dict>
-// CHECK: <dict>
// CHECK: <key>kind</key><string>control</string>
// CHECK: <key>edges</key>
// CHECK: <array>
@@ -600,7 +544,7 @@ void rdar8331641(int x) {
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>29</integer>
-// CHECK: <key>col</key><integer>10</integer>
+// CHECK: <key>col</key><integer>5</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -676,7 +620,7 @@ void rdar8331641(int x) {
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>35</integer>
-// CHECK: <key>col</key><integer>8</integer>
+// CHECK: <key>col</key><integer>3</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -923,13 +867,75 @@ void rdar8331641(int x) {
// CHECK: <key>end</key>
// CHECK: <array>
// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>kind</key><string>event</string>
+// CHECK: <key>location</key>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <key>ranges</key>
+// CHECK: <array>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: </array>
+// CHECK: <key>extended_message</key>
+// CHECK: <string>Assuming &apos;x&apos; is 0</string>
+// CHECK: <key>message</key>
+// CHECK: <string>Assuming &apos;x&apos; is 0</string>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>kind</key><string>control</string>
+// CHECK: <key>edges</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>start</key>
+// CHECK: <array>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: <dict>
+// CHECK: <key>line</key><integer>54</integer>
+// CHECK: <key>col</key><integer>7</integer>
+// CHECK: <key>file</key><integer>0</integer>
+// CHECK: </dict>
+// CHECK: </array>
+// CHECK: <key>end</key>
+// CHECK: <array>
+// CHECK: <dict>
// CHECK: <key>line</key><integer>56</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>col</key><integer>10</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>56</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>col</key><integer>10</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -945,12 +951,12 @@ void rdar8331641(int x) {
// CHECK: <array>
// CHECK: <dict>
// CHECK: <key>line</key><integer>56</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>col</key><integer>10</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>56</integer>
-// CHECK: <key>col</key><integer>3</integer>
+// CHECK: <key>col</key><integer>10</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
@@ -978,21 +984,6 @@ void rdar8331641(int x) {
// CHECK: <key>col</key><integer>1</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
-// CHECK: <key>ranges</key>
-// CHECK: <array>
-// CHECK: <array>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>57</integer>
-// CHECK: <key>col</key><integer>1</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: <dict>
-// CHECK: <key>line</key><integer>57</integer>
-// CHECK: <key>col</key><integer>1</integer>
-// CHECK: <key>file</key><integer>0</integer>
-// CHECK: </dict>
-// CHECK: </array>
-// CHECK: </array>
// CHECK: <key>extended_message</key>
// CHECK: <string>Object leaked: object allocated and stored into &apos;value&apos; is not referenced later in this execution path and has a retain count of +1</string>
// CHECK: <key>message</key>
@@ -1001,7 +992,7 @@ void rdar8331641(int x) {
// CHECK: </array>
// CHECK: <key>description</key><string>Potential leak of an object allocated on line 53 and stored into &apos;value&apos;</string>
// CHECK: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
-// CHECK: <key>type</key><string>Leak of returned object</string>
+// CHECK: <key>type</key><string>Leak</string>
// CHECK: <key>location</key>
// CHECK: <dict>
// CHECK: <key>line</key><integer>57</integer>
@@ -1012,4 +1003,3 @@ void rdar8331641(int x) {
// CHECK: </array>
// CHECK: </dict>
// CHECK: </plist>
-
diff --git a/test/Analysis/plist-output.m b/test/Analysis/plist-output.m
index 224f5194765e..e08ccc43dec8 100644
--- a/test/Analysis/plist-output.m
+++ b/test/Analysis/plist-output.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o - %s | FileCheck %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o - %s | FileCheck %s
// XFAIL: *
void test_null_init(void) {
diff --git a/test/Analysis/pr4209.m b/test/Analysis/pr4209.m
index e3bc5cc14333..e16d1aa0ed5b 100644
--- a/test/Analysis/pr4209.m
+++ b/test/Analysis/pr4209.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
// This test case was crashing due to how CFRefCount.cpp resolved the
// ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr.
diff --git a/test/Analysis/pr_2542_rdar_6793404.m b/test/Analysis/pr_2542_rdar_6793404.m
index 73218d8bc80e..d5125a649d2b 100644
--- a/test/Analysis/pr_2542_rdar_6793404.m
+++ b/test/Analysis/pr_2542_rdar_6793404.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -pedantic -analyzer-store=region -verify %s
// BEGIN delta-debugging reduced header stuff
diff --git a/test/Analysis/pr_4164.c b/test/Analysis/pr_4164.c
index c58c8abe3f67..187f4c6bca43 100644
--- a/test/Analysis/pr_4164.c
+++ b/test/Analysis/pr_4164.c
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
// PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164
//
diff --git a/test/Analysis/properties.m b/test/Analysis/properties.m
index ad9db1ad6818..6d04a4ab4e78 100644
--- a/test/Analysis/properties.m
+++ b/test/Analysis/properties.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s
typedef signed char BOOL;
typedef unsigned int NSUInteger;
diff --git a/test/Analysis/pthreadlock.c b/test/Analysis/pthreadlock.c
new file mode 100644
index 000000000000..4735d20eaa5c
--- /dev/null
+++ b/test/Analysis/pthreadlock.c
@@ -0,0 +1,137 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.unix.PthreadLock -verify %s
+
+// Tests performing normal locking patterns and wrong locking orders
+
+typedef struct {
+ void *foo;
+} pthread_mutex_t;
+
+typedef pthread_mutex_t lck_mtx_t;
+
+extern int pthread_mutex_lock(pthread_mutex_t *);
+extern int pthread_mutex_unlock(pthread_mutex_t *);
+extern int pthread_mutex_trylock(pthread_mutex_t *);
+extern int lck_mtx_lock(lck_mtx_t *);
+extern int lck_mtx_unlock(lck_mtx_t *);
+extern int lck_mtx_try_lock(lck_mtx_t *);
+
+pthread_mutex_t mtx1, mtx2;
+lck_mtx_t lck1, lck2;
+
+void
+ok1(void)
+{
+ pthread_mutex_lock(&mtx1); // no-warning
+}
+
+void
+ok2(void)
+{
+ pthread_mutex_unlock(&mtx1); // no-warning
+}
+
+void
+ok3(void)
+{
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_unlock(&mtx1); // no-warning
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_unlock(&mtx1); // no-warning
+}
+
+void
+ok4(void)
+{
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_unlock(&mtx1); // no-warning
+ pthread_mutex_lock(&mtx2); // no-warning
+ pthread_mutex_unlock(&mtx2); // no-warning
+}
+
+void
+ok5(void)
+{
+ if (pthread_mutex_trylock(&mtx1) == 0) // no-warning
+ pthread_mutex_unlock(&mtx1); // no-warning
+}
+
+void
+ok6(void)
+{
+ lck_mtx_lock(&lck1); // no-warning
+}
+
+void
+ok7(void)
+{
+ if (lck_mtx_try_lock(&lck1) != 0) // no-warning
+ lck_mtx_unlock(&lck1); // no-warning
+}
+
+void
+bad1(void)
+{
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_lock(&mtx1); // expected-warning{{This lock has already been acquired}}
+}
+
+void
+bad2(void)
+{
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_unlock(&mtx1); // no-warning
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_lock(&mtx1); // expected-warning{{This lock has already been acquired}}
+}
+
+void
+bad3(void)
+{
+ pthread_mutex_lock(&mtx1); // no-warning
+ pthread_mutex_lock(&mtx2); // no-warning
+ pthread_mutex_unlock(&mtx1); // expected-warning{{This was not the most recently acquired lock}}
+ pthread_mutex_unlock(&mtx2);
+}
+
+void
+bad4(void)
+{
+ if (pthread_mutex_trylock(&mtx1)) // no-warning
+ return;
+ pthread_mutex_lock(&mtx2); // no-warning
+ pthread_mutex_unlock(&mtx1); // expected-warning{{This was not the most recently acquired lock}}
+}
+
+void
+bad5(void)
+{
+ lck_mtx_lock(&lck1); // no-warning
+ lck_mtx_lock(&lck1); // expected-warning{{This lock has already been acquired}}
+}
+
+void
+bad6(void)
+{
+ lck_mtx_lock(&lck1); // no-warning
+ lck_mtx_unlock(&lck1); // no-warning
+ lck_mtx_lock(&lck1); // no-warning
+ lck_mtx_lock(&lck1); // expected-warning{{This lock has already been acquired}}
+}
+
+void
+bad7(void)
+{
+ lck_mtx_lock(&lck1); // no-warning
+ lck_mtx_lock(&lck2); // no-warning
+ lck_mtx_unlock(&lck1); // expected-warning{{This was not the most recently acquired lock}}
+ lck_mtx_unlock(&lck2);
+}
+
+void
+bad8(void)
+{
+ if (lck_mtx_try_lock(&lck1) == 0) // no-warning
+ return;
+ lck_mtx_lock(&lck2); // no-warning
+ lck_mtx_unlock(&lck1); // expected-warning{{This was not the most recently acquired lock}}
+}
diff --git a/test/Analysis/ptr-arith.c b/test/Analysis/ptr-arith.c
index 502de6c3ef9a..995470a369cb 100644
--- a/test/Analysis/ptr-arith.c
+++ b/test/Analysis/ptr-arith.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental.FixedAddr,core.experimental.PointerArithm,core.experimental.PointerSub -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental.FixedAddr,core.experimental.PointerArithm,core.experimental.PointerSub -analyzer-store=region -verify -triple i686-apple-darwin9 %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core.FixedAddr,experimental.core.PointerArithm,experimental.core.PointerSub -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core.FixedAddr,experimental.core.PointerArithm,experimental.core.PointerSub -analyzer-store=region -verify -triple i686-apple-darwin9 %s
// Used to trigger warnings for unreachable paths.
#define WARN do { int a, b; int c = &b-&a; } while (0)
diff --git a/test/Analysis/rdar-6442306-1.m b/test/Analysis/rdar-6442306-1.m
index d576eae8f652..62992d0146aa 100644
--- a/test/Analysis/rdar-6442306-1.m
+++ b/test/Analysis/rdar-6442306-1.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core %s -analyzer-store=region -verify
typedef int bar_return_t;
typedef struct {
diff --git a/test/Analysis/rdar-6540084.m b/test/Analysis/rdar-6540084.m
index 4c70dbc0758f..b2a113c20dcf 100644
--- a/test/Analysis/rdar-6540084.m
+++ b/test/Analysis/rdar-6540084.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=deadcode.DeadStores -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=deadcode.DeadStores -verify %s
//
// This test exercises the live variables analysis (LiveVariables.cpp).
// The case originally identified a non-termination bug.
diff --git a/test/Analysis/rdar-6541136-region.c b/test/Analysis/rdar-6541136-region.c
index 5555b018578f..b90d4f43ddf7 100644
--- a/test/Analysis/rdar-6541136-region.c
+++ b/test/Analysis/rdar-6541136-region.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -analyze -analyzer-checker=core,security.experimental.ArrayBound -analyzer-store=region %s
+// RUN: %clang_cc1 -verify -analyze -analyzer-checker=core,experimental.security.ArrayBound -analyzer-store=region %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
diff --git a/test/Analysis/rdar-6541136.c b/test/Analysis/rdar-6541136.c
deleted file mode 100644
index 095aefadb8ce..000000000000
--- a/test/Analysis/rdar-6541136.c
+++ /dev/null
@@ -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
-}
diff --git a/test/Analysis/rdar-6562655.m b/test/Analysis/rdar-6562655.m
index 1e0998aa974e..3a592730a897 100644
--- a/test/Analysis/rdar-6562655.m
+++ b/test/Analysis/rdar-6562655.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-constraints=basic -analyzer-store=region -verify %s
//
// This test case mainly checks that the retain/release checker doesn't crash
// on this file.
diff --git a/test/Analysis/rdar-6582778-basic-store.c b/test/Analysis/rdar-6582778-basic-store.c
deleted file mode 100644
index 0642b64cd7fd..000000000000
--- a/test/Analysis/rdar-6582778-basic-store.c
+++ /dev/null
@@ -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
-}
diff --git a/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m b/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
index 03b2656c7ee6..e9711e70c204 100644
--- a/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
+++ b/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=basic -analyzer-store=region %s -verify
typedef struct Foo { int x; } Bar;
diff --git a/test/Analysis/rdar-7168531.m b/test/Analysis/rdar-7168531.m
index b2b66b279296..151625569ca7 100644
--- a/test/Analysis/rdar-7168531.m
+++ b/test/Analysis/rdar-7168531.m
@@ -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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -triple i386-apple-darwin10 -fobjc-fragile-abi -analyzer-store=region %s
// Note that the target triple is important for this test case. It specifies that we use the
// fragile Objective-C ABI.
diff --git a/test/Analysis/refcnt_naming.m b/test/Analysis/refcnt_naming.m
index 8e99f3409b81..aff713be49f2 100644
--- a/test/Analysis/refcnt_naming.m
+++ b/test/Analysis/refcnt_naming.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -verify %s
typedef const struct __CFString * CFStringRef;
typedef const struct __CFAllocator * CFAllocatorRef;
diff --git a/test/Analysis/reference.cpp b/test/Analysis/reference.cpp
index 3422b58d3fe8..c7912f4f029e 100644
--- a/test/Analysis/reference.cpp
+++ b/test/Analysis/reference.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
+// XFAIL
typedef typeof(sizeof(int)) size_t;
void malloc (size_t);
diff --git a/test/Analysis/region-1.m b/test/Analysis/region-1.m
index 7f4cd26e405e..be9276609136 100644
--- a/test/Analysis/region-1.m
+++ b/test/Analysis/region-1.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
//
// This test case simply should not crash. It evaluates the logic of not
// using MemRegion::getRValueType in incorrect places.
diff --git a/test/Analysis/retain-release-basic-store.m b/test/Analysis/retain-release-basic-store.m
deleted file mode 100644
index 7fd17ffb995f..000000000000
--- a/test/Analysis/retain-release-basic-store.m
+++ /dev/null
@@ -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;
-}
-
diff --git a/test/Analysis/retain-release-gc-only.m b/test/Analysis/retain-release-gc-only.m
index ee1a6b4b782e..4e1b8466c322 100644
--- a/test/Analysis/retain-release-gc-only.m
+++ b/test/Analysis/retain-release-gc-only.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.NSAutoreleasePool -analyzer-store=region -fobjc-gc-only -fblocks -verify %s
//===----------------------------------------------------------------------===//
// Header stuff.
@@ -92,7 +91,7 @@ typedef struct _NSZone NSZone;
+ (id)allocWithZone:(NSZone *)zone;
+ (id)alloc;
- (void)dealloc;
-- (void)release;
+- (oneway void)release;
- (id)copy;
@end
@interface NSObject (NSCoderMethods)
diff --git a/test/Analysis/retain-release-path-notes-gc.m b/test/Analysis/retain-release-path-notes-gc.m
index 21d314fa1541..19e6d7b8b337 100644
--- a/test/Analysis/retain-release-path-notes-gc.m
+++ b/test/Analysis/retain-release-path-notes-gc.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -fobjc-gc-only -verify %s
/***
This file is for testing the path-sensitive notes for retain/release errors.
diff --git a/test/Analysis/retain-release-path-notes.m b/test/Analysis/retain-release-path-notes.m
index bac0afb3f7ab..e34942a8968c 100644
--- a/test/Analysis/retain-release-path-notes.m
+++ b/test/Analysis/retain-release-path-notes.m
@@ -1,5 +1,4 @@
-// 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
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s
/***
This file is for testing the path-sensitive notes for retain/release errors.
diff --git a/test/Analysis/retain-release-region-store.m b/test/Analysis/retain-release-region-store.m
index ac2362a4a73c..89950ce7cd25 100644
--- a/test/Analysis/retain-release-region-store.m
+++ b/test/Analysis/retain-release-region-store.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-max-loop 6 -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-max-loop 6 -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m
index 71ae756cf045..6f8bf09ebd74 100644
--- a/test/Analysis/retain-release.m
+++ b/test/Analysis/retain-release.m
@@ -1,7 +1,5 @@
-// 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
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify -x objective-c++ %s
#if __has_feature(attribute_ns_returns_retained)
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
@@ -148,7 +146,9 @@ NSFastEnumerationState;
typedef double NSTimeInterval;
@interface NSDate : NSObject <NSCopying, NSCoding> - (NSTimeInterval)timeIntervalSinceReferenceDate;
@end typedef unsigned short unichar;
-@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length;
+@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
+- (NSUInteger)length;
+- (NSString *)stringByAppendingString:(NSString *)aString;
- ( const char *)UTF8String;
- (id)initWithUTF8String:(const char *)nullTerminatedCString;
+ (id)stringWithUTF8String:(const char *)nullTerminatedCString;
@@ -270,6 +270,12 @@ extern void CGContextDrawLinearGradient(CGContextRef context,
CGGradientDrawingOptions options);
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
+@interface NSMutableArray : NSObject
+- (void)addObject:(id)object;
++ (id)array;
+@end
+
+
//===----------------------------------------------------------------------===//
// Test cases.
//===----------------------------------------------------------------------===//
@@ -654,6 +660,12 @@ void rdar6704930(unsigned char *s, unsigned int length) {
[window release];
[super dealloc];
}
+
+- (void)radar10102244 {
+ NSMutableDictionary *dict = [[NSMutableDictionary dictionaryWithCapacity:4] retain]; // expected-warning{{leak}}
+ if (window)
+ NSLog(@"%@", window);
+}
@end
//===----------------------------------------------------------------------===//
@@ -1446,7 +1458,7 @@ static void rdar_8724287(CFErrorRef error)
while (error_to_dump != ((void*)0)) {
CFDictionaryRef info;
- info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object allocated on line 1449 and stored into 'info'}}
+ info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object allocated on line}}
if (info != ((void*)0)) {
}
@@ -1540,3 +1552,55 @@ CFArrayRef camel_copymachine() {
return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
}
+// rdar://problem/8024350
+@protocol F18P
+- (id) clone;
+@end
+@interface F18 : NSObject<F18P> @end
+@interface F18(Cat)
+- (id) clone NS_RETURNS_RETAINED;
+@end
+
+@implementation F18
+- (id) clone {
+ 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
+}
+
+// <rdar://problem/10232019> - Test that objects passed to containers
+// are marked "escaped".
+
+void rdar10232019() {
+ NSMutableArray *array = [NSMutableArray array];
+
+ NSString *string = [[NSString alloc] initWithUTF8String:"foo"];
+ [array addObject:string];
+ [string release];
+
+ NSString *otherString = [string stringByAppendingString:@"bar"]; // no-warning
+ NSLog(@"%@", otherString);
+}
+
+void rdar10232019_positive() {
+ NSMutableArray *array = [NSMutableArray array];
+
+ NSString *string = [[NSString alloc] initWithUTF8String:"foo"];
+ [string release];
+
+ NSString *otherString = [string stringByAppendingString:@"bar"]; // expected-warning {{Reference-counted object is used after it is release}}
+ NSLog(@"%@", otherString);
+}
+
diff --git a/test/Analysis/retain-release.mm b/test/Analysis/retain-release.mm
index bdc3dc03964a..bae8dc339254 100644
--- a/test/Analysis/retain-release.mm
+++ b/test/Analysis/retain-release.mm
@@ -1,4 +1,4 @@
-// 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,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify %s
#if __has_feature(attribute_ns_returns_retained)
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
@@ -304,4 +304,14 @@ void test_smartpointer_3() {
foo.noAdopt(x);
}
+extern CFStringRef ElectronMicroscopyEngage(void);
+void test_microscopy() {
+ NSString *token = (NSString*) ElectronMicroscopyEngage();
+ [token release]; // expected-warning {{object that is not owned}}
+}
+extern CFStringRef Scopy(void);
+void test_Scopy() {
+ NSString *token = (NSString*) Scopy();
+ [token release]; // expected-warning {{object that is not owned}}
+}
diff --git a/test/Analysis/security-syntax-checks-no-emit.c b/test/Analysis/security-syntax-checks-no-emit.c
index 4e37c44247c2..cbd432a19b31 100644
--- a/test/Analysis/security-syntax-checks-no-emit.c
+++ b/test/Analysis/security-syntax-checks-no-emit.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
// This file complements 'security-syntax-checks.m', but tests that we omit
// specific checks on platforms where they don't make sense.
diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m
index 160dcf657387..6fb5b3cf14ef 100644
--- a/test/Analysis/security-syntax-checks.m
+++ b/test/Analysis/security-syntax-checks.m
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DVARIANT -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DVARIANT -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
#ifdef USE_BUILTINS
# define BUILTIN(f) __builtin_ ## f
@@ -164,3 +164,14 @@ void test_strcat() {
strcat(x, y); //expected-warning{{Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strncat'. CWE-119.}}
}
+
+//===----------------------------------------------------------------------===
+// vfork()
+//===----------------------------------------------------------------------===
+typedef int __int32_t;
+typedef __int32_t pid_t;
+pid_t vfork(void); //expected-warning{{declaration of built-in function 'vfork' requires inclusion of the header <setjmp.h>}}
+
+void test_vfork() {
+ vfork(); //expected-warning{{Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process.}}
+}
diff --git a/test/Analysis/self-init.m b/test/Analysis/self-init.m
index 92006a6d2459..019fdcd0c2bf 100644
--- a/test/Analysis/self-init.m
+++ b/test/Analysis/self-init.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.experimental.SelfInit %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.osx.cocoa.SelfInit %s -verify
@class NSZone, NSCoder;
@protocol NSObject
diff --git a/test/Analysis/sizeofpointer.c b/test/Analysis/sizeofpointer.c
index 6d0a2c4d2c26..0c86de88ae28 100644
--- a/test/Analysis/sizeofpointer.c
+++ b/test/Analysis/sizeofpointer.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental.SizeofPtr -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core.SizeofPtr -verify %s
struct s {
};
diff --git a/test/Analysis/stack-addr-ps.c b/test/Analysis/stack-addr-ps.c
index bf2a4fa4e13c..558986d308d4 100644
--- a/test/Analysis/stack-addr-ps.c
+++ b/test/Analysis/stack-addr-ps.c
@@ -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() {
@@ -59,7 +58,7 @@ int struct_test(struct baz byVal, int flag) {
typedef int (^ComparatorBlock)(int a, int b);
ComparatorBlock test_return_block(void) {
ComparatorBlock b = ^int(int a, int b){ return a > b; };
- return b; // expected-warning{{Address of stack-allocated block declared on line 61 returned to caller}}
+ return b; // expected-warning{{Address of stack-allocated block declared on line 60 returned to caller}}
}
ComparatorBlock test_return_block_neg_aux(void);
diff --git a/test/Analysis/stack-addr-ps.cpp b/test/Analysis/stack-addr-ps.cpp
index 0c1ffba4f8c5..b09e43560830 100644
--- a/test/Analysis/stack-addr-ps.cpp
+++ b/test/Analysis/stack-addr-ps.cpp
@@ -1,38 +1,38 @@
-// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
// FIXME: Only the stack-address checking in Sema catches this right now, and
// the stack analyzer doesn't handle the ImplicitCastExpr (lvalue).
const int& g() {
int s;
- return s; // expected-warning{{reference to stack memory associated with local variable 's' returned}}
+ return s; // expected-warning{{Address of stack memory associated with local variable 's' returned}} expected-warning{{reference to stack memory associated with local variable 's' returned}}
}
const int& g2() {
int s1;
int &s2 = s1; // expected-note {{binding reference variable 's2' here}}
- return s2; // expected-warning {{reference to stack memory associated with local variable 's1' returned}}
+ return s2; // expected-warning{{Address of stack memory associated with local variable 's1' returned}} expected-warning {{reference to stack memory associated with local variable 's1' returned}}
}
const int& g3() {
int s1;
int &s2 = s1; // expected-note {{binding reference variable 's2' here}}
int &s3 = s2; // expected-note {{binding reference variable 's3' here}}
- return s3; // expected-warning {{reference to stack memory associated with local variable 's1' returned}}
+ return s3; // expected-warning{{Address of stack memory associated with local variable 's1' returned}} expected-warning {{reference to stack memory associated with local variable 's1' returned}}
}
int get_value();
-const int &get_reference1() { return get_value(); } // expected-warning {{returning reference to local temporary}}
+const int &get_reference1() { return get_value(); } // expected-warning{{Address of stack memory associated with temporary object of type 'const int' returned}} expected-warning {{returning reference to local temporary}}
const int &get_reference2() {
const int &x = get_value(); // expected-note {{binding reference variable 'x' here}}
- return x; // expected-warning {{returning reference to local temporary}}
+ return x; // expected-warning{{Address of stack memory associated with temporary object of type 'const int' returned}} expected-warning {{returning reference to local temporary}}
}
const int &get_reference3() {
const int &x1 = get_value(); // expected-note {{binding reference variable 'x1' here}}
const int &x2 = x1; // expected-note {{binding reference variable 'x2' here}}
- return x2; // expected-warning {{returning reference to local temporary}}
+ return x2; // expected-warning{{Address of stack memory associated with temporary object of type 'const int' returned}} expected-warning {{returning reference to local temporary}}
}
int global_var;
@@ -44,19 +44,19 @@ int *f1() {
int *f2() {
int x1;
int &x2 = x1; // expected-note {{binding reference variable 'x2' here}}
- return &x2; // expected-warning {{address of stack memory associated with local variable 'x1' returned}}
+ return &x2; // expected-warning{{Address of stack memory associated with local variable 'x1' returned}} expected-warning {{address of stack memory associated with local variable 'x1' returned}}
}
int *f3() {
int x1;
int *const &x2 = &x1; // expected-note {{binding reference variable 'x2' here}}
- return x2; // expected-warning {{address of stack memory associated with local variable 'x1' returned}}
+ return x2; // expected-warning {{address of stack memory associated with local variable 'x1' returned}} expected-warning {{Address of stack memory associated with local variable 'x1' returned to caller}}
}
const int *f4() {
const int &x1 = get_value(); // expected-note {{binding reference variable 'x1' here}}
const int &x2 = x1; // expected-note {{binding reference variable 'x2' here}}
- return &x2; // expected-warning {{returning address of local temporary}}
+ return &x2; // expected-warning{{Address of stack memory associated with temporary object of type 'const int' returned}} expected-warning {{returning address of local temporary}}
}
struct S {
@@ -67,7 +67,7 @@ int *mf() {
S s1;
S &s2 = s1; // expected-note {{binding reference variable 's2' here}}
int &x = s2.x; // expected-note {{binding reference variable 'x' here}}
- return &x; // expected-warning {{address of stack memory associated with local variable 's1' returned}}
+ return &x; // expected-warning{{Address of stack memory associated with local variable 's1' returned}} expected-warning {{address of stack memory associated with local variable 's1' returned}}
}
void *lf() {
@@ -76,14 +76,6 @@ void *lf() {
return x; // expected-warning {{returning address of label, which is local}}
}
-typedef void (^bptr)(void);
-
-bptr bf(int j) {
- __block int i;
- const bptr &qq = ^{ i=0; }; // expected-note {{binding reference variable 'qq' here}}
- return qq; // expected-error {{returning block that lives on the local stack}}
-}
-
template <typename T>
struct TS {
int *get();
diff --git a/test/Analysis/stack-block-returned.cpp b/test/Analysis/stack-block-returned.cpp
new file mode 100644
index 000000000000..af2cec776697
--- /dev/null
+++ b/test/Analysis/stack-block-returned.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s
+
+typedef void (^bptr)(void);
+
+bptr bf(int j) {
+ __block int i;
+ const bptr &qq = ^{ i=0; }; // expected-note {{binding reference variable 'qq' here}}
+ return qq; // expected-error {{returning block that lives on the local stack}}
+}
diff --git a/test/Analysis/stream.c b/test/Analysis/stream.c
index 2f372e755153..e68835e5cfc4 100644
--- a/test/Analysis/stream.c
+++ b/test/Analysis/stream.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=unix.experimental.Stream -analyzer-store region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.unix.Stream -analyzer-store region -verify %s
typedef __typeof__(sizeof(int)) size_t;
typedef struct _IO_FILE FILE;
diff --git a/test/Analysis/string-fail.c b/test/Analysis/string-fail.c
index 64ac504d6d80..3bff6d40dd51 100644
--- a/test/Analysis/string-fail.c
+++ b/test/Analysis/string-fail.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
// XFAIL: *
// This file is for tests that may eventually go into string.c, or may be
diff --git a/test/Analysis/string.c b/test/Analysis/string.c
index dc97e1a119e0..a71e1f008817 100644
--- a/test/Analysis/string.c
+++ b/test/Analysis/string.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,unix.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,unix.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
//===----------------------------------------------------------------------===
// Declarations
diff --git a/test/Analysis/temp-obj-dtors-cfg-output.cpp b/test/Analysis/temp-obj-dtors-cfg-output.cpp
index 5ed782c690a1..17864e4c5485 100644
--- a/test/Analysis/temp-obj-dtors-cfg-output.cpp
+++ b/test/Analysis/temp-obj-dtors-cfg-output.cpp
@@ -106,486 +106,661 @@ TestCtorInits::TestCtorInits()
: a(int(A()) + int(B()))
, b() {}
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: A()
-// CHECK: 2: [B1.1].operator int()
-// CHECK: 3: B()
-// CHECK: 4: [B1.3].operator int()
-// CHECK: 5: int a = int(A().operator int()) + int(B().operator int());
-// CHECK: 6: ~B() (Temporary object destructor)
-// CHECK: 7: ~A() (Temporary object destructor)
-// CHECK: 8: A()
-// CHECK: 9: [B1.8].operator int()
-// CHECK: 10: B()
-// CHECK: 11: [B1.10].operator int()
-// CHECK: 12: foo(int([B1.9]) + int([B1.11]))
-// CHECK: 13: ~B() (Temporary object destructor)
-// CHECK: 14: ~A() (Temporary object destructor)
-// CHECK: 15: int b;
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B10 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B8
-// CHECK: [ B1 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: int b;
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B3
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: [B4.3] && [B5.2]
-// CHECK: 2: foo([B3.1])
-// CHECK: T: [B4.3] && ...
-// CHECK: Predecessors (2): B5 B4
-// CHECK: Successors (2): B2 B1
-// CHECK: [ B4 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: A()
-// CHECK: 3: [B4.2].operator _Bool()
-// CHECK: T: [B4.3] && ...
-// CHECK: Predecessors (2): B6 B7
-// CHECK: Successors (2): B5 B3
-// CHECK: [ B5 ]
-// CHECK: 1: B()
-// CHECK: 2: [B5.1].operator _Bool()
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B3
-// CHECK: [ B6 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B7 ]
-// CHECK: 1: [B8.2] && [B9.2]
-// CHECK: 2: bool a = A().operator _Bool() && B().operator _Bool();
-// CHECK: T: [B8.2] && ...
-// CHECK: Predecessors (2): B9 B8
-// CHECK: Successors (2): B6 B4
-// CHECK: [ B8 ]
-// CHECK: 1: A()
-// CHECK: 2: [B8.1].operator _Bool()
-// CHECK: T: [B8.2] && ...
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (2): B9 B7
-// CHECK: [ B9 ]
-// CHECK: 1: B()
-// CHECK: 2: [B9.1].operator _Bool()
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (1): B7
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B10 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B8
-// CHECK: [ B1 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: int b;
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B3
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: [B4.3] || [B5.2]
-// CHECK: 2: foo([B3.1])
-// CHECK: T: [B4.3] || ...
-// CHECK: Predecessors (2): B5 B4
-// CHECK: Successors (2): B1 B2
-// CHECK: [ B4 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: A()
-// CHECK: 3: [B4.2].operator _Bool()
-// CHECK: T: [B4.3] || ...
-// CHECK: Predecessors (2): B6 B7
-// CHECK: Successors (2): B3 B5
-// CHECK: [ B5 ]
-// CHECK: 1: B()
-// CHECK: 2: [B5.1].operator _Bool()
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B3
-// CHECK: [ B6 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B7 ]
-// CHECK: 1: [B8.2] || [B9.2]
-// CHECK: 2: bool a = A().operator _Bool() || B().operator _Bool();
-// CHECK: T: [B8.2] || ...
-// CHECK: Predecessors (2): B9 B8
-// CHECK: Successors (2): B4 B6
-// CHECK: [ B8 ]
-// CHECK: 1: A()
-// CHECK: 2: [B8.1].operator _Bool()
-// CHECK: T: [B8.2] || ...
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (2): B7 B9
-// CHECK: [ B9 ]
-// CHECK: 1: B()
-// CHECK: 2: [B9.1].operator _Bool()
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (1): B7
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B11 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B10
-// CHECK: [ B1 ]
-// CHECK: 1: int b;
-// CHECK: 2: [B7.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: foo(0)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: foo(0)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: 2: B()
-// CHECK: 3: [B4.2].operator _Bool()
-// CHECK: 4: ~B() (Temporary object destructor)
-// CHECK: T: if [B4.3]
-// CHECK: Predecessors (2): B5 B6
-// CHECK: Successors (2): B3 B2
-// CHECK: [ B5 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B6 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: 3: ~A() (Temporary object destructor)
-// CHECK: 4: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B7 ]
-// CHECK: 1: [B10.2] ? [B8.2] : [B9.3]
-// CHECK: 2: A a = B().operator _Bool() ? A() : A(B().operator A());
-// CHECK: T: [B10.2] ? ... : ...
-// CHECK: Predecessors (2): B8 B9
-// CHECK: Successors (2): B5 B6
-// CHECK: [ B8 ]
-// CHECK: 1: A()
-// CHECK: 2: [B8.1] (BindTemporary)
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (1): B7
-// CHECK: [ B9 ]
-// CHECK: 1: B()
-// CHECK: 2: [B9.1].operator A()
-// CHECK: 3: A([B9.2]) (BindTemporary)
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (1): B7
-// CHECK: [ B10 ]
-// CHECK: 1: B()
-// CHECK: 2: [B10.1].operator _Bool()
-// CHECK: T: [B10.2] ? ... : ...
-// CHECK: Predecessors (1): B11
-// CHECK: Successors (2): B8 B9
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B14 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B13
-// CHECK: [ B1 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: 2: int b;
-// CHECK: 3: [B10.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: 3: ~A() (Temporary object destructor)
-// CHECK: 4: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1: [B7.3] ? [B5.2] : [B6.3]
-// CHECK: 2: foo([B4.1])
-// CHECK: T: [B7.3] ? ... : ...
-// CHECK: Predecessors (2): B5 B6
-// CHECK: Successors (2): B2 B3
-// CHECK: [ B5 ]
-// CHECK: 1: A()
-// CHECK: 2: [B5.1] (BindTemporary)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B6 ]
-// CHECK: 1: B()
-// CHECK: 2: [B6.1].operator A()
-// CHECK: 3: A([B6.2]) (BindTemporary)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B7 ]
-// CHECK: 1: ~B() (Temporary object destructor)
-// CHECK: 2: B()
-// CHECK: 3: [B7.2].operator _Bool()
-// CHECK: T: [B7.3] ? ... : ...
-// CHECK: Predecessors (2): B8 B9
-// CHECK: Successors (2): B5 B6
-// CHECK: [ B8 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (1): B7
-// CHECK: [ B9 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: 3: ~B() (Temporary object destructor)
-// CHECK: Predecessors (1): B10
-// CHECK: Successors (1): B7
-// CHECK: [ B10 ]
-// CHECK: 1: [B13.2] ? [B11.2] : [B12.3]
-// CHECK: 2: const A &a = B().operator _Bool() ? A() : A(B().operator A());
-// CHECK: T: [B13.2] ? ... : ...
-// CHECK: Predecessors (2): B11 B12
-// CHECK: Successors (2): B8 B9
-// CHECK: [ B11 ]
-// CHECK: 1: A()
-// CHECK: 2: [B11.1] (BindTemporary)
-// CHECK: Predecessors (1): B13
-// CHECK: Successors (1): B10
-// CHECK: [ B12 ]
-// CHECK: 1: B()
-// CHECK: 2: [B12.1].operator A()
-// CHECK: 3: A([B12.2]) (BindTemporary)
-// CHECK: Predecessors (1): B13
-// CHECK: Successors (1): B10
-// CHECK: [ B13 ]
-// CHECK: 1: B()
-// CHECK: 2: [B13.1].operator _Bool()
-// CHECK: T: [B13.2] ? ... : ...
-// CHECK: Predecessors (1): B14
-// CHECK: Successors (2): B11 B12
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B8 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B7
-// CHECK: [ B1 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: int b;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1: [B7.2] ?: [B6.2]
-// CHECK: 2: A a = A() ?: A();
-// CHECK: T: [B7.3] ? ... : ...
-// CHECK: Predecessors (2): B5 B6
-// CHECK: Successors (2): B2 B3
-// CHECK: [ B5 ]
-// CHECK: 1:
-// CHECK: 2: [B5.1] (BindTemporary)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B6 ]
-// CHECK: 1: A()
-// CHECK: 2: [B6.1] (BindTemporary)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B7 ]
-// CHECK: 1: A()
-// CHECK: 2: [B7.1] (BindTemporary)
-// CHECK: 3: .operator _Bool()
-// CHECK: T: [B7.3] ? ... : ...
-// CHECK: Predecessors (1): B8
-// CHECK: Successors (2): B5 B6
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B13 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B12
-// CHECK: [ B1 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: int b;
-// CHECK: 3: [B9.2].~A() (Implicit destructor)
-// CHECK: Predecessors (2): B2 B3
-// CHECK: Successors (1): B0
-// CHECK: [ B2 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B3 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B4
-// CHECK: Successors (1): B1
-// CHECK: [ B4 ]
-// CHECK: 1: [B7.3] ?: [B6.2]
-// CHECK: 2: foo([B4.1])
-// CHECK: T: [B7.4] ? ... : ...
-// CHECK: Predecessors (2): B5 B6
-// CHECK: Successors (2): B2 B3
-// CHECK: [ B5 ]
-// CHECK: 1:
-// CHECK: 2: [B5.1] (BindTemporary)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B6 ]
-// CHECK: 1: A()
-// CHECK: 2: [B6.1] (BindTemporary)
-// CHECK: Predecessors (1): B7
-// CHECK: Successors (1): B4
-// CHECK: [ B7 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: 2: A()
-// CHECK: 3: [B7.2] (BindTemporary)
-// CHECK: 4: .operator _Bool()
-// CHECK: T: [B7.4] ? ... : ...
-// CHECK: Predecessors (2): B9 B8
-// CHECK: Successors (2): B5 B6
-// CHECK: [ B8 ]
-// CHECK: 1: ~A() (Temporary object destructor)
-// CHECK: Predecessors (1): B9
-// CHECK: Successors (1): B7
-// CHECK: [ B9 ]
-// CHECK: 1: [B12.2] ?: [B11.2]
-// CHECK: 2: const A &a = A() ?: A();
-// CHECK: T: [B12.3] ? ... : ...
-// CHECK: Predecessors (2): B10 B11
-// CHECK: Successors (2): B7 B8
-// CHECK: [ B10 ]
-// CHECK: 1:
-// CHECK: 2: [B10.1] (BindTemporary)
-// CHECK: Predecessors (1): B12
-// CHECK: Successors (1): B9
-// CHECK: [ B11 ]
-// CHECK: 1: A()
-// CHECK: 2: [B11.1] (BindTemporary)
-// CHECK: Predecessors (1): B12
-// CHECK: Successors (1): B9
-// CHECK: [ B12 ]
-// CHECK: 1: A()
-// CHECK: 2: [B12.1] (BindTemporary)
-// CHECK: 3: .operator _Bool()
-// CHECK: T: [B12.3] ? ... : ...
-// CHECK: Predecessors (1): B13
-// CHECK: Successors (2): B10 B11
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: A()
-// CHECK: 2: A a = A();
-// CHECK: 3: ~A() (Temporary object destructor)
-// CHECK: 4: int b;
-// CHECK: 5: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: A()
-// CHECK: 2: const A &a = A();
-// CHECK: 3: A()
-// CHECK: 4: foo([B1.3])
-// CHECK: 5: ~A() (Temporary object destructor)
-// CHECK: 6: int b;
-// CHECK: 7: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: A::make()
-// CHECK: 2: A a = A::make();
-// CHECK: 3: ~A() (Temporary object destructor)
-// CHECK: 4: int b;
-// CHECK: 5: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: A::make()
-// CHECK: 2: const A &a = A::make();
-// CHECK: 3: A::make()
-// CHECK: 4: foo([B1.3])
-// CHECK: 5: ~A() (Temporary object destructor)
-// CHECK: 6: int b;
-// CHECK: 7: [B1.2].~A() (Implicit destructor)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: int a;
-// CHECK: 2: A()
-// CHECK: 3: [B1.2].operator int()
-// CHECK: 4: a = [B1.3]
-// CHECK: 5: ~A() (Temporary object destructor)
-// CHECK: 6: int b;
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
-// CHECK: [ B2 (ENTRY) ]
-// CHECK: Predecessors (0):
-// CHECK: Successors (1): B1
-// CHECK: [ B1 ]
-// CHECK: 1: A()
-// CHECK: 2: [B1.1].operator int()
-// CHECK: 3: B()
-// CHECK: 4: [B1.3].operator int()
-// CHECK: 5: a(int([B1.2]) + int([B1.4])) (Member initializer)
-// CHECK: 6: ~B() (Temporary object destructor)
-// CHECK: 7: ~A() (Temporary object destructor)
-// CHECK: 8: b(/*implicit*/int()) (Member initializer)
-// CHECK: Predecessors (1): B2
-// CHECK: Successors (1): B0
-// CHECK: [ B0 (EXIT) ]
-// CHECK: Predecessors (1): B1
-// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: A()
+// CHECK: 2: [B1.1] (BindTemporary)
+// CHECK: 3: [B1.2].operator int
+// CHECK: 4: [B1.3]()
+// CHECK: 5: [B1.4]
+// CHECK: 6: int([B1.5])
+// CHECK: 7: B()
+// CHECK: 8: [B1.7] (BindTemporary)
+// CHECK: 9: [B1.8].operator int
+// CHECK: 10: [B1.9]()
+// CHECK: 11: [B1.10]
+// CHECK: 12: int([B1.11])
+// CHECK: 13: [B1.6] + [B1.12]
+// CHECK: 14: int a = int(A().operator int()) + int(B().operator int());
+// CHECK: 15: ~B() (Temporary object destructor)
+// CHECK: 16: ~A() (Temporary object destructor)
+// CHECK: 17: A()
+// CHECK: 18: [B1.17] (BindTemporary)
+// CHECK: 19: [B1.18].operator int
+// CHECK: 20: [B1.19]()
+// CHECK: 21: [B1.20]
+// CHECK: 22: int([B1.21])
+// CHECK: 23: B()
+// CHECK: 24: [B1.23] (BindTemporary)
+// CHECK: 25: [B1.24].operator int
+// CHECK: 26: [B1.25]()
+// CHECK: 27: [B1.26]
+// CHECK: 28: int([B1.27])
+// CHECK: 29: [B1.22] + [B1.28]
+// CHECK: 30: foo
+// CHECK: 31: [B1.30]
+// CHECK: 32: [B1.31]([B1.29])
+// CHECK: 33: ~B() (Temporary object destructor)
+// CHECK: 34: ~A() (Temporary object destructor)
+// CHECK: 35: int b;
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B10 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B8
+// CHECK: [ B1 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: int b;
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B3
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: [B4.5] && [B5.4]
+// CHECK: 2: foo
+// CHECK: 3: [B3.2]
+// CHECK: 4: [B3.3]([B3.1])
+// CHECK: T: [B4.5] && ...
+// CHECK: Predecessors (2): B5 B4
+// CHECK: Successors (2): B2 B1
+// CHECK: [ B4 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: A()
+// CHECK: 3: [B4.2] (BindTemporary)
+// CHECK: 4: [B4.3].operator _Bool
+// CHECK: 5: [B4.4]()
+// CHECK: T: [B4.5] && ...
+// CHECK: Predecessors (2): B6 B7
+// CHECK: Successors (2): B5 B3
+// CHECK: [ B5 ]
+// CHECK: 1: B()
+// CHECK: 2: [B5.1] (BindTemporary)
+// CHECK: 3: [B5.2].operator _Bool
+// CHECK: 4: [B5.3]()
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B3
+// CHECK: [ B6 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B7 ]
+// CHECK: 1: [B8.4] && [B9.4]
+// CHECK: 2: bool a = A().operator _Bool() && B().operator _Bool();
+// CHECK: T: [B8.4] && ...
+// CHECK: Predecessors (2): B9 B8
+// CHECK: Successors (2): B6 B4
+// CHECK: [ B8 ]
+// CHECK: 1: A()
+// CHECK: 2: [B8.1] (BindTemporary)
+// CHECK: 3: [B8.2].operator _Bool
+// CHECK: 4: [B8.3]()
+// CHECK: T: [B8.4] && ...
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (2): B9 B7
+// CHECK: [ B9 ]
+// CHECK: 1: B()
+// CHECK: 2: [B9.1] (BindTemporary)
+// CHECK: 3: [B9.2].operator _Bool
+// CHECK: 4: [B9.3]()
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (1): B7
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B10 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B8
+// CHECK: [ B1 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: int b;
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B3
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: [B4.5] || [B5.4]
+// CHECK: 2: foo
+// CHECK: 3: [B3.2]
+// CHECK: 4: [B3.3]([B3.1])
+// CHECK: T: [B4.5] || ...
+// CHECK: Predecessors (2): B5 B4
+// CHECK: Successors (2): B1 B2
+// CHECK: [ B4 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: A()
+// CHECK: 3: [B4.2] (BindTemporary)
+// CHECK: 4: [B4.3].operator _Bool
+// CHECK: 5: [B4.4]()
+// CHECK: T: [B4.5] || ...
+// CHECK: Predecessors (2): B6 B7
+// CHECK: Successors (2): B3 B5
+// CHECK: [ B5 ]
+// CHECK: 1: B()
+// CHECK: 2: [B5.1] (BindTemporary)
+// CHECK: 3: [B5.2].operator _Bool
+// CHECK: 4: [B5.3]()
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B3
+// CHECK: [ B6 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B7 ]
+// CHECK: 1: [B8.4] || [B9.4]
+// CHECK: 2: bool a = A().operator _Bool() || B().operator _Bool();
+// CHECK: T: [B8.4] || ...
+// CHECK: Predecessors (2): B9 B8
+// CHECK: Successors (2): B4 B6
+// CHECK: [ B8 ]
+// CHECK: 1: A()
+// CHECK: 2: [B8.1] (BindTemporary)
+// CHECK: 3: [B8.2].operator _Bool
+// CHECK: 4: [B8.3]()
+// CHECK: T: [B8.4] || ...
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (2): B7 B9
+// CHECK: [ B9 ]
+// CHECK: 1: B()
+// CHECK: 2: [B9.1] (BindTemporary)
+// CHECK: 3: [B9.2].operator _Bool
+// CHECK: 4: [B9.3]()
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (1): B7
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B11 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B10
+// CHECK: [ B1 ]
+// CHECK: 1: int b;
+// CHECK: 2: [B7.4].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: 0
+// CHECK: 2: foo
+// CHECK: 3: [B2.2]
+// CHECK: 4: [B2.3]([B2.1])
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: 0
+// CHECK: 2: foo
+// CHECK: 3: [B3.2]
+// CHECK: 4: [B3.3]([B3.1])
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: 2: B()
+// CHECK: 3: [B4.2] (BindTemporary)
+// CHECK: 4: [B4.3].operator _Bool
+// CHECK: 5: [B4.4]()
+// CHECK: 6: ~B() (Temporary object destructor)
+// CHECK: T: if [B4.5]
+// CHECK: Predecessors (2): B5 B6
+// CHECK: Successors (2): B3 B2
+// CHECK: [ B5 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B6 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: 3: ~A() (Temporary object destructor)
+// CHECK: 4: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B7 ]
+// CHECK: 1: [B10.4] ? [B8.5] : [B9.13]
+// CHECK: 2: [B7.1]
+// CHECK: 3: [B7.2]
+// CHECK: 4: A a = B().operator _Bool() ? A() : A(B().operator A());
+// CHECK: T: [B10.4] ? ... : ...
+// CHECK: Predecessors (2): B8 B9
+// CHECK: Successors (2): B5 B6
+// CHECK: [ B8 ]
+// CHECK: 1: A()
+// CHECK: 2: [B8.1] (BindTemporary)
+// CHECK: 3: [B8.2]
+// CHECK: 4: [B8.3]
+// CHECK: 5: [B8.4] (BindTemporary)
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (1): B7
+// CHECK: [ B9 ]
+// CHECK: 1: B()
+// CHECK: 2: [B9.1] (BindTemporary)
+// CHECK: 3: [B9.2].operator A
+// CHECK: 4: [B9.3]()
+// CHECK: 5: [B9.4] (BindTemporary)
+// CHECK: 6: [B9.5]
+// CHECK: 7: [B9.6]
+// CHECK: 8: [B9.7]
+// CHECK: 9: [B9.8] (BindTemporary)
+// CHECK: 10: A([B9.9])
+// CHECK: 11: [B9.10]
+// CHECK: 12: [B9.11]
+// CHECK: 13: [B9.12] (BindTemporary)
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (1): B7
+// CHECK: [ B10 ]
+// CHECK: 1: B()
+// CHECK: 2: [B10.1] (BindTemporary)
+// CHECK: 3: [B10.2].operator _Bool
+// CHECK: 4: [B10.3]()
+// CHECK: T: [B10.4] ? ... : ...
+// CHECK: Predecessors (1): B11
+// CHECK: Successors (2): B8 B9
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B14 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B13
+// CHECK: [ B1 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: 2: int b;
+// CHECK: 3: [B10.4].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: 3: ~A() (Temporary object destructor)
+// CHECK: 4: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1: [B7.5] ? [B5.5] : [B6.13]
+// CHECK: 2: [B4.1]
+// CHECK: 3: [B4.2]
+// CHECK: 4: foo
+// CHECK: 5: [B4.4]
+// CHECK: 6: [B4.5]([B4.3])
+// CHECK: T: [B7.5] ? ... : ...
+// CHECK: Predecessors (2): B5 B6
+// CHECK: Successors (2): B2 B3
+// CHECK: [ B5 ]
+// CHECK: 1: A()
+// CHECK: 2: [B5.1] (BindTemporary)
+// CHECK: 3: [B5.2]
+// CHECK: 4: [B5.3]
+// CHECK: 5: [B5.4] (BindTemporary)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B6 ]
+// CHECK: 1: B()
+// CHECK: 2: [B6.1] (BindTemporary)
+// CHECK: 3: [B6.2].operator A
+// CHECK: 4: [B6.3]()
+// CHECK: 5: [B6.4] (BindTemporary)
+// CHECK: 6: [B6.5]
+// CHECK: 7: [B6.6]
+// CHECK: 8: [B6.7]
+// CHECK: 9: [B6.8] (BindTemporary)
+// CHECK: 10: A([B6.9])
+// CHECK: 11: [B6.10]
+// CHECK: 12: [B6.11]
+// CHECK: 13: [B6.12] (BindTemporary)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B7 ]
+// CHECK: 1: ~B() (Temporary object destructor)
+// CHECK: 2: B()
+// CHECK: 3: [B7.2] (BindTemporary)
+// CHECK: 4: [B7.3].operator _Bool
+// CHECK: 5: [B7.4]()
+// CHECK: T: [B7.5] ? ... : ...
+// CHECK: Predecessors (2): B8 B9
+// CHECK: Successors (2): B5 B6
+// CHECK: [ B8 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (1): B7
+// CHECK: [ B9 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: 3: ~B() (Temporary object destructor)
+// CHECK: Predecessors (1): B10
+// CHECK: Successors (1): B7
+// CHECK: [ B10 ]
+// CHECK: 1: [B13.4] ? [B11.5] : [B12.13]
+// CHECK: 2: [B10.1]
+// CHECK: 3: [B10.2]
+// CHECK: 4: const A &a = B().operator _Bool() ? A() : A(B().operator A());
+// CHECK: T: [B13.4] ? ... : ...
+// CHECK: Predecessors (2): B11 B12
+// CHECK: Successors (2): B8 B9
+// CHECK: [ B11 ]
+// CHECK: 1: A()
+// CHECK: 2: [B11.1] (BindTemporary)
+// CHECK: 3: [B11.2]
+// CHECK: 4: [B11.3]
+// CHECK: 5: [B11.4] (BindTemporary)
+// CHECK: Predecessors (1): B13
+// CHECK: Successors (1): B10
+// CHECK: [ B12 ]
+// CHECK: 1: B()
+// CHECK: 2: [B12.1] (BindTemporary)
+// CHECK: 3: [B12.2].operator A
+// CHECK: 4: [B12.3]()
+// CHECK: 5: [B12.4] (BindTemporary)
+// CHECK: 6: [B12.5]
+// CHECK: 7: [B12.6]
+// CHECK: 8: [B12.7]
+// CHECK: 9: [B12.8] (BindTemporary)
+// CHECK: 10: A([B12.9])
+// CHECK: 11: [B12.10]
+// CHECK: 12: [B12.11]
+// CHECK: 13: [B12.12] (BindTemporary)
+// CHECK: Predecessors (1): B13
+// CHECK: Successors (1): B10
+// CHECK: [ B13 ]
+// CHECK: 1: B()
+// CHECK: 2: [B13.1] (BindTemporary)
+// CHECK: 3: [B13.2].operator _Bool
+// CHECK: 4: [B13.3]()
+// CHECK: T: [B13.4] ? ... : ...
+// CHECK: Predecessors (1): B14
+// CHECK: Successors (2): B11 B12
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B8 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B7
+// CHECK: [ B1 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: int b;
+// CHECK: 3: [B4.4].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1: [B7.2] ?: [B6.5]
+// CHECK: 2: [B4.1]
+// CHECK: 3: [B4.2]
+// CHECK: 4: A a = A() ?: A();
+// CHECK: T: [B7.5] ? ... : ...
+// CHECK: Predecessors (2): B5 B6
+// CHECK: Successors (2): B2 B3
+// CHECK: [ B5 ]
+// CHECK: 1: [B7.3]
+// CHECK: 2: [B7.3]
+// CHECK: 3: [B5.2]
+// CHECK: 4: [B5.3]
+// CHECK: 5: [B5.4] (BindTemporary)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B6 ]
+// CHECK: 1: A()
+// CHECK: 2: [B6.1] (BindTemporary)
+// CHECK: 3: [B6.2]
+// CHECK: 4: [B6.3]
+// CHECK: 5: [B6.4] (BindTemporary)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B7 ]
+// CHECK: 1: A()
+// CHECK: 2: [B7.1] (BindTemporary)
+// CHECK: 3:
+// CHECK: 4: [B7.3].operator _Bool
+// CHECK: 5: [B7.4]()
+// CHECK: T: [B7.5] ? ... : ...
+// CHECK: Predecessors (1): B8
+// CHECK: Successors (2): B5 B6
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B13 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B12
+// CHECK: [ B1 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: int b;
+// CHECK: 3: [B9.4].~A() (Implicit destructor)
+// CHECK: Predecessors (2): B2 B3
+// CHECK: Successors (1): B0
+// CHECK: [ B2 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B3 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B4
+// CHECK: Successors (1): B1
+// CHECK: [ B4 ]
+// CHECK: 1: [B7.3] ?: [B6.5]
+// CHECK: 2: [B4.1]
+// CHECK: 3: [B4.2]
+// CHECK: 4: foo
+// CHECK: 5: [B4.4]
+// CHECK: 6: [B4.5]([B4.3])
+// CHECK: T: [B7.6] ? ... : ...
+// CHECK: Predecessors (2): B5 B6
+// CHECK: Successors (2): B2 B3
+// CHECK: [ B5 ]
+// CHECK: 1: [B7.4]
+// CHECK: 2: [B7.4]
+// CHECK: 3: [B5.2]
+// CHECK: 4: [B5.3]
+// CHECK: 5: [B5.4] (BindTemporary)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B6 ]
+// CHECK: 1: A()
+// CHECK: 2: [B6.1] (BindTemporary)
+// CHECK: 3: [B6.2]
+// CHECK: 4: [B6.3]
+// CHECK: 5: [B6.4] (BindTemporary)
+// CHECK: Predecessors (1): B7
+// CHECK: Successors (1): B4
+// CHECK: [ B7 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: 2: A()
+// CHECK: 3: [B7.2] (BindTemporary)
+// CHECK: 4:
+// CHECK: 5: [B7.4].operator _Bool
+// CHECK: 6: [B7.5]()
+// CHECK: T: [B7.6] ? ... : ...
+// CHECK: Predecessors (2): B9 B8
+// CHECK: Successors (2): B5 B6
+// CHECK: [ B8 ]
+// CHECK: 1: ~A() (Temporary object destructor)
+// CHECK: Predecessors (1): B9
+// CHECK: Successors (1): B7
+// CHECK: [ B9 ]
+// CHECK: 1: [B12.2] ?: [B11.5]
+// CHECK: 2: [B9.1]
+// CHECK: 3: [B9.2]
+// CHECK: 4: const A &a = A() ?: A();
+// CHECK: T: [B12.5] ? ... : ...
+// CHECK: Predecessors (2): B10 B11
+// CHECK: Successors (2): B7 B8
+// CHECK: [ B10 ]
+// CHECK: 1: [B12.3]
+// CHECK: 2: [B12.3]
+// CHECK: 3: [B10.2]
+// CHECK: 4: [B10.3]
+// CHECK: 5: [B10.4] (BindTemporary)
+// CHECK: Predecessors (1): B12
+// CHECK: Successors (1): B9
+// CHECK: [ B11 ]
+// CHECK: 1: A()
+// CHECK: 2: [B11.1] (BindTemporary)
+// CHECK: 3: [B11.2]
+// CHECK: 4: [B11.3]
+// CHECK: 5: [B11.4] (BindTemporary)
+// CHECK: Predecessors (1): B12
+// CHECK: Successors (1): B9
+// CHECK: [ B12 ]
+// CHECK: 1: A()
+// CHECK: 2: [B12.1] (BindTemporary)
+// CHECK: 3:
+// CHECK: 4: [B12.3].operator _Bool
+// CHECK: 5: [B12.4]()
+// CHECK: T: [B12.5] ? ... : ...
+// CHECK: Predecessors (1): B13
+// CHECK: Successors (2): B10 B11
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: A()
+// CHECK: 2: [B1.1] (BindTemporary)
+// CHECK: 3: [B1.2]
+// CHECK: 4: [B1.3]
+// CHECK: 5: A a = A();
+// CHECK: 6: ~A() (Temporary object destructor)
+// CHECK: 7: int b;
+// CHECK: 8: [B1.5].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: A()
+// CHECK: 2: [B1.1] (BindTemporary)
+// CHECK: 3: [B1.2]
+// CHECK: 4: [B1.3]
+// CHECK: 5: const A &a = A();
+// CHECK: 6: A()
+// CHECK: 7: [B1.6] (BindTemporary)
+// CHECK: 8: [B1.7]
+// CHECK: 9: [B1.8]
+// CHECK: 10: foo
+// CHECK: 11: [B1.10]
+// CHECK: 12: [B1.11]([B1.9])
+// CHECK: 13: ~A() (Temporary object destructor)
+// CHECK: 14: int b;
+// CHECK: 15: [B1.5].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: A::make
+// CHECK: 2: [B1.1]
+// CHECK: 3: [B1.2]()
+// CHECK: 4: [B1.3] (BindTemporary)
+// CHECK: 5: [B1.4]
+// CHECK: 6: [B1.5]
+// CHECK: 7: A a = A::make();
+// CHECK: 8: ~A() (Temporary object destructor)
+// CHECK: 9: int b;
+// CHECK: 10: [B1.7].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: A::make
+// CHECK: 2: [B1.1]
+// CHECK: 3: [B1.2]()
+// CHECK: 4: [B1.3] (BindTemporary)
+// CHECK: 5: [B1.4]
+// CHECK: 6: [B1.5]
+// CHECK: 7: const A &a = A::make();
+// CHECK: 8: A::make
+// CHECK: 9: [B1.8]
+// CHECK: 10: [B1.9]()
+// CHECK: 11: [B1.10] (BindTemporary)
+// CHECK: 12: [B1.11]
+// CHECK: 13: [B1.12]
+// CHECK: 14: foo
+// CHECK: 15: [B1.14]
+// CHECK: 16: [B1.15]([B1.13])
+// CHECK: 17: ~A() (Temporary object destructor)
+// CHECK: 18: int b;
+// CHECK: 19: [B1.7].~A() (Implicit destructor)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: int a;
+// CHECK: 2: A()
+// CHECK: 3: [B1.2] (BindTemporary)
+// CHECK: 4: [B1.3].operator int
+// CHECK: 5: [B1.4]()
+// CHECK: 6: a
+// CHECK: 7: [B1.6] = [B1.5]
+// CHECK: 8: ~A() (Temporary object destructor)
+// CHECK: 9: int b;
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+// CHECK: [ B2 (ENTRY) ]
+// CHECK: Predecessors (0):
+// CHECK: Successors (1): B1
+// CHECK: [ B1 ]
+// CHECK: 1: A()
+// CHECK: 2: [B1.1] (BindTemporary)
+// CHECK: 3: [B1.2].operator int
+// CHECK: 4: [B1.3]()
+// CHECK: 5: [B1.4]
+// CHECK: 6: int([B1.5])
+// CHECK: 7: B()
+// CHECK: 8: [B1.7] (BindTemporary)
+// CHECK: 9: [B1.8].operator int
+// CHECK: 10: [B1.9]()
+// CHECK: 11: [B1.10]
+// CHECK: 12: int([B1.11])
+// CHECK: 13: [B1.6] + [B1.12]
+// CHECK: 14: a([B1.13]) (Member initializer)
+// CHECK: 15: ~B() (Temporary object destructor)
+// CHECK: 16: ~A() (Temporary object destructor)
+// CHECK: 17: /*implicit*/int()
+// CHECK: 18: b([B1.17]) (Member initializer)
+// CHECK: Predecessors (1): B2
+// CHECK: Successors (1): B0
+// CHECK: [ B0 (EXIT) ]
+// CHECK: Predecessors (1): B1
+// CHECK: Successors (0):
+
diff --git a/test/Analysis/undef-buffers.c b/test/Analysis/undef-buffers.c
index df124b10d10e..cfdd7f4e1a83 100644
--- a/test/Analysis/undef-buffers.c
+++ b/test/Analysis/undef-buffers.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.experimental,core.uninitialized -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.unix,core.uninitialized -analyzer-store=region -verify %s
typedef __typeof(sizeof(int)) size_t;
void *malloc(size_t);
void free(void *);
@@ -15,6 +15,17 @@ char stackBased2 () {
return buf[0]; // expected-warning{{Undefined}}
}
+// Exercise the conditional visitor. Radar://10105448
+char stackBased3 (int *x) {
+ char buf[2];
+ int *y;
+ buf[0] = 'a';
+ if (!(y = x)) {
+ return buf[1]; // expected-warning{{Undefined}}
+ }
+ return buf[0];
+}
+
char heapBased1 () {
char *buf = malloc(2);
buf[0] = 'a';
diff --git a/test/Analysis/uninit-msg-expr.m b/test/Analysis/uninit-msg-expr.m
index 743d36ff56de..19fdf611c865 100644
--- a/test/Analysis/uninit-msg-expr.m
+++ b/test/Analysis/uninit-msg-expr.m
@@ -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
//===----------------------------------------------------------------------===//
diff --git a/test/Analysis/uninit-ps-rdar6145427.m b/test/Analysis/uninit-ps-rdar6145427.m
index f4df91396a84..c18116f21ae5 100644
--- a/test/Analysis/uninit-ps-rdar6145427.m
+++ b/test/Analysis/uninit-ps-rdar6145427.m
@@ -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.
diff --git a/test/Analysis/uninit-vals-ps.c b/test/Analysis/uninit-vals-ps.c
index 915961aa11da..f3011570a85a 100644
--- a/test/Analysis/uninit-vals-ps.c
+++ b/test/Analysis/uninit-vals-ps.c
@@ -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 {
diff --git a/test/Analysis/uninit-vals.m b/test/Analysis/uninit-vals.m
index 4b7e6f42cf8f..4ba26f59b720 100644
--- a/test/Analysis/uninit-vals.m
+++ b/test/Analysis/uninit-vals.m
@@ -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;
diff --git a/test/Analysis/unix-fns.c b/test/Analysis/unix-fns.c
index 5df6b37bb91a..cf5ca810de33 100644
--- a/test/Analysis/unix-fns.c
+++ b/test/Analysis/unix-fns.c
@@ -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;
diff --git a/test/Analysis/unreachable-code-path.c b/test/Analysis/unreachable-code-path.c
index 7df52402e735..da14f4c010d6 100644
--- a/test/Analysis/unreachable-code-path.c
+++ b/test/Analysis/unreachable-code-path.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.experimental.UnreachableCode -verify -analyzer-opt-analyze-nested-blocks -Wno-unused-value %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,experimental.deadcode.UnreachableCode -verify -analyzer-opt-analyze-nested-blocks -Wno-unused-value %s
extern void foo(int a);
diff --git a/test/Analysis/unused-ivars.m b/test/Analysis/unused-ivars.m
index 931c84a3745a..42bde1004dcc 100644
--- a/test/Analysis/unused-ivars.m
+++ b/test/Analysis/unused-ivars.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fblocks -analyze -analyzer-checker=osx.cocoa.UnusedIvars %s -verify
+// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=osx.cocoa.UnusedIvars %s -verify
//===--- BEGIN: Delta-debugging reduced headers. --------------------------===//
@@ -97,7 +97,7 @@ int radar_7254495(RDar7254495 *a) {
@end
//===----------------------------------------------------------------------===//
// <rdar://problem/8481311> Unused bitfield ivars trigger cause weird
-// diagnostic: "Instance variable '' in class…"
+// diagnostic: "Instance variable '' in class..."
//===----------------------------------------------------------------------===//
@interface RDar8481311 {
diff --git a/test/Analysis/variadic-method-types.m b/test/Analysis/variadic-method-types.m
index 03c309a5004a..caa0c59debba 100644
--- a/test/Analysis/variadic-method-types.m
+++ b/test/Analysis/variadic-method-types.m
@@ -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
//===----------------------------------------------------------------------===//