[PATCH] D125379: [analyzer][solver] Do not negate unsigned ranges

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 08:22:51 PDT 2022


martong abandoned this revision.
martong added inline comments.


================
Comment at: clang/test/Analysis/constraint_manager_negate_difference.c:125-130
 void negate_unsigned_mid(unsigned m, unsigned n) {
   if (m - n == UINT_MID) {
-    clang_analyzer_eval(n - m == UINT_MID); // expected-warning{{TRUE}}
-    clang_analyzer_eval(n - m != UINT_MID); // expected-warning{{FALSE}}
+    clang_analyzer_eval(n - m == UINT_MID); // expected-warning{{TRUE}} expected-warning{{FALSE}}
+    clang_analyzer_eval(n - m != UINT_MID); // expected-warning{{FALSE}} expected-warning{{TRUE}}
   }
 }
----------------
Actually, this test case was correct, because UINT_MID is a special value and for that
```
_Static_assert(UINT_MID == -UINT_MID, "");
```
holds.
So, this patch is meaningless.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125379/new/

https://reviews.llvm.org/D125379



More information about the cfe-commits mailing list