aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/exprs.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/exprs.c')
-rw-r--r--test/Sema/exprs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c
index e6cfa5fbe3..b2f92e2c01 100644
--- a/test/Sema/exprs.c
+++ b/test/Sema/exprs.c
@@ -114,3 +114,11 @@ test15_t test15(void) {
// rdar://7446395
void test16(float x) { x == ((void*) 0); } // expected-error {{invalid operands to binary expression}}
+// PR6004
+void test17(int x) {
+ x = x / 0; // expected-warning {{division by zero is undefined}}
+ x = x % 0; // expected-warning {{remainder by zero is undefined}}
+ x /= 0; // expected-warning {{division by zero is undefined}}
+ x %= 0; // expected-warning {{remainder by zero is undefined}}
+}
+