Home | History | Annotate | Download | only in Darwin
      1 // Make sure ASan removes the runtime library from DYLD_INSERT_LIBRARIES before
      2 // executing other programs.
      3 
      4 // RUN: %clangxx_asan -m64 %s -o %t
      5 // RUN: %clangxx -m64 %p/../SharedLibs/darwin-dummy-shared-lib-so.cc \
      6 // RUN:     -dynamiclib -o darwin-dummy-shared-lib-so.dylib
      7 
      8 // Make sure DYLD_INSERT_LIBRARIES doesn't contain the runtime library before
      9 // execl().
     10 
     11 // RUN: %t >/dev/null 2>&1
     12 // RUN: DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
     13 // RUN:     %t 2>&1 | FileCheck %s || exit 1
     14 #include <unistd.h>
     15 int main() {
     16   execl("/bin/bash", "/bin/bash", "-c",
     17         "echo DYLD_INSERT_LIBRARIES=$DYLD_INSERT_LIBRARIES", NULL);
     18   // CHECK:  {{DYLD_INSERT_LIBRARIES=.*darwin-dummy-shared-lib-so.dylib.*}}
     19   return 0;
     20 }
     21