You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
446 B
16 lines
446 B
// 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] - 100000;
|
|
printf("t: %p\n", t);
|
|
}
|
|
// CHECK: LeakSanitizer: detected memory leaks
|