[cfe-commits] r49659 - in /cfe/trunk/test/Analysis-Apple: CFDate.c uninit-msg-expr.m

Ted Kremenek kremenek at apple.com
Mon Apr 14 10:40:11 PDT 2008


Author: kremenek
Date: Mon Apr 14 12:40:10 2008
New Revision: 49659

URL: http://llvm.org/viewvc/llvm-project?rev=49659&view=rev
Log:
Updated test cases so that they do not emit warnings for dead stores.

Modified:
    cfe/trunk/test/Analysis-Apple/CFDate.c
    cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m

Modified: cfe/trunk/test/Analysis-Apple/CFDate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis-Apple/CFDate.c?rev=49659&r1=49658&r2=49659&view=diff

==============================================================================
--- cfe/trunk/test/Analysis-Apple/CFDate.c (original)
+++ cfe/trunk/test/Analysis-Apple/CFDate.c Mon Apr 14 12:40:10 2008
@@ -7,7 +7,7 @@
   CFDateRef date = CFDateCreate(NULL, t);
   CFRetain(date);
   CFRelease(date);
-  t = CFDateGetAbsoluteTime(date);
+  CFDateGetAbsoluteTime(date);
   CFRelease(date);
   t = CFDateGetAbsoluteTime(date);   // expected-warning{{Reference-counted object is used after it is released.}}
   return t;

Modified: 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=49659&r1=49658&r2=49659&view=diff

==============================================================================
--- cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m (original)
+++ cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m Mon Apr 14 12:40:10 2008
@@ -3,14 +3,14 @@
 #include <Foundation/NSString.h>
 #include <Foundation/NSArray.h>
 
-void f1() {
+unsigned f1() {
   NSString *aString;
-  unsigned i = [aString length]; // expected-warning {{Receiver in message expression is an uninitialized value}}
+  return [aString length]; // expected-warning {{Receiver in message expression is an uninitialized value}}
 }
 
-void f2() {
+unsigned f2() {
   NSString *aString = nil;
-  unsigned i = [aString length]; // no-warning
+  return [aString length]; // no-warning
 }
 
 void f3() {





More information about the cfe-commits mailing list