2007-10-11 08:18:28 +08:00
|
|
|
/* RUN: clang %s -std=c89 -pedantic -fsyntax-only -verify
|
2007-08-27 12:29:41 +08:00
|
|
|
*/
|
2007-08-29 00:54:00 +08:00
|
|
|
void test1() {
|
2007-08-27 12:29:41 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
i = i + 1;
|
|
|
|
int j; /* expected-warning {{mixing declarations and code}} */
|
|
|
|
}
|
|
|
|
{
|
|
|
|
__extension__ int i;
|
|
|
|
i = i + 1;
|
|
|
|
int j; /* expected-warning {{mixing declarations and code}} */
|
|
|
|
}
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
i = i + 1;
|
|
|
|
__extension__ int j; /* expected-warning {{mixing declarations and code}} */
|
|
|
|
}
|
|
|
|
}
|
2007-08-29 00:40:32 +08:00
|
|
|
|
2007-08-29 00:54:00 +08:00
|
|
|
long long test2; /* expected-warning {{extension}} */
|
2007-08-29 00:40:32 +08:00
|
|
|
|
2007-08-29 00:54:00 +08:00
|
|
|
|
|
|
|
void test3(int i) {
|
|
|
|
int A[i]; /* expected-warning {{variable length array}} */
|
|
|
|
}
|
2007-08-30 06:00:19 +08:00
|
|
|
|
|
|
|
int test4 = 0LL; /* expected-warning {{long long}} */
|
|
|
|
|
2008-02-11 07:08:00 +08:00
|
|
|
/* PR1999 */
|
|
|
|
void test5(register);
|
|
|
|
|
2008-02-16 02:02:59 +08:00
|
|
|
/* PR2041 */
|
|
|
|
int *restrict;
|
2008-02-19 14:46:10 +08:00
|
|
|
int *__restrict; /* expected-error {{expected identifier}} */
|
2008-04-05 13:52:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* Implicit int, always ok */
|
|
|
|
foo() {}
|
|
|
|
|
|
|
|
|