PR tree-optimization/86741 - ICE in -Warray-bounds indexing into an object of incompl...
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-33.c
blob28f14b4722cb6a5dcf5e80c61860ea38f2653f5d
1 /* PR tree-optimization/86741 - ICE in -Warray-bounds indexing into
2 an object of incomplete type
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 struct S
8 int s;
9 };
11 void f (void);
13 void test_void (void)
15 extern void v;
16 struct S *b = (struct S*)&v;
17 if (b->s)
18 f ();
21 void test_incomplete_enum (void)
23 extern enum E e;
24 struct S *b = (struct S*)&e;
25 if (b->s)
26 f ();
29 void test_func (void)
31 struct S *b = (struct S*)&f;
32 if (b->s)
33 f ();
36 /* { dg-prune-output "taking address of expression of type .void." } */