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