]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/lsan/TestCases/suppressions_file.cc
1 // RUN: LSAN_BASE="use_registers=0:use_stacks=0"
2 // RUN: %clangxx_lsan %s -o %t
6 // RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp'" not %run %t 2>&1 | FileCheck %s --check-prefix=NOSUPP
8 // RUN: echo "leak:*LSanTestLeakingFunc*" > %t.supp
9 // RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp'" not %run %t 2>&1 | FileCheck %s
11 // RUN: echo "leak:%t" > %t.supp
12 // RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp':symbolize=false" %run %t
17 void LSanTestLeakingFunc() {
18 void *p
= malloc(666);
19 fprintf(stderr
, "Test alloc: %p.\n", p
);
23 LSanTestLeakingFunc();
24 void *q
= malloc(1337);
25 fprintf(stderr
, "Test alloc: %p.\n", q
);
28 // CHECK: Suppressions used:
29 // CHECK: 1 666 *LSanTestLeakingFunc*
30 // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
32 // NOSUPP: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s).