From: Anna Zaks Date: Wed, 16 May 2012 18:46:25 +0000 (+0000) Subject: [analyzer] Revert a regression committed in r156920. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=533718fb27f87a25bf9f6fdd69df4a4ce8b783a6;p=clang [analyzer] Revert a regression committed in r156920. 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 --- diff --git a/test/Analysis/string.c b/test/Analysis/string.c index 4e9d51f4c1..d6b482b015 100644 --- a/test/Analysis/string.c +++ b/test/Analysis/string.c @@ -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 }