xref: /illumos-gate/usr/src/tools/smatch/src/validation/vla-sizeof4.c (revision 8226594fdd4479be135127f43632f1f995074654)
1 #define N 2
2 #define T int
3 
4 static unsigned long foo(int x, int y)
5 {
6 	T a[x][y];
7 
8 	return sizeof(a) == (x * (y * sizeof(T)));
9 }
10 
11 /*
12  * check-name: vla-sizeof var X var
13  * check-command: test-linearize -Wvla $file
14  *
15  * check-output-ignore
16  * check-output-contains: ret\\..*\\$1
17  *
18  * check-error-start
19 vla-sizeof4.c:6:16: warning: Variable length array is used.
20 vla-sizeof4.c:6:13: warning: Variable length array is used.
21  * check-error-end
22  */
23