[mlir] More fixes for 9fddaf6b14102963f12dbb9730f101fc52e662c1
[llvm-project.git] / compiler-rt / test / lsan / TestCases / flag_tries.c
blobd6af766d5ef282d09bbdddaaa991102ca0f1553f
1 // Test retries option of lsan.
2 // RUN: %clang_lsan %s -o %t
3 // RUN: %env_lsan_opts=use_stacks=0:use_registers=0:symbolize=0 %run %t foo 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK1
4 // RUN: %env_lsan_opts=use_stacks=0:use_registers=0:symbolize=0:tries=12 %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK12
6 #include <assert.h>
7 #include <sanitizer/lsan_interface.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <unistd.h>
12 void *p;
14 int main(int argc, char *argv[]) {
15 fprintf(stderr, "Test alloc: %p.\n", malloc(1337));
16 // CHECK: Test alloc:
18 assert(__lsan_do_recoverable_leak_check() == 1);
19 // CHECK1-COUNT-1: SUMMARY: {{.*}}Sanitizer: 1337 byte
20 // CHECK12-COUNT-12: SUMMARY: {{.*}}Sanitizer: 1337 byte
22 _exit(0);