reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
// Minimal test for LeakSanitizer+AddressSanitizer.
// REQUIRES: leak-detection
//
// RUN: %clangxx_asan  %s -o %t
// RUN: %env_asan_opts=detect_leaks=1 not %run %t  2>&1 | FileCheck %s
// RUN: not %run %t  2>&1 | FileCheck %s
// RUN: %env_asan_opts=detect_leaks=0     %run %t
#include <stdio.h>
int *t;

int main(int argc, char **argv) {
  t = new int[argc - 1];
  printf("t: %p\n", t);
  t = 0;
}
// CHECK: LeakSanitizer: detected memory leaks