[AMDGPU] Remove s_wakeup_barrier instruction (#122277)
[llvm-project.git] / compiler-rt / test / lsan / TestCases / pointer_to_self.cpp
blob7404af43463f005526f97443efea31c7f069e36a
1 // Regression test: pointers to self should not confuse LSan into thinking the
2 // object is indirectly leaked. Only external pointers count.
3 // RUN: %clangxx_lsan %s -o %t
4 // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include "sanitizer_common/print_address.h"
10 int main() {
11 void *p = malloc(1337);
12 *reinterpret_cast<void **>(p) = p;
13 print_address("Test alloc: ", 1, p);
15 // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
16 // CHECK: LeakSanitizer: detected memory leaks
17 // CHECK: [[ADDR]] (1337 bytes)
18 // CHECK: SUMMARY: {{.*}}Sanitizer: