summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2015-01-27 01:29:18 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2015-01-27 01:29:18 +0000
commitaa772feb8ec053b2c8cef2fe6af5676157334f36 (patch)
tree27e7b95afac8021d7beb73694edc0dcd90b8b78c
parent349d5886e58e39d6492655e6d0acbf3307332892 (diff)
downloadbcm5719-llvm-aa772feb8ec053b2c8cef2fe6af5676157334f36.tar.gz
bcm5719-llvm-aa772feb8ec053b2c8cef2fe6af5676157334f36.zip
[ASan] Use rpath in tests that produce a shared library
Modifying Darwin/interception-in-shared-lib-test.cc and suppressions-library.cc to use rpath instead of linking against the full path to the temporary file. NFC. llvm-svn: 227161
-rw-r--r--compiler-rt/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc6
-rw-r--r--compiler-rt/test/asan/TestCases/suppressions-library.cc6
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler-rt/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc b/compiler-rt/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc
index e472a9dc697..028683d2fc4 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc
+++ b/compiler-rt/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc
@@ -3,11 +3,11 @@
// ../Linux/interception-in-shared-lib-test.cc.
// RUN: %clangxx_asan -O0 %s -DSHARED_LIB \
-// RUN: -shared -o %T/libinterception-in-shared-lib-test.so \
-// RUN: -fPIC
+// RUN: -shared -o %t-so.so \
+// RUN: -fPIC -install_name @rpath/interception-in-shared-lib-test.cc.tmp-so.so
// TODO(glider): figure out how to set rpath in a more portable way and unite
// this test with ../Linux/interception-in-shared-lib-test.cc.
-// RUN: %clangxx_asan -O0 %s -o %t -Wl,-rpath,@executable-path -L%T -linterception-in-shared-lib-test && \
+// RUN: %clangxx_asan -O0 %s -o %t -Wl,-rpath,@executable_path %t-so.so && \
// RUN: not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
diff --git a/compiler-rt/test/asan/TestCases/suppressions-library.cc b/compiler-rt/test/asan/TestCases/suppressions-library.cc
index 1a03114b282..28f19f54efc 100644
--- a/compiler-rt/test/asan/TestCases/suppressions-library.cc
+++ b/compiler-rt/test/asan/TestCases/suppressions-library.cc
@@ -1,10 +1,10 @@
-// RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -O0 %s %t-so.so -o %t
+// RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so -install_name @rpath/suppressions-library.cc.tmp-so.so
+// RUN: %clangxx_asan -O0 %s %t-so.so -o %t -rpath @executable_path
// Check that without suppressions, we catch the issue.
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
-// RUN: echo "interceptor_via_lib:%t-so.so" > %t.supp
+// RUN: echo "interceptor_via_lib:suppressions-library.cc.tmp-so.so" > %t.supp
// RUN: ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
// XFAIL: android
OpenPOWER on IntegriCloud