blob: 4c89e82ba2d53483ee6326bce84b12f90cab893a [file] [log] [blame]
Chris Lattner5e4c75f2007-10-11 00:18:28 +00001/* RUN: clang %s -std=c89 -pedantic -fsyntax-only -verify
Chris Lattnerd864daf2007-08-27 04:29:41 +00002 */
Chris Lattner35da3e22007-08-28 16:54:00 +00003void test1() {
Chris Lattnerd864daf2007-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 Lattnerf2c338b2007-08-28 16:40:32 +000020
Chris Lattner35da3e22007-08-28 16:54:00 +000021long long test2; /* expected-warning {{extension}} */
Chris Lattnerf2c338b2007-08-28 16:40:32 +000022
Chris Lattner35da3e22007-08-28 16:54:00 +000023
24void test3(int i) {
25 int A[i]; /* expected-warning {{variable length array}} */
26}
Neil Boothac582c52007-08-29 22:00:19 +000027
28int test4 = 0LL; /* expected-warning {{long long}} */
29
Chris Lattner7b8134f2008-02-10 23:08:00 +000030/* PR1999 */
31void test5(register);
32
Chris Lattner287c7342008-02-15 18:02:59 +000033/* PR2041 */
34int *restrict;
35