[MLIR][NVVM] Declare InferIntRangeInterface for RangeableRegisterOp (#122263)
[llvm-project.git] / compiler-rt / test / lsan / TestCases / suppressions_file.cpp
blob31cb9174888f34733afac36446f24db5210ced5a
1 // RUN: %clangxx_lsan %s -o %t
3 // RUN: rm -f %t.supp
4 // RUN: touch %t.supp
5 // RUN: %push_to_device %t.supp %device_rundir/%t.supp
6 // RUN: %env_lsan_opts="use_registers=0:use_stacks=0:suppressions='%device_rundir/%t.supp'" not %run %t 2>&1 | FileCheck %s --check-prefix=NOSUPP
8 // RUN: echo "leak:*LSanTestLeakingFunc*" > %t.supp
9 // RUN: %push_to_device %t.supp %device_rundir/%t.supp
10 // RUN: %env_lsan_opts="use_registers=0:use_stacks=0:suppressions='%device_rundir/%t.supp'" not %run %t 2>&1 | FileCheck %s
12 // RUN: echo "leak:%t" > %t.supp
13 // RUN: %push_to_device %t.supp %device_rundir/%t.supp
14 // RUN: %env_lsan_opts="use_registers=0:use_stacks=0:suppressions='%device_rundir/%t.supp':symbolize=false" %run %t
16 // FIXME: Investigate.
17 // XFAIL: internal_symbolizer && lsan-standalone && i386-linux
19 #include <stdio.h>
20 #include <stdlib.h>
22 void *LSanTestLeakingFunc() {
23 void *p = malloc(666);
24 fprintf(stderr, "Test alloc: %p.\n", p);
25 return p;
28 void LSanTestUnsuppressedLeakingFunc() {
29 void **p = (void **)LSanTestLeakingFunc();
30 *p = malloc(777);
31 fprintf(stderr, "Test alloc: %p.\n", *p);
34 int main() {
35 LSanTestUnsuppressedLeakingFunc();
36 void *q = malloc(1337);
37 fprintf(stderr, "Test alloc: %p.\n", q);
38 return 0;
40 // CHECK: Suppressions used:
41 // CHECK: 1 666 *LSanTestLeakingFunc*
42 // CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
44 // NOSUPP: SUMMARY: {{.*}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s).