[llvm] r186134 - Add the ability to use guarded malloc when running llvm lit tests.

David Dean david_dean at apple.com
Thu Jul 11 16:36:58 PDT 2013


Author: ddean
Date: Thu Jul 11 18:36:57 2013
New Revision: 186134

URL: http://llvm.org/viewvc/llvm-project?rev=186134&view=rev
Log:
Add the ability to use guarded malloc when running llvm lit tests.

Modified:
    llvm/trunk/test/lit.cfg

Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=186134&r1=186133&r2=186134&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Thu Jul 11 18:36:57 2013
@@ -294,3 +294,23 @@ except OSError, why:
 if re.search(r'with assertions', llc_cmd.stdout.read()):
     config.available_features.add('asserts')
 llc_cmd.wait()
+
+# Check if we should use gmalloc.
+use_gmalloc_str = lit.params.get('use_gmalloc', None)
+if use_gmalloc_str is not None:
+    if use_gmalloc_str.lower() in ('1', 'true'):
+        use_gmalloc = True
+    elif use_gmalloc_str.lower() in ('', '0', 'false'):
+        use_gmalloc = False
+    else:
+        lit.fatal('user parameter use_gmalloc should be 0 or 1')
+else:
+    # Default to not using gmalloc
+    use_gmalloc = False
+
+# Allow use of an explicit path for gmalloc library.
+# Will default to '/usr/lib/libgmalloc.dylib' if not set.
+gmalloc_path_str = lit.params.get('gmalloc_path', '/usr/lib/libgmalloc.dylib')
+
+if use_gmalloc:
+     config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})





More information about the llvm-commits mailing list