Added test case for static analyzer to detect uses of uninitialized pointers as receivers in Objective-C message expressions.

Added test case directory "Analysis-Apple" which is only run on Apple (darwin) machines.

llvm-svn: 48844
This commit is contained in:
Ted Kremenek 2008-03-26 21:51:44 +00:00
parent ea7cb37a5c
commit a1d9ed137a
3 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,13 @@
// RUN: clang -grsimple -verify %s
#include <Foundation/NSString.h>
void f1() {
NSString *aString;
unsigned i = [aString length]; // expected-warning {{Receiver in message expression is an uninitialized value}}
}
void f2() {
NSString *aString = nil;
unsigned i = [aString length]; // no-warning
}

View File

@ -5,7 +5,7 @@ TESTDIRS := CodeGen Lexer Preprocessor Parser Sema Analysis Serialization
# Only run rewriter tests on darwin.
ifeq ($(OS),Darwin)
TESTDIRS += Rewriter
TESTDIRS += Rewriter Analysis-Apple
endif
all::

View File

@ -5,7 +5,7 @@ TESTDIRS = CodeGen Lexer Preprocessor Parser Sema Analysis Serialization
# Only run rewriter tests on darwin.
ifeq ($(OS),Darwin)
TESTDIRS += Rewriter
TESTDIRS += Rewriter Analysis-Apple
endif
ifdef VERBOSE