• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Test that LargeMmapAllocator's chunks aren't reachable via some internal data structure.
2 // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
3 // RUN: %clangxx_lsan %s -o %t
4 // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 
main()9 int main() {
10   // maxsize in primary allocator is always less than this (1 << 25).
11   void *large_alloc = malloc(33554432);
12   fprintf(stderr, "Test alloc: %p.\n", large_alloc);
13   return 0;
14 }
15 // CHECK: Test alloc: [[ADDR:.*]].
16 // CHECK: LeakSanitizer: detected memory leaks
17 // CHECK: [[ADDR]] (33554432 bytes)
18 // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
19