Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/Warray-bounds-33.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
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" } */ | |
5 | |
6 struct S | |
7 { | |
8 int s; | |
9 }; | |
10 | |
11 void f (void); | |
12 | |
13 void test_void (void) | |
14 { | |
15 extern void v; | |
16 struct S *b = (struct S*)&v; | |
17 if (b->s) | |
18 f (); | |
19 } | |
20 | |
21 void test_incomplete_enum (void) | |
22 { | |
23 extern enum E e; | |
24 struct S *b = (struct S*)&e; | |
25 if (b->s) | |
26 f (); | |
27 } | |
28 | |
29 void test_func (void) | |
30 { | |
31 struct S *b = (struct S*)&f; | |
32 if (b->s) | |
33 f (); | |
34 } | |
35 | |
36 /* { dg-prune-output "taking address of expression of type .void." } */ |