[PATCH] D103440: [WIP][analyzer] Introduce range-based reasoning for addition operator
Valeriy Savchenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 24 23:48:26 PDT 2021
vsavchenko added inline comments.
================
Comment at: clang/test/Analysis/constant-folding.c:264-266
+ if (a == UINT_MAX && b == UINT_MAX) {
+ clang_analyzer_eval((a + b) == UINT_MAX - 1); // expected-warning{{TRUE}}
+ }
----------------
We need a test with ranges and unsigned overflow
================
Comment at: clang/test/Analysis/constant-folding.c:330
+ clang_analyzer_eval((c + d) == INT_MAX - 22); // expected-warning{{FALSE}}
+ }
+}
----------------
manas wrote:
> vsavchenko wrote:
> > I don't see the cases where we overflow on both ends and the case where we overflow on one end, but `Min > Max`.
> My bad. I thought I added both overflows one. I will add them now.
This comment is marked as "Done", but I still don't these cases.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103440/new/
https://reviews.llvm.org/D103440
More information about the cfe-commits
mailing list