[cfe-commits] r48844 - in /cfe/trunk/test: Analysis-Apple/ Analysis-Apple/uninit-msg-expr.m Makefile Makefile.parallel
Ted Kremenek
kremenek at apple.com
Wed Mar 26 14:51:44 PDT 2008
Author: kremenek
Date: Wed Mar 26 16:51:44 2008
New Revision: 48844
URL: http://llvm.org/viewvc/llvm-project?rev=48844&view=rev
Log:
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.
Added:
cfe/trunk/test/Analysis-Apple/
cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m
Modified:
cfe/trunk/test/Makefile
cfe/trunk/test/Makefile.parallel
Added: cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m?rev=48844&view=auto
==============================================================================
--- cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m (added)
+++ cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m Wed Mar 26 16:51:44 2008
@@ -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
+}
Modified: cfe/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile?rev=48844&r1=48843&r2=48844&view=diff
==============================================================================
--- cfe/trunk/test/Makefile (original)
+++ cfe/trunk/test/Makefile Wed Mar 26 16:51:44 2008
@@ -5,7 +5,7 @@
# Only run rewriter tests on darwin.
ifeq ($(OS),Darwin)
-TESTDIRS += Rewriter
+TESTDIRS += Rewriter Analysis-Apple
endif
all::
Modified: cfe/trunk/test/Makefile.parallel
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile.parallel?rev=48844&r1=48843&r2=48844&view=diff
==============================================================================
--- cfe/trunk/test/Makefile.parallel (original)
+++ cfe/trunk/test/Makefile.parallel Wed Mar 26 16:51:44 2008
@@ -5,7 +5,7 @@
# Only run rewriter tests on darwin.
ifeq ($(OS),Darwin)
-TESTDIRS += Rewriter
+TESTDIRS += Rewriter Analysis-Apple
endif
ifdef VERBOSE
More information about the cfe-commits
mailing list