]> granicus.if.org Git - clang/commitdiff
[analyzer] Revert a regression committed in r156920.
authorAnna Zaks <ganna@apple.com>
Wed, 16 May 2012 18:46:25 +0000 (18:46 +0000)
committerAnna Zaks <ganna@apple.com>
Wed, 16 May 2012 18:46:25 +0000 (18:46 +0000)
This breaks the build with -triple i386-apple-darwin9.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156932 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/string.c

index 4e9d51f4c1c9521bf5750cc632f6728a8ca73ca0..d6b482b015a2275dafbe86fe89f3bf4ba77a2e5b 100644 (file)
@@ -1062,12 +1062,11 @@ void PR12206(const char *x) {
 
   // 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
 }