aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/vla-sizeof1.c
blob: ed7f5d4ee8f6fd6ec000d41ca24c3ecbf24e0c64 (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 int foo(int x)
{
	T a[(x,N)];

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

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