summaryrefslogtreecommitdiffstats
path: root/test/Analysis/array-struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/array-struct.c')
-rw-r--r--test/Analysis/array-struct.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c
index c22f979..28e09ad 100644
--- a/test/Analysis/array-struct.c
+++ b/test/Analysis/array-struct.c
@@ -183,3 +183,19 @@ int offset_of_data_array(void)
return ((char *)&(((struct s*)0)->data_array)) - ((char *)0); // no-warning
}
+int testPointerArithmeticOnVoid(void *bytes) {
+ int p = 0;
+ if (&bytes[0] == &bytes[1])
+ return 6/p; // no-warning
+ return 0;
+}
+
+int testRValueArraySubscriptExpr(void *bytes) {
+ int *p = (int*)&bytes[0];
+ *p = 0;
+ if (*(int*)&bytes[0] == 0)
+ return 0;
+ return 5/(*p); // no-warning
+}
+
+
OpenPOWER on IntegriCloud