From d6535ea4c4d49078a93735b315b8518fb692a592 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Tue, 1 Apr 2014 13:16:30 +0000 Subject: [ASan] Optional support for dynamic ASan runtime on Linux. Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205308 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/asan/TestCases/Linux/asan_dlopen_test.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/asan/TestCases/Linux/asan_dlopen_test.cc (limited to 'test/asan/TestCases/Linux/asan_dlopen_test.cc') diff --git a/test/asan/TestCases/Linux/asan_dlopen_test.cc b/test/asan/TestCases/Linux/asan_dlopen_test.cc new file mode 100644 index 000000000..83ce4f83b --- /dev/null +++ b/test/asan/TestCases/Linux/asan_dlopen_test.cc @@ -0,0 +1,14 @@ +// Test that dlopen of dynamic runtime is prohibited. +// +// RUN: %clangxx %s -DRT=\"%shared_libasan\" -o %t -ldl +// RUN: not %t 2>&1 | FileCheck %s +// REQUIRES: asan-dynamic-runtime + +#include + +int main(int argc, char **argv) { + dlopen(RT, RTLD_LAZY); + return 0; +} + +// CHECK: ASan runtime does not come first in initial library list -- cgit v1.2.3