aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/nested-vla-3.c
blob: d2ba04adab89ac0add46b5e82602ddb032a7f6b2 (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
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* { dg-require-effective-target trampolines } */


int main()
{
	int n = 1;

	char tmp[2] = { 0 };
	char (*bar(void))[++n] { return &tmp; }

	if (2 != n)
		__builtin_abort();

	if (2 != sizeof(*bar()))
		__builtin_abort();

	n = 1;

	char (*(*bar2)(void))[++n] = bar;

	if (2 != n)
		__builtin_abort();

	if (2 != sizeof(*(*bar2)()))
		__builtin_abort();

}