Move MSan lit-tests under test/msan
[blocksruntime.git] / lib / asan / lit_tests / TestCases / Darwin / unset-insert-libraries-on-exec.cc
blobfa0dd4f9df888c12d1de39b8d5ccb03b00a8130c
1 // Make sure ASan removes the runtime library from DYLD_INSERT_LIBRARIES before
2 // executing other programs.
4 // RUN: %clangxx_asan %s -o %t
5 // RUN: %clangxx %p/../Helpers/echo-env.cc -o %T/echo-env
6 // RUN: %clangxx %p/../SharedLibs/darwin-dummy-shared-lib-so.cc \
7 // RUN: -dynamiclib -o %t-darwin-dummy-shared-lib-so.dylib
9 // Make sure DYLD_INSERT_LIBRARIES doesn't contain the runtime library before
10 // execl().
12 // RUN: %t %T/echo-env >/dev/null 2>&1
13 // RUN: DYLD_INSERT_LIBRARIES=%t-darwin-dummy-shared-lib-so.dylib \
14 // RUN: %t %T/echo-env 2>&1 | FileCheck %s || exit 1
15 #include <unistd.h>
16 int main(int argc, char *argv[]) {
17 execl(argv[1], argv[1], "DYLD_INSERT_LIBRARIES", NULL);
18 // CHECK: {{DYLD_INSERT_LIBRARIES = .*darwin-dummy-shared-lib-so.dylib.*}}
19 return 0;