summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDavid Dean <david_dean@apple.com>2013-07-11 23:36:57 +0000
committerDavid Dean <david_dean@apple.com>2013-07-11 23:36:57 +0000
commitf3ed6561898cffad14c3b6d775c96349db32e81f (patch)
treeff456def0dd2a475d12a2e2d7a80d59a69c3afa6 /llvm
parent1341baf515b98ebf037e39a3989f7ea78d50464c (diff)
downloadbcm5719-llvm-f3ed6561898cffad14c3b6d775c96349db32e81f.tar.gz
bcm5719-llvm-f3ed6561898cffad14c3b6d775c96349db32e81f.zip
Add the ability to use guarded malloc when running llvm lit tests.
llvm-svn: 186134
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/lit.cfg20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg
index 57520469708..ddb02ecf569 100644
--- a/llvm/test/lit.cfg
+++ b/llvm/test/lit.cfg
@@ -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})
OpenPOWER on IntegriCloud