brintos

brintos / llvm-project-archived public Read only

0
0
Text · 457 B · 0bdb433 Raw
17 lines · cpp
1// RUN: %clangxx_msan -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s2 3// Verify that CHECK handler prints a stack on CHECK fail.4 5#include <stdlib.h>6 7int main(void) {8  // Allocate chunk from the secondary allocator to trigger CHECK(IsALigned())9  // in its free() path.10  void *p = malloc(8 << 20);11  free(reinterpret_cast<char*>(p) + 1);12  // CHECK: MemorySanitizer: bad pointer13  // CHECK: MemorySanitizer: CHECK failed14  // CHECK: #015  return 0;16}17