diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-27 04:29:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-27 04:29:41 +0000 |
commit | c30ebfbf23d6a471146e3c68c2cf7f170b7e55dc (patch) | |
tree | e8d967e162abe82ae33936c697b31cbf0035755d /test/Sema/c89.c | |
parent | 77878cc5aa6ad01fc0c91bac1a61819dbf3bf691 (diff) |
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
Diffstat (limited to 'test/Sema/c89.c')
-rw-r--r-- | test/Sema/c89.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Sema/c89.c b/test/Sema/c89.c new file mode 100644 index 0000000000..57085db644 --- /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}} */ + } +} |