summaryrefslogtreecommitdiffstats
path: root/test/Sema/exprs.c
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
commita3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824 (patch)
treea6082d4d1d1e9ddaea09a6a04bb4a47da95d642d /test/Sema/exprs.c
parentbb1e3bc1e0be2b8f891db46457a8943451bf4d8b (diff)
downloadFreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.zip
FreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.tar.gz
Update clang to r93512.
Diffstat (limited to 'test/Sema/exprs.c')
-rw-r--r--test/Sema/exprs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c
index e6cfa5f..9acc63f 100644
--- a/test/Sema/exprs.c
+++ b/test/Sema/exprs.c
@@ -87,6 +87,10 @@ int test12(const char *X) {
return X == "foo"; // expected-warning {{comparison against a string literal is unspecified}}
}
+int test12b(const char *X) {
+ return sizeof(X == "foo"); // no-warning
+}
+
// rdar://6719156
void test13(
void (^P)()) { // expected-error {{blocks support disabled - compile with -fblocks}}
@@ -114,3 +118,13 @@ 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}}
+
+ x = sizeof(x/0); // no warning.
+}
+
OpenPOWER on IntegriCloud