1// Test that dlopen of dynamic runtime is prohibited.
2//
3// RUN: %clangxx %s -DRT=\"%shared_libasan\" -o %t -ldl
4// RUN: not %run %t 2>&1 | FileCheck %s
5// RUN: %env_asan_opts=verify_asan_link_order=true not %run %t 2>&1 | FileCheck %s
6// RUN: %env_asan_opts=verify_asan_link_order=false %run %t 2>&1
7// REQUIRES: asan-dynamic-runtime
8// XFAIL: android
9
10#include <dlfcn.h>
11
12int main(int argc, char **argv) {
13 dlopen(RT, RTLD_LAZY);
14 return 0;
15}
16
17// CHECK: ASan runtime does not come first in initial library list
18

source code of compiler-rt/test/asan/TestCases/Linux/asan_dlopen_test.cpp