blob: a5855b21d00340f42f4359a382715b363e7153d8 [file] [log] [blame]
Chris Lattner3ea3b662007-08-27 04:29:41 +00001/* RUN: clang %s -std=c89 -pedantic -parse-ast-check
2 */
Chris Lattner47958f62007-08-28 16:54:00 +00003void test1() {
Chris Lattner3ea3b662007-08-27 04:29:41 +00004 {
5 int i;
6 i = i + 1;
7 int j; /* expected-warning {{mixing declarations and code}} */
8 }
9 {
10 __extension__ int i;
11 i = i + 1;
12 int j; /* expected-warning {{mixing declarations and code}} */
13 }
14 {
15 int i;
16 i = i + 1;
17 __extension__ int j; /* expected-warning {{mixing declarations and code}} */
18 }
19}
Chris Lattner11f20f92007-08-28 16:40:32 +000020
Chris Lattner47958f62007-08-28 16:54:00 +000021long long test2; /* expected-warning {{extension}} */
Chris Lattner11f20f92007-08-28 16:40:32 +000022
Chris Lattner47958f62007-08-28 16:54:00 +000023
24void test3(int i) {
25 int A[i]; /* expected-warning {{variable length array}} */
26}