aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-labels-1.c
blob: 0d9b663c7eba3d2db2c34936f7cdff32d627b632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Tests for labels before declarations and at ends of compound statements.  */
/* { dg-do run } */
/* { dg-options "-std=c23 -pedantic-errors" } */

int f(int x) 
{ 
	goto b;
	a: int i = 2 * x;
	aa: int u = 0; int v = 0;
           goto c;
	b: goto a;
	{ i *= 3; c: }
	return i + u + v;
        d:
}

int main(void)
{
	if (2 != f(1))
		__builtin_abort();

	return 0;
}