forked from OSchip/llvm-project
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:
parent
ea7cb37a5c
commit
a1d9ed137a
|
@ -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
|
||||
}
|
|
@ -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::
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue