Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / Linux / leak.cpp
bloba4ee99b1f4088206812c70b11327dda5794aefb3
1 // Minimal test for LeakSanitizer+AddressSanitizer.
2 // REQUIRES: leak-detection
3 //
4 // RUN: %clangxx_asan %s -o %t
5 // RUN: %env_asan_opts=detect_leaks=1 not %run %t 2>&1 | FileCheck %s
6 // RUN: not %run %t 2>&1 | FileCheck %s
7 // RUN: %env_asan_opts=detect_leaks=0 %run %t
8 #include <stdio.h>
9 int *t;
11 int main(int argc, char **argv) {
12 t = new int[argc - 1] - 100000;
13 printf("t: %p\n", t);
15 // CHECK: LeakSanitizer: detected memory leaks