summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2013-09-06 12:04:37 +0000
committerAlexander Potapenko <glider@google.com>2013-09-06 12:04:37 +0000
commit2a54274c255351e068cf70e77a241a965f12a3a4 (patch)
treeb3be426ab5792e3b7fd02384d3db356f825443af /compiler-rt
parent5bc670bb55346798621a823775de6b0bb990ef15 (diff)
downloadbcm5719-llvm-2a54274c255351e068cf70e77a241a965f12a3a4.tar.gz
bcm5719-llvm-2a54274c255351e068cf70e77a241a965f12a3a4.zip
[ASan] make the check for NULL more portable.
llvm-svn: 190139
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/asan/lit_tests/TestCases/allocator_returns_null.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/allocator_returns_null.cc b/compiler-rt/lib/asan/lit_tests/TestCases/allocator_returns_null.cc
index 281debba4e2..866ce90e668 100644
--- a/compiler-rt/lib/asan/lit_tests/TestCases/allocator_returns_null.cc
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/allocator_returns_null.cc
@@ -53,7 +53,9 @@ int main(int argc, char **argv) {
x = (char*)realloc(t, size);
assert(*t == 42);
}
- fprintf(stderr, "x: %p\n", x);
+ // The NULL pointer is printed differently on different systems, while (long)0
+ // is always the same.
+ fprintf(stderr, "x: %lx\n", (long)x);
return x != 0;
}
// CHECK-mCRASH: malloc:
@@ -68,12 +70,12 @@ int main(int argc, char **argv) {
// CHECK-mrCRASH: AddressSanitizer's allocator is terminating the process
// CHECK-mNULL: malloc:
-// CHECK-mNULL: x: (nil)
+// CHECK-mNULL: x: 0
// CHECK-cNULL: calloc:
-// CHECK-cNULL: x: (nil)
+// CHECK-cNULL: x: 0
// CHECK-coNULL: calloc-overflow:
-// CHECK-coNULL: x: (nil)
+// CHECK-coNULL: x: 0
// CHECK-rNULL: realloc:
-// CHECK-rNULL: x: (nil)
+// CHECK-rNULL: x: 0
// CHECK-mrNULL: realloc-after-malloc:
-// CHECK-mrNULL: x: (nil)
+// CHECK-mrNULL: x: 0
OpenPOWER on IntegriCloud