diff options
-rw-r--r-- | test/Analysis/string.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 } |