[cfe-commits] r156932 - /cfe/trunk/test/Analysis/string.c

Anna Zaks ganna at apple.com
Wed May 16 11:46:25 PDT 2012


Author: zaks
Date: Wed May 16 13:46:25 2012
New Revision: 156932

URL: http://llvm.org/viewvc/llvm-project?rev=156932&view=rev
Log:
[analyzer] Revert a regression committed in r156920.

This breaks the build with -triple i386-apple-darwin9.

Modified:
    cfe/trunk/test/Analysis/string.c

Modified: cfe/trunk/test/Analysis/string.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/string.c?rev=156932&r1=156931&r2=156932&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/string.c (original)
+++ cfe/trunk/test/Analysis/string.c Wed May 16 13:46:25 2012
@@ -1062,12 +1062,11 @@
 
   // Constrain the length of x.
   if (strlen(x) != value) return;
-
   // Test relational operators.
-  clang_analyzer_eval(strlen(x) >= 2); // expected-warning{{TRUE}}
-  clang_analyzer_eval(2 <= strlen(x)); // expected-warning{{TRUE}}
+  if (strlen(x) < 2) { (void)*(char*)0; } // no-warning
+  if (2 > strlen(x)) { (void)*(char*)0; } // no-warning
 
   // Test equality operators.
-  clang_analyzer_eval(strlen(x) != 1); // expected-warning{{TRUE}}
-  clang_analyzer_eval(1 != strlen(x)); // expected-warning{{TRUE}}
+  if (strlen(x) == 1) { (void)*(char*)0; } // no-warning
+  if (1 == strlen(x)) { (void)*(char*)0; } // no-warning
 }





More information about the cfe-commits mailing list