Message ID | 20200318141733.8092-1-dmalcolm@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed] analyzer: add test coverage for fixed ICE [PR94047] | expand |
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94047.c b/gcc/testsuite/gcc.dg/analyzer/pr94047.c new file mode 100644 index 00000000000..d989a254c9e --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr94047.c @@ -0,0 +1,23 @@ +/* { dg-additional-options "-Wno-analyzer-too-complex" } */ +/* TODO: the above ought not to be necessary, but currently is due to a + state explosion within the for loop. */ + +typedef struct list +{ + struct list *next; +} tlist; + +void +bar (struct list *l) +{ + l->next = l->next->next; +} + +void +foo (void) +{ + struct list l; + tlist t = l; + for (;;) + bar (&t); +}