197ccf6b8SFangrui Song // Test that lsan reports a proper error when running under strace. 297ccf6b8SFangrui Song // REQUIRES: strace 397ccf6b8SFangrui Song // RUN: %clangxx_lsan %s -o %t 497ccf6b8SFangrui Song // RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s 5*3b3aef19SVy Nguyen // FIXME: This technically works in practice but cannot be tested because the 6*3b3aef19SVy Nguyen // fatal-error caused adb to failed. Could not be captured to stderr to lit-check. 7*3b3aef19SVy Nguyen // XFAIL: android 897ccf6b8SFangrui Song 997ccf6b8SFangrui Song #include <stdio.h> 1097ccf6b8SFangrui Song #include <stdlib.h> 1197ccf6b8SFangrui Song 1297ccf6b8SFangrui Song static volatile void *sink; 1397ccf6b8SFangrui Song main()1497ccf6b8SFangrui Songint main() { 1597ccf6b8SFangrui Song sink = malloc(42); 1697ccf6b8SFangrui Song } 1797ccf6b8SFangrui Song // CHECK: LeakSanitizer has encountered a fatal error 1897ccf6b8SFangrui Song // CHECK: HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc) 19