[cfe-commits] r44247 - /cfe/trunk/test/Sema/dead-stores.c

Ted Kremenek kremenek at apple.com
Mon Nov 19 19:03:02 PST 2007


Author: kremenek
Date: Mon Nov 19 21:03:00 2007
New Revision: 44247

URL: http://llvm.org/viewvc/llvm-project?rev=44247&view=rev
Log:
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.

Modified:
    cfe/trunk/test/Sema/dead-stores.c

Modified: cfe/trunk/test/Sema/dead-stores.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/dead-stores.c?rev=44247&r1=44246&r2=44247&view=diff

==============================================================================
--- cfe/trunk/test/Sema/dead-stores.c (original)
+++ cfe/trunk/test/Sema/dead-stores.c Mon Nov 19 21:03:00 2007
@@ -11,3 +11,11 @@
  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);
+	}
+}





More information about the cfe-commits mailing list