From: Ted Kremenek Date: Mon, 14 Apr 2008 17:40:10 +0000 (+0000) Subject: Updated test cases so that they do not emit warnings for dead stores. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=896436ecd0c024431a1d11e2bb539d85a0dc8daa;p=clang Updated test cases so that they do not emit warnings for dead stores. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49659 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis-Apple/CFDate.c b/test/Analysis-Apple/CFDate.c index ea15994e4d..58b568b424 100644 --- a/test/Analysis-Apple/CFDate.c +++ b/test/Analysis-Apple/CFDate.c @@ -7,7 +7,7 @@ CFAbsoluteTime f1() { 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; diff --git a/test/Analysis-Apple/uninit-msg-expr.m b/test/Analysis-Apple/uninit-msg-expr.m index b7ff7902b0..f054d7ab6c 100644 --- a/test/Analysis-Apple/uninit-msg-expr.m +++ b/test/Analysis-Apple/uninit-msg-expr.m @@ -3,14 +3,14 @@ #include #include -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() {