[cfe-commits] r90277 - /cfe/trunk/test/Analysis/dead-stores.c

Ted Kremenek kremenek at apple.com
Tue Dec 1 15:04:14 PST 2009


Author: kremenek
Date: Tue Dec  1 17:04:14 2009
New Revision: 90277

URL: http://llvm.org/viewvc/llvm-project?rev=90277&view=rev
Log:
Added dead-stores test cases that involve the use of blocks.

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

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

==============================================================================
--- cfe/trunk/test/Analysis/dead-stores.c (original)
+++ cfe/trunk/test/Analysis/dead-stores.c Tue Dec  1 17:04:14 2009
@@ -370,3 +370,39 @@
      f23_aux("I did too use it!\n");
   }();  
 }
+
+void f24_A(int y) {
+  // FIXME: One day this should be reported as dead since 'z = x + y' is dead.
+  int x = (y > 2); // no-warning
+  ^ {
+    int z = x + y; // FIXME: Eventually this should be reported as a dead store.
+  }();  
+}
+
+void f24_B(int y) {
+  // FIXME: One day this should be reported as dead since 'x' is just overwritten.
+  __block int x = (y > 2); // no-warning
+  ^{
+    // FIXME: This should eventually be a dead store since it is never read either.
+    x = 5; // no-warning
+  }();
+}
+
+int f24_C(int y) {
+  // FIXME: One day this should be reported as dead since 'x' is just overwritten.
+  __block int x = (y > 2); // no-warning
+  ^{ 
+    x = 5; // no-warning
+  }();
+  return x;
+}
+
+int f24_D(int y) {
+  __block int x = (y > 2); // no-warning
+  ^{ 
+    if (y > 4)
+      x = 5; // no-warning
+  }();
+  return x;
+}
+





More information about the cfe-commits mailing list