Files
clang-p2996/compiler-rt/test/msan/check-handler.cc
Alex Shlyapnikov 4b30a4261f [MSan] Print current stack on CHECK violation
Summary:
Print current stack on CHECK violation to aid debugging and
match other sanitizers functionality.

Reviewers: eugenis

Subscribers: delcypher, llvm-commits, #sanitizers

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

llvm-svn: 326105
2018-02-26 18:27:24 +00:00

17 lines
456 B
C++

// RUN: %clangxx_msan -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s
// Verify that CHECK handler prints a stack on CHECK fail.
#include <stdlib.h>
int main(void) {
// Allocate chunk from the secondary allocator to trigger CHECK(IsALigned())
// in its free() path.
void *p = malloc(8 << 20);
free(reinterpret_cast<char*>(p) + 1);
// CHECK: MemorySanitizer: bad pointer
// CHECK: MemorySanitizer CHECK failed
// CHECK: #0
return 0;
}