[compiler-rt] r227161 - [ASan] Use rpath in tests that produce a shared library
Kuba Brecka
kuba.brecka at gmail.com
Mon Jan 26 17:29:18 PST 2015
Author: kuba.brecka
Date: Mon Jan 26 19:29:18 2015
New Revision: 227161
URL: http://llvm.org/viewvc/llvm-project?rev=227161&view=rev
Log:
[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.
Modified:
compiler-rt/trunk/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc
compiler-rt/trunk/test/asan/TestCases/suppressions-library.cc
Modified: compiler-rt/trunk/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc?rev=227161&r1=227160&r2=227161&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc Mon Jan 26 19:29:18 2015
@@ -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, at executable-path -L%T -linterception-in-shared-lib-test && \
+// RUN: %clangxx_asan -O0 %s -o %t -Wl,-rpath, at executable_path %t-so.so && \
// RUN: not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
Modified: compiler-rt/trunk/test/asan/TestCases/suppressions-library.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/suppressions-library.cc?rev=227161&r1=227160&r2=227161&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/suppressions-library.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/suppressions-library.cc Mon Jan 26 19:29:18 2015
@@ -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
More information about the llvm-commits
mailing list