aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/warn-null.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/warn-null.c')
-rw-r--r--test/Sema/warn-null.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Sema/warn-null.c b/test/Sema/warn-null.c
index 28fb6a5f691c..3bf2aedc445f 100644
--- a/test/Sema/warn-null.c
+++ b/test/Sema/warn-null.c
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 %s -verify
+#define SOME_ADDR (unsigned long long)0
+
// PR10837: Warn if a non-pointer-typed expression is folded to a null pointer
int *p = 0;
int *q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
@@ -8,4 +10,5 @@ void f() {
p = 0;
q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
r = 1 - 1; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
+ p = SOME_ADDR; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
}