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

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

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

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