blob: 68614f2d6b98ce5d397f9181a579da9cdd4dd6a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* PR29970 */
/* { dg-do run } */
/* { dg-options "-Wunused-variable" } */
/* { dg-require-effective-target alloca } */
int foo2a(void) // should not ICE
{
return ({ int n = 20; struct { int x[n];} x; x.x[12] = 1; sizeof(x); });
}
int foo2b(void) // should not ICE
{
return sizeof *({ int n = 20; struct { int x[n];} x; x.x[12] = 1; &x; });
}
int main()
{
if (sizeof(struct { int x[20]; }) != foo2a())
__builtin_abort();
if (sizeof(struct { int x[20]; }) != foo2b())
__builtin_abort();
return 0;
}
|