Debian Codegraph @

gcc/testsuite/gcc.dg/analyzer/out-of-bounds-diagram-pr113222.c

raw
1 /* Verify that we don't ICE when generating an out-of-bounds diagram
2 when the size of an array is unknown. */
3
4 /* { dg-do compile } */
5 /* { dg-additional-options "-fdiagnostics-text-art-charset=unicode" } */
6
7 #include <stdint.h>
8
9 struct sched_class
10 {
11 int64_t f;
12 };
13 extern struct sched_class __end_sched_classes[];
14
15 int
16 test ()
17 {
18 const struct sched_class* class = ((__end_sched_classes - 1));
19 return class->f; /* { dg-warning "buffer under-read" } */
20 }
21
22 /* We don't care about the content of the diagram, just that we don't
23 ICE creating it. */
24
25 /* { dg-allow-blank-lines-in-output 1 } */
26 /* { dg-prune-output ".*" } */