]> granicus.if.org Git - clang/commitdiff
Added another test case for the Dead Stores checker that tests that
authorTed Kremenek <kremenek@apple.com>
Tue, 20 Nov 2007 03:03:00 +0000 (03:03 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 20 Nov 2007 03:03:00 +0000 (03:03 +0000)
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

test/Sema/dead-stores.c

index dc4fe586f27891ce463f1833c3e1aa90b08425e7..54e89ea5c3bfd06b2a4107f0ecee670941469ff3 100644 (file)
@@ -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);
+       }
+}