aboutsummaryrefslogtreecommitdiffstats
path: root/test/lit.cfg
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
commit2c3c7fd6960de68e8c27fdf8f7e73796acb5f4c5 (patch)
tree3b4de35c0b349d778c6c498d86b431859dc5e035 /test/lit.cfg
parent7172b38af7ed5d1c1e2c97fadfb0ae0c19aff816 (diff)
downloadexternal_llvm-2c3c7fd6960de68e8c27fdf8f7e73796acb5f4c5.zip
external_llvm-2c3c7fd6960de68e8c27fdf8f7e73796acb5f4c5.tar.gz
external_llvm-2c3c7fd6960de68e8c27fdf8f7e73796acb5f4c5.tar.bz2
Add the ability to use guarded malloc when running llvm lit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186134 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lit.cfg')
-rw-r--r--test/lit.cfg20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index 5752046..ddb02ec 100644
--- a/test/lit.cfg
+++ b/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})