diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2018-01-22 23:28:52 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2018-01-22 23:28:52 +0000 |
commit | ac8217de8323cf7efe1da0fa24b4006c96d82f66 (patch) | |
tree | a8ef1d9484dcb90bb2de63e196a8078867a9faf0 | |
parent | 322fcfee34effec55c20a4986f19a3894a132284 (diff) | |
download | bcm5719-llvm-ac8217de8323cf7efe1da0fa24b4006c96d82f66.tar.gz bcm5719-llvm-ac8217de8323cf7efe1da0fa24b4006c96d82f66.zip |
Small fixes for detect_invalid_pointer_pairs.
Summary:
One test-case uses a wrong operation (should be subtraction).
Second test-case should declare a global variables before a tested one
in order to guarantee we will find a red-zone.
Reviewers: kcc, jakubjelinek, alekseyshl
Reviewed By: alekseyshl
Subscribers: kubamracek
Differential Revision: https://reviews.llvm.org/D41481
llvm-svn: 323162
-rw-r--r-- | compiler-rt/test/asan/TestCases/invalid-pointer-pairs-compare-errors.cc | 4 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cc | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-compare-errors.cc b/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-compare-errors.cc index 82f63359ead..3c4f7d65eeb 100644 --- a/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-compare-errors.cc +++ b/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-compare-errors.cc @@ -10,8 +10,12 @@ int foo(char *p, char *q) { } char global1[100] = {}, global2[100] = {}; +char __attribute__((used)) smallest_global[5] = {}; char small_global[7] = {}; +char __attribute__((used)) little_global[10] = {}; +char __attribute__((used)) medium_global[4000] = {}; char large_global[5000] = {}; +char __attribute__((used)) largest_global[6000] = {}; int main() { // Heap allocated memory. diff --git a/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cc b/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cc index 4ce48424899..de175a778c9 100644 --- a/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cc +++ b/compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cc @@ -6,7 +6,7 @@ #include <stdlib.h> int bar(char *p, char *q) { - return p <= q; + return p - q; } char global[10000] = {}; |