Files
clang-p2996/compiler-rt/test/asan/TestCases/global-address.cpp
Filipe Cabecinhas 08c1eb9b63 [asan] Fix GlobalAddressDescription::Print()
Summary: Check bug_type for nullptr before calling internal_strcmp

Reviewers: kcc, vitalybuka, eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24773

llvm-svn: 282012
2016-09-20 20:33:18 +00:00

13 lines
451 B
C++

// RUN: %clangxx_asan -o %t %s
// RUN: not %run %t 2>&1 | FileCheck %s
#include <sanitizer/allocator_interface.h>
int g_i = 42;
int main() {
// CHECK: AddressSanitizer: attempting to call __sanitizer_get_allocated_size() for pointer which is not owned
// CHECK-NOT: ASAN:DEADLYSIGNAL
// CHECK: SUMMARY: AddressSanitizer: bad-__sanitizer_get_allocated_size
// CHECK-NOT: ASAN:DEADLYSIGNAL
return (int)__sanitizer_get_allocated_size(&g_i);
}