aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/vla-sizeof4.c
blob: e7478613de9130b386cb4354ef1a924aa1011e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define N 2
#define T int

static unsigned long foo(int x, int y)
{
	T a[x][y];

	return sizeof(a) == (x * (y * sizeof(T)));
}

/*
 * check-name: vla-sizeof var X var
 * check-command: test-linearize -Wvla $file
 *
 * check-output-ignore
 * check-output-contains: ret\\..*\\$1
 *
 * check-error-start
vla-sizeof4.c:6:16: warning: Variable length array is used.
vla-sizeof4.c:6:13: warning: Variable length array is used.
 * check-error-end
 */