]> granicus.if.org Git - clang/commitdiff
Added test case inspired by <rdar://6268365>: recover path-sensitivity after compound...
authorTed Kremenek <kremenek@apple.com>
Mon, 20 Oct 2008 23:14:31 +0000 (23:14 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 20 Oct 2008 23:14:31 +0000 (23:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57852 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/misc-ps.m

index ab00bd8c341352a90b2edd12bd0b000b50080f3f..956d0dfb595a0ce8d19c412b542667f410782c34 100644 (file)
 //  http://llvm.org/bugs/show_bug.cgi?id=2796
 
 unsigned foo(unsigned x) { return __alignof__((x)) + sizeof(x); }
+
+// Improvement to path-sensitivity involving compound assignments.
+//  Addresses false positive in <rdar://problem/6268365>
+//
+
+unsigned r6268365Aux();
+
+void r6268365() {
+  unsigned x = 0;
+  x &= r6268365Aux();
+  unsigned j = 0;
+    
+  if (x == 0) ++j;
+  if (x == 0) x = x / j; // no-warning
+}
+