scope-check.c revision 1b6823d48da16b64cfb13d818860a21472183ca0
1// RUN: clang-cc -fsyntax-only -verify %s 2 3int test1(int x) { 4 goto L; // expected-error{{illegal jump}} 5 int a[x]; 6 L: 7 return sizeof a; 8} 9 10int test2(int x) { 11 goto L; // expected-error{{illegal jump}} 12 typedef int a[x]; 13 L: 14 return sizeof(a); 15} 16 17void test3clean(int*); 18 19int test3() { 20 goto L; // expected-error{{illegal jump}} 21 int a __attribute((cleanup(test3clean))); 22 L: 23 return a; 24} 25 26int test4(int x) { 27 goto L; // expected-error{{illegal jump}} 28 int a[x]; 29 test4(x); 30 L: 31 return sizeof a; 32} 33