[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / lsan / TestCases / large_allocation_leak.cpp
blobcd8ea44428c1b9c32a299734a19251fda82c5dc9
1 // Test that LargeMmapAllocator's chunks aren't reachable via some internal data structure.
2 // RUN: %clangxx_lsan %s -o %t
3 // RUN: %env_lsan_opts=report_objects=1:use_stacks=0:use_registers=0 not %run %t 2>&1 | FileCheck %s
5 // For 32 bit LSan it's pretty likely that large chunks are "reachable" from some
6 // internal data structures (e.g. Glibc global data).
7 // UNSUPPORTED: x86,i686,arm
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include "sanitizer_common/print_address.h"
13 int main() {
14 // maxsize in primary allocator is always less than this (1 << 25).
15 void *large_alloc = malloc(33554432);
16 print_address("Test alloc: ", 1, large_alloc);
17 return 0;
19 // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
20 // CHECK: LeakSanitizer: detected memory leaks
21 // CHECK: [[ADDR]] (33554432 bytes)
22 // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: