summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-27 04:29:41 +0000
committerChris Lattner <sabre@nondot.org>2007-08-27 04:29:41 +0000
commitd864daf5c6b96ec3f1ebc3e6d5ad43cc452fe407 (patch)
tree8505d5d42dbad08fa6b76c76e75c83c8dd5063d3 /clang/test
parent808eb8fe88f968b338e5cf86ce0922ac4c485e56 (diff)
downloadbcm5719-llvm-d864daf5c6b96ec3f1ebc3e6d5ad43cc452fe407.tar.gz
bcm5719-llvm-d864daf5c6b96ec3f1ebc3e6d5ad43cc452fe407.zip
extwarn about decls intermixed with code in c89 mode.
llvm-svn: 41477
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/c89.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Sema/c89.c b/clang/test/Sema/c89.c
new file mode 100644
index 00000000000..57085db6446
--- /dev/null
+++ b/clang/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}} */
+ }
+}
OpenPOWER on IntegriCloud