aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vla-stexp-9.c
blob: 3593a790785bbfefc44145a44448601b9f898c98 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* PR91038 */
/* { dg-do run } */
/* { dg-options "-O2 -Wunused-variable" } */



void foo(void)
{
	if (2 * sizeof(int) != sizeof((*({ int N = 2; int (*x)[9][N] = 0; x; })[1])))
		__builtin_abort();
}

void bar(void)
{
	if (2 * sizeof(int) != sizeof((*({ int N = 2; int (*x)[9][N] = 0; x; })[0])))
		__builtin_abort();
}

void bar0(void)
{
	if (2 * 9 *  sizeof(int) != sizeof((*({ int N = 2; int (*x)[9][N] = 0; x; }))))
		__builtin_abort();
}

void bar11(void)
{
	sizeof(*((*({ int N = 2; int (*x)[9][N] = 0; x; }) + 0)));
}

void bar12(void)
{
	if (2 * sizeof(int) != sizeof(*((*({ int N = 2; int (*x)[9][N] = 0; x; })    ))))
		__builtin_abort();
}

void bar1(void)
{
	if (2 * sizeof(int) != sizeof(*((*({ int N = 2; int (*x)[9][N] = 0; x; }) + 0))))
		__builtin_abort();
}




int main()
{
	foo();
	bar0();
	bar12();
	bar1();
	bar();
}