]> git.proxmox.com Git - rustc.git/blobdiff - src/compiler-rt/test/asan/TestCases/Darwin/reexec-insert-libraries-env.cc
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / asan / TestCases / Darwin / reexec-insert-libraries-env.cc
index db6005cbab338a3cd3f19f566b70fac738872fca..aa4d92b00a01762e7b1430acab8ac6120e7d2f8e 100644 (file)
@@ -3,12 +3,14 @@
 // https://code.google.com/p/address-sanitizer/issues/detail?id=159
 
 // RUN: %clangxx_asan %s -o %t
-// RUN: %clangxx %p/../SharedLibs/darwin-dummy-shared-lib-so.cc \
+// RUN: %clangxx -DSHARED_LIB %s \
 // RUN:     -dynamiclib -o darwin-dummy-shared-lib-so.dylib
 
 // FIXME: the following command line may hang in the case of a regression.
-// RUN: DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
+// RUN: env DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
 // RUN:     %run %t 2>&1 | FileCheck %s || exit 1
+
+#if !defined(SHARED_LIB)
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -18,3 +20,6 @@ int main() {
   // CHECK: {{DYLD_INSERT_LIBRARIES=.*darwin-dummy-shared-lib-so.dylib.*}}
   return 0;
 }
+#else  // SHARED_LIB
+void foo() {}
+#endif  // SHARED_LIB