aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vla-stexp-1.c
blob: baaad36eb12df117ec82e076213d0daebec909af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR29970*/
/* { dg-do run } */
/* { dg-options "-Wall -O0" } */
/* { dg-require-effective-target alloca } */

int foo(void)
{
	int n = 0;
	return sizeof(*({ n = 10; struct foo { int x[n]; } x; &x; }));
}


int main()
{
	if (sizeof(struct foo { int x[10]; }) != foo())
		__builtin_abort();

	return 0;
}