[clang] [NFC][analyzer] Add regression tests from bisection commits to the CSA's test suite (PR #241058)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 11 02:45:59 PST 2026


================
@@ -260,3 +260,17 @@ void onlyLoopConditions(int arg) {
 
   clang_analyzer_dump(i); // expected-warning {{1}} expected-warning {{2}} expected-warning {{3}} expected-warning {{4}}
 }
+
+void GH20099(const unsigned char n) {
+
+  int buf[2][4] = {{0,0,0,0},{0,0,0,0}};
+  unsigned char j,k,l,x;
+
+  for (l = n - 1; l >= 1; l--)
+    x = 0;
+
+  for (j = n - 1; j >= 1; j--) {
+    for (k = 0; k <= j - 1; k++)
+      x = buf[k][j]; // no-warning
----------------
NagyDonat wrote:

> it's still not clear to me why it was a FP.

Out of context it is unclear, but if one scrolls up in this test file (which demonstrates the loop assumption handling), it should be reasonably clear.

https://github.com/llvm/llvm-project/pull/241058


More information about the cfe-commits mailing list