extwarn about decls intermixed with code in c89 mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41477 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/c89.c b/test/Sema/c89.c
new file mode 100644
index 0000000..57085db
--- /dev/null
+++ b/test/Sema/c89.c
@@ -0,0 +1,19 @@
+/* RUN: clang %s -std=c89 -pedantic -parse-ast-check
+ */
+void foo() {
+ {
+ 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}} */
+ }
+}