From: Ted Kremenek Date: Tue, 20 Nov 2007 03:03:00 +0000 (+0000) Subject: Added another test case for the Dead Stores checker that tests that X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74c43a0967d07572dd6907776d91cdb2b2e7179a;p=clang Added another test case for the Dead Stores checker that tests that block-level expressions are evaluated the same as regular expressions. Test case provided by Nuno Lopes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44247 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/dead-stores.c b/test/Sema/dead-stores.c index dc4fe586f2..54e89ea5c3 100644 --- a/test/Sema/dead-stores.c +++ b/test/Sema/dead-stores.c @@ -11,3 +11,11 @@ void a(void *b) { char *d = b+1; // expected-warning {{value stored to variable is never used}} printf("%s", c); } + +void z() { + int r; + if ((r = f()) != 0) { // no-warning + int y = r; // no-warning + printf("the error is: %d\n", y); + } +}