diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-12 21:23:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-12 21:23:57 +0000 |
commit | faa5417264d4fd3ec923b72f18a78c95a6ae143d (patch) | |
tree | de8e25e87dd8ae199eac2b8c4fb800d793bfb7b0 /clang/test/Sema/i-c-e.c | |
parent | 20aee9b9147fa2dcd9e50c0f84d15c87844db773 (diff) | |
download | bcm5719-llvm-faa5417264d4fd3ec923b72f18a78c95a6ae143d.tar.gz bcm5719-llvm-faa5417264d4fd3ec923b72f18a78c95a6ae143d.zip |
implement PR6004, warning about divide and remainder by zero.
llvm-svn: 93256
Diffstat (limited to 'clang/test/Sema/i-c-e.c')
-rw-r--r-- | clang/test/Sema/i-c-e.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/Sema/i-c-e.c b/clang/test/Sema/i-c-e.c index c561fe01c6e..97d9f43cfba 100644 --- a/clang/test/Sema/i-c-e.c +++ b/clang/test/Sema/i-c-e.c @@ -57,8 +57,9 @@ int comma3[(1,2)]; // expected-warning {{size of static array must be an integer // Pointer + __builtin_constant_p char pbcp[__builtin_constant_p(4) ? (intptr_t)&expr : 0]; // expected-error {{variable length array declaration not allowed at file scope}} -int illegaldiv1[1 || 1/0]; -int illegaldiv2[1/0]; // expected-error {{variable length array declaration not allowed at file scope}} +int illegaldiv1[1 || 1/0]; // expected-warning {{division by zero is undefined}} +int illegaldiv2[1/0]; // expected-error {{variable length array declaration not allowed at file scope}} \ + // expected-warning {{division by zero is undefined}} int illegaldiv3[INT_MIN / -1]; // expected-error {{variable length array declaration not allowed at file scope}} int chooseexpr[__builtin_choose_expr(1, 1, expr)]; |