Use a ManagedCleanup to prevent leaking the PassRegistrar map. In breaks the
[oota-llvm.git] / test / Unit / lit.cfg
index 34372bb6cbe9381c519c0f96f9ccdb512b75f8a8..5fe07324a1ba1feda21a023b3cba9d5f79bc75a8 100644 (file)
@@ -23,7 +23,14 @@ config.test_format = lit.formats.GoogleTest(llvm_build_mode, 'Tests')
 
 ###
 
-import os
+# If necessary, point the dynamic loader at libLLVM.so.
+if config.enable_shared:
+    libdir = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'lib')
+    shlibpath = config.environment.get(config.shlibpath_var,'')
+    if shlibpath:
+        shlibpath = ':' + shlibpath
+    shlibpath = libdir + shlibpath
+    config.environment[config.shlibpath_var] = shlibpath
 
 # Check that the object root is known.
 if config.test_exec_root is None: