diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:02:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:02:40 +0000 |
commit | 462d72ec21756f5ca1002f128f014d36a845f3d2 (patch) | |
tree | b3d61e87f3a1b79e57d9639497994df822687bf0 /test/asan/TestCases | |
parent | 1992b790c2c12b7850bdf86662b67302052ec2fe (diff) | |
download | src-462d72ec21756f5ca1002f128f014d36a845f3d2.tar.gz src-462d72ec21756f5ca1002f128f014d36a845f3d2.zip |
Vendor import of compiler-rt trunk r308421:vendor/compiler-rt/compiler-rt-trunk-r308421vendor/compiler-rt/compiler-rt-release_50-r311219vendor/compiler-rt/compiler-rt-release_50-r310316vendor/compiler-rt/compiler-rt-release_50-r309439
Notes
Notes:
svn path=/vendor/compiler-rt/dist/; revision=321188
svn path=/vendor/compiler-rt/compiler-rt-release_50-r311219/; revision=322731; tag=vendor/compiler-rt/compiler-rt-release_50-r311219
Diffstat (limited to 'test/asan/TestCases')
-rw-r--r-- | test/asan/TestCases/allocator_returns_null.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/asan/TestCases/allocator_returns_null.cc b/test/asan/TestCases/allocator_returns_null.cc index 90e25b55e727..8ce002f04d61 100644 --- a/test/asan/TestCases/allocator_returns_null.cc +++ b/test/asan/TestCases/allocator_returns_null.cc @@ -36,10 +36,13 @@ // RUN: %env_asan_opts=allocator_may_return_null=1 %run %t new-nothrow 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-nnNULL +// UNSUPPORTED: win32 + #include <assert.h> -#include <string.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <limits> #include <new> @@ -84,6 +87,8 @@ int main(int argc, char **argv) { assert(0); } + fprintf(stderr, "errno: %d\n", errno); + // The NULL pointer is printed differently on different systems, while (long)0 // is always the same. fprintf(stderr, "x: %lx\n", (long)x); @@ -108,14 +113,19 @@ int main(int argc, char **argv) { // CHECK-nnCRASH: AddressSanitizer's allocator is terminating the process // CHECK-mNULL: malloc: +// CHECK-mNULL: errno: 12 // CHECK-mNULL: x: 0 // CHECK-cNULL: calloc: +// CHECK-cNULL: errno: 12 // CHECK-cNULL: x: 0 // CHECK-coNULL: calloc-overflow: +// CHECK-coNULL: errno: 12 // CHECK-coNULL: x: 0 // CHECK-rNULL: realloc: +// CHECK-rNULL: errno: 12 // CHECK-rNULL: x: 0 // CHECK-mrNULL: realloc-after-malloc: +// CHECK-mrNULL: errno: 12 // CHECK-mrNULL: x: 0 // CHECK-nnNULL: new-nothrow: // CHECK-nnNULL: x: 0 |