aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/label-stmt-dropped.c
blob: 74e0f2e63aff9b4a63f6aa65ee0f001f7dff4694 (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
/*
 * Verify that the statement following an unused label
 * is not discarded with the label.
 */

static int bad(int a, int b)
{
	int r = 0;

start:
	r += a;
	r += b;

	if (!r)
		goto start;
	return r;
}

/*
 * check-name: label-stmt-dropped
 * check-command: test-linearize $file
 *
 * check-output-ignore
 * check-output-contains: add
 * check-output-contains: %arg1
 */