Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/out-of-bounds-diagram-pr111441.c

raw
1 /* Verify we don't ICE generating out-of-bounds diagram. */
2
3 /* { dg-additional-options "-fdiagnostics-text-art-charset=unicode" } */
4
5 #include "analyzer-decls.h"
6
7 void f() {
8 int a[] = {3, 0, 3, 3, 0, 3, 40883};
9 for (int c = 6; c; c--) {
10 __analyzer_describe(0, a[c]);
11 90 > c || a[c]; /* { dg-bogus "stack-based buffer over-read" } */
12 }
13 }
14 int main() { f(); }
15
16 /* We don't care about the exact diagram, just that we don't ICE. */
17
18 /* { dg-allow-blank-lines-in-output 1 } */
19 /* { dg-prune-output ".*" } */