summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/lsan_annotations.cc
blob: c55ab8692eb5f401becedaa682cc1408132d2500 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Check that LSan annotations work fine.
// RUN: %clangxx_asan -O0 %s -o %t && %t
// RUN: %clangxx_asan -O3 %s -o %t && %t

#include <sanitizer/lsan_interface.h>
#include <stdlib.h>

int main() {
  int *x = new int;
  __lsan_ignore_object(x);
  {
    __lsan::ScopedDisabler disabler;
    double *y = new double;
  }
  return 0;
}