2018-02-27 02:27:24 +08:00
|
|
|
// 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
|
2021-05-11 16:18:48 +08:00
|
|
|
// CHECK: MemorySanitizer: CHECK failed
|
2018-02-27 02:27:24 +08:00
|
|
|
// CHECK: #0
|
|
|
|
return 0;
|
|
|
|
}
|