diff options
author | Anna Zaks <ganna@apple.com> | 2016-01-06 00:32:49 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2016-01-06 00:32:49 +0000 |
commit | c9f16fe48c40e7683d0029b65090d0007414d7af (patch) | |
tree | 658a79a335e29d65091635aff888da739eb9e0d3 /clang/test/Analysis/nullptr.cpp | |
parent | c7ddb7fcdba09403c3919bfc59bec77de5895197 (diff) | |
download | bcm5719-llvm-c9f16fe48c40e7683d0029b65090d0007414d7af.tar.gz bcm5719-llvm-c9f16fe48c40e7683d0029b65090d0007414d7af.zip |
[analyzer] Don't report null dereferences on address_space annotated memory
llvm-svn: 256885
Diffstat (limited to 'clang/test/Analysis/nullptr.cpp')
-rw-r--r-- | clang/test/Analysis/nullptr.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Analysis/nullptr.cpp b/clang/test/Analysis/nullptr.cpp index 17320f3b9a8..acc525e9fef 100644 --- a/clang/test/Analysis/nullptr.cpp +++ b/clang/test/Analysis/nullptr.cpp @@ -126,3 +126,22 @@ decltype(nullptr) returnsNullPtrType(); void fromReturnType() { ((X *)returnsNullPtrType())->f(); // expected-warning{{Called C++ object pointer is null}} } + +#define AS_ATTRIBUTE __attribute__((address_space(256))) +class AS1 { +public: + int x; + ~AS1() { + int AS_ATTRIBUTE *x = 0; + *x = 3; // no-warning + } +}; +void test_address_space_field_access() { + AS1 AS_ATTRIBUTE *pa = 0; + pa->x = 0; // no-warning +} +void test_address_space_bind() { + AS1 AS_ATTRIBUTE *pa = 0; + AS1 AS_ATTRIBUTE &r = *pa; + r.x = 0; // no-warning +} |