Move ASan lit-tests under test/asan
[blocksruntime.git] / test / asan / TestCases / Darwin / reexec-insert-libraries-env.cc
blob208fe43ac7e4043fd2f726e5d12974ee834da397
1 // Make sure ASan doesn't hang in an exec loop if DYLD_INSERT_LIBRARIES is set.
2 // This is a regression test for
3 // https://code.google.com/p/address-sanitizer/issues/detail?id=159
5 // RUN: %clangxx_asan %s -o %t
6 // RUN: %clangxx %p/../SharedLibs/darwin-dummy-shared-lib-so.cc \
7 // RUN: -dynamiclib -o darwin-dummy-shared-lib-so.dylib
9 // FIXME: the following command line may hang in the case of a regression.
10 // RUN: DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
11 // RUN: %t 2>&1 | FileCheck %s || exit 1
12 #include <stdio.h>
13 #include <stdlib.h>
15 int main() {
16 const char kEnvName[] = "DYLD_INSERT_LIBRARIES";
17 printf("%s=%s\n", kEnvName, getenv(kEnvName));
18 // CHECK: {{DYLD_INSERT_LIBRARIES=.*darwin-dummy-shared-lib-so.dylib.*}}
19 return 0;