diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/Analysis/array-struct.c | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/Analysis/array-struct.c')
-rw-r--r-- | test/Analysis/array-struct.c | 16 |
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 +} + + |