From 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 27 May 2015 18:47:56 +0000 Subject: Vendor import of clang trunk r238337: https://llvm.org/svn/llvm-project/cfe/trunk@238337 --- test/Analysis/array-struct.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/Analysis/array-struct.c') 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 +} + + -- cgit v1.1